power.h(3avr)

πŸ“¦
version 2.0.0+Atmel3.7.0 Β· 2 versions
, in ubuntu noble

✨ 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 from 1 to 129. so be careful, okay? 🚨 the return value could differ from the typedef enum clock_div_t. this should only happen if clock_prescale_set was previously called with a value other than those defined by clock_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