power.h(3)

πŸ“¦ version 2.2.1, in fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– power.h πŸ’–

okay bestie, so this is power.h from avr-libc (that's the AVR C library, iykyk) and it's literally all about poking the clock prescaler on your AVR chip. no cap, it's a tiny header but it's giving main character energy for your power/clock setup. let's get into it πŸ¦‹


✨ NAME ✨

power.h β€” that's it, that's the name, she's iconic and she knows it πŸ’…


🌸 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 this one gets the clock prescaler register setting and hands it right back to you 🫢 the return type is clock_div_t. like, it reads CLKPR, masks out the CLKPS0–CLKPS3 bits, and gives you the vibe of your current prescaler. periodt.

⚠️ Note: for devices that have an XTAL Divide Control Register (XDIV), the return value can actually range from 1 to 129. so heads up, bestie β€” care should be taken, because 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. 😭 not the enum mismatch, we hate to see it.

πŸ’œ Function Documentation πŸ’œ

static __inline void __attribute__ ((__always_inline__)) [static]

that's the whole entry, no further tea. πŸ“


🌈 Author 🌈

Generated automatically by Doxygen for avr-libc, straight from the source code. she wrote herself, honestly, slay πŸ’€βœ¨


and that's the whole page, babe πŸŽ€ this is Version 2.1.0, dated Sat Jan 29 2022 β€” so when you see that power.h(3) footer floating around, just know it's her, still iconic, still powering your AVR. mwah πŸ’–πŸ¦‹

πŸ“¦ where this page comes from