---
name: "avr_cpufunc"
section: "3avr"
platform: "linux"
package: "avr-libc"
version: "1:2.2.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/avr_cpufunc"
---

# avr\_cpufunc(3avr)

\<avr/cpufunc.h\>: Special AVR CPU functions

## NAME

avr\_cpufunc - \<avr/cpufunc.h\>: Special AVR CPU functions

## 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>
```

This header file contains macros that access special functions of the AVR CPU which do not fit into any of the other header files.

## Macro Definition Documentation

### #define \_MemoryBarrier()

Implement a read/write *memory barrier*. A memory barrier instructs the compiler to not cache any memory data in registers beyond the barrier. This can sometimes be more effective than blocking certain optimizations by declaring some object with a `volatile` qualifier.

See **Problems with reordering code** for things to be taken into account with respect to compiler optimizations.

### #define \_NOP()

Execute a *no operation* (NOP) CPU instruction. This should not be used to implement delays, better use the functions from \<**util/delay\_basic.h**\> or \<**util/delay.h**\> for this. 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.

## Function Documentation

### void ccp\_write\_io (volatile uint8\_t \* \_\_ioaddr, uint8\_t \_\_value)

Write *\_\_value* to IO Register Protected (CCP) IO register at *\_\_ioaddr*. . See also **\_PROTECTED\_WRITE().**

### void ccp\_write\_spm (volatile uint8\_t \* \_\_ioaddr, uint8\_t \_\_value)

**Write** *\_\_value* **to 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.**
