power.h(3avr)
β¨ power.h β the avr-libc power page β¨
okay bestie, this is power.h from avr-libc (section 3avr for the nerds keeping score) and it is literally your clock-prescaler and power-management plug. tiny page, big main character energy. let's go π
πΈ SYNOPSIS πΈ
π Macros
#define clock_prescale_get() (clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)|(1<<CLKPS3)))
π Functions
static __inline void __attribute__ ((__always_inline__))
__power_all_enable()
void clock_prescale_set (clock_div_t __x)
π Macro Definition Documentation π
#define clock_prescale_get()
(clock_div_t)(CLKPR & (uint8_t)((1<<CLKPS0)|(1<<CLKPS1)|(1<<CLKPS2)|(1<<CLKPS3)))
so what does she do? she goes and reads the clock prescaler register setting, and hands it right back to you. π«Ά that's it, that's the gig. and the return type? that's clock_div_t, no cap.
β οΈ note, and this one matters: for a device that has the XTAL Divide Control Register (XDIV), the return can actually range from1to129. so be careful, okay? π¨ the return value could differ from thetypedef enum clock_div_t. this should only happen ifclock_prescale_setwas previously called with a value other than those defined byclock_div_t. iykyk π
π₯ Function Documentation π₯
static __inline void __attribute__ ((__always_inline__)) [static]
yep, that's the documented signature right there, static, __inline, and marked __always_inline__ because she does not do half measures. periodt. π
π Author π
Generated automatically by Doxygen for avr-libc from the source code. (not a human, just a robot doing its little robot thing, and honestly? it ate. π€β¨)
aaaand that's the whole page bestie π thanks for reading all the way to the bottom, you're an icon. this was Version 2.0.0, dated Fri Nov 24 2023 23:59:10, brought to you by avr-libc β now go set a prescaler and slay π¦π
π¦ where this page comes from
- ubuntu noble: avr-libc 1:2.0.0+Atmel3.7.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms