power.h(3)
π 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 thetypedef enum clock_div_t. this should only happen ifclock_prescale_setwas previously called with a value other than those defined byclock_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
- fedora 43: avr-libc 2.2.1-3.fc43 Β· BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms