avr_cpufunc(3avr)
β¨ avr_cpufunc β the AVR CPU's special little functions π
Bestie, welcome to avr_cpufunc, section 3avr of the manual. This is where the AVR CPU keeps the functions that are too special, too quirky, too main character to live in any of the other header files. π
πΈ SYNOPSIS πΈ
Macros π§
#define _NOP()
#define _MemoryBarrier()
Functions π
void ccp_write_io (volatile uint8_t *__ioaddr, uint8_t __value)
void ccp_write_spm (volatile uint8_t *__ioaddr, uint8_t __value)
π Detailed Description π
#include <avr/cpufunc.h>
okay so this header file is literally the home for macros that reach in and poke at the special functions of the AVR CPU, the ones that just do not fit into any of the other header files. They're too iconic for the other headers, fr fr. π¦
π Macro Definition Documentation π
#define _MemoryBarrier()
This one implements a read/write memory barrier. A memory barrier is basically you telling the compiler: "bestie, do NOT cache any memory data in registers beyond this barrier, I'm begging." π
And lowkey? Sometimes this hits harder than blocking certain optimizations by declaring some object with a volatile qualifier. Different vibe, similar energy.
Check out Problems with reordering code for the stuff you need to take into account with respect to compiler optimizations. Don't skip it, iykyk. π
#define _NOP()
Executes a no operation (NOP) CPU instruction. That's it, that's the whole thing. It does nothing and it slays at it. π
Not me warning you: this should not be used to implement delays. If you want delays, better use the functions from<util/delay_basic.h>or<util/delay.h>for this. Periodt.
That said, for debugging purposes, a NOP can be useful to have an instruction that is guaranteed to be not optimized away by the compiler, so it can always become a breakpoint in the debugger. Sneaky, iconic, we love her. π₯
π Function Documentation π
void ccp_write_io (volatile uint8_t * __ioaddr, uint8_t __value)
Writes __value to the IO Register Protected (CCP) IO register at __ioaddr. . (yes, there's a lil extra period there, she's got flair π )
See also _PROTECTED_WRITE().
void ccp_write_spm (volatile uint8_t * __ioaddr, uint8_t __value)
Writes __value to the SPM Instruction Protected (CCP) IO register at __ioaddr.
See also _PROTECTED_WRITE_SPM().
π«Ά Author π«Ά
Generated automatically by Doxygen for AVR-LibC from the source code. She's self-made, technically. πβ¨
k that's the whole page bestie, no notes, and this lil masterpiece comes to you from AVR-LibC Version 2.2.1, chilling in section 3avr of the avr_cpufunc manual. go write some protected registers, you got this πππ¦β
π¦ where this page comes from
- ubuntu resolute: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- ubuntu stonking: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms