Macros | |
#define | __ASM __asm |
Pass information from the compiler to the assembler. | |
#define | __INLINE __inline |
Recommend that function should be inlined by the compiler. | |
#define | __FORCEINLINE __attribute__((always_inline)) |
#define | __STATIC_INLINE static __inline |
Define a static function should be inlined by the compiler. | |
#define | __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline |
#define | __NO_RETURN __attribute__((__noreturn__)) |
Inform the compiler that a function does not return. | |
#define | CMSIS_DEPRECATED __attribute__((deprecated)) |
#define | __USED __attribute__((used)) |
Inform that a variable shall be retained in executable image. | |
#define | __WEAK __attribute__((weak)) |
Export a function or variable weakly to allow overwrites. | |
#define | __PACKED __attribute__((packed, aligned(1))) |
Request smallest possible alignment. | |
#define | __PACKED_STRUCT struct __attribute__((packed, aligned(1))) |
#define | __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
#define | __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
#define | __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
#define | __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
#define | __ALIGNED(x) __attribute__((aligned(x))) |
Minimum alignment for a variable. | |
#define | __COMPILER_BARRIER() __ASM volatile("":::"memory") |
#define | __NOP __builtin_arm_nop |
No Operation. | |
#define | __WFI __builtin_arm_wfi |
Wait For Interrupt. | |
#define | __WFE __builtin_arm_wfe |
Wait For Event. | |
#define | __SEV __builtin_arm_sev |
Send Event. | |
#define | __ISB() __builtin_arm_isb(0xF) |
Instruction Synchronization Barrier. | |
#define | __DSB() __builtin_arm_dsb(0xF) |
Data Synchronization Barrier. | |
#define | __DMB() __builtin_arm_dmb(0xF) |
Data Memory Barrier. | |
#define | __REV(value) __builtin_bswap32(value) |
Reverse byte order (32 bit) | |
#define | __REV16(value) __ROR(__REV(value), 16) |
Reverse byte order (16 bit) | |
#define | __REVSH(value) (int16_t)__builtin_bswap16(value) |
Reverse byte order (16 bit) | |
#define | __BKPT(value) __ASM volatile ("bkpt "#value) |
Breakpoint. | |
#define | __RBIT __builtin_arm_rbit |
Reverse bit order of value. | |
#define | __LDREXB (uint8_t)__builtin_arm_ldrex |
LDR Exclusive (8 bit) | |
#define | __LDREXH (uint16_t)__builtin_arm_ldrex |
LDR Exclusive (16 bit) | |
#define | __LDREXW (uint32_t)__builtin_arm_ldrex |
LDR Exclusive (32 bit) | |
#define | __STREXB (uint32_t)__builtin_arm_strex |
STR Exclusive (8 bit) | |
#define | __STREXH (uint32_t)__builtin_arm_strex |
STR Exclusive (16 bit) | |
#define | __STREXW (uint32_t)__builtin_arm_strex |
STR Exclusive (32 bit) | |
#define | __CLREX __builtin_arm_clrex |
Remove the exclusive lock. | |
#define | __SSAT __builtin_arm_ssat |
Signed Saturate. | |
#define | __USAT __builtin_arm_usat |
Unsigned Saturate. | |
#define | __get_CP(cp, op1, Rt, CRn, CRm, op2) __ASM volatile("MRC p" # cp ", " # op1 ", %0, c" # CRn ", c" # CRm ", " # op2 : "=r" (Rt) : : "memory" ) |
#define | __set_CP(cp, op1, Rt, CRn, CRm, op2) __ASM volatile("MCR p" # cp ", " # op1 ", %0, c" # CRn ", c" # CRm ", " # op2 : : "r" (Rt) : "memory" ) |
#define | __get_CP64(cp, op1, Rt, CRm) __ASM volatile("MRRC p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : "=r" (Rt) : : "memory" ) |
#define | __set_CP64(cp, op1, Rt, CRm) __ASM volatile("MCRR p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : : "r" (Rt) : "memory" ) |
Functions | |
__STATIC_FORCEINLINE uint32_t | __ROR (uint32_t op1, uint32_t op2) |
Rotate Right in unsigned value (32 bit) | |
__STATIC_FORCEINLINE uint8_t | __CLZ (uint32_t value) |
Count leading zeros. | |
__STATIC_FORCEINLINE uint32_t | __RRX (uint32_t value) |
Rotate Right with Extend (32 bit) | |
__STATIC_FORCEINLINE uint8_t | __LDRBT (volatile uint8_t *ptr) |
LDRT Unprivileged (8 bit) | |
__STATIC_FORCEINLINE uint16_t | __LDRHT (volatile uint16_t *ptr) |
LDRT Unprivileged (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __LDRT (volatile uint32_t *ptr) |
LDRT Unprivileged (32 bit) | |
__STATIC_FORCEINLINE void | __STRBT (uint8_t value, volatile uint8_t *ptr) |
STRT Unprivileged (8 bit) | |
__STATIC_FORCEINLINE void | __STRHT (uint16_t value, volatile uint16_t *ptr) |
STRT Unprivileged (16 bit) | |
__STATIC_FORCEINLINE void | __STRT (uint32_t value, volatile uint32_t *ptr) |
STRT Unprivileged (32 bit) | |
__STATIC_FORCEINLINE void | __enable_irq (void) |
Enable IRQ Interrupts. | |
__STATIC_FORCEINLINE void | __disable_irq (void) |
Disable IRQ Interrupts. | |
__STATIC_FORCEINLINE void | __enable_fault_irq (void) |
Enable FIQ. | |
__STATIC_FORCEINLINE void | __disable_fault_irq (void) |
Disable FIQ. | |
__STATIC_FORCEINLINE uint32_t | __get_FPSCR (void) |
Get FPSCR. | |
__STATIC_FORCEINLINE void | __set_FPSCR (uint32_t fpscr) |
Set FPSCR. | |
__STATIC_FORCEINLINE uint32_t | __get_CPSR (void) |
Get CPSR Register. | |
__STATIC_FORCEINLINE void | __set_CPSR (uint32_t cpsr) |
Set CPSR Register. | |
__STATIC_FORCEINLINE uint32_t | __get_mode (void) |
Get Mode. | |
__STATIC_FORCEINLINE void | __set_mode (uint32_t mode) |
Set Mode. | |
__STATIC_FORCEINLINE uint32_t | __get_SP (void) |
Get Stack Pointer. | |
__STATIC_FORCEINLINE void | __set_SP (uint32_t stack) |
Set Stack Pointer. | |
__STATIC_FORCEINLINE uint32_t | __get_SP_usr (void) |
Get USR/SYS Stack Pointer. | |
__STATIC_FORCEINLINE void | __set_SP_usr (uint32_t topOfProcStack) |
Set USR/SYS Stack Pointer. | |
__STATIC_FORCEINLINE uint32_t | __get_FPEXC (void) |
Get FPEXC. | |
__STATIC_FORCEINLINE void | __set_FPEXC (uint32_t fpexc) |
Set FPEXC. | |
__STATIC_INLINE void | __FPU_Enable (void) |
Enable Floating Point Unit. | |
Variables | |
__PACKED_STRUCT | T_UINT16_WRITE { uint16_t v |
__PACKED_STRUCT | T_UINT16_READ { uint16_t v |
__PACKED_STRUCT | T_UINT32_WRITE { uint32_t v |
__PACKED_STRUCT | T_UINT32_READ { uint32_t v |
#define __CLREX __builtin_arm_clrex |
Remove the exclusive lock.
Removes the exclusive lock which is created by LDREX.
#define __COMPILER_BARRIER | ( | ) | __ASM volatile("":::"memory") |
#define __FORCEINLINE __attribute__((always_inline)) |
#define __get_CP | ( | cp, | |
op1, | |||
Rt, | |||
CRn, | |||
CRm, | |||
op2 | |||
) | __ASM volatile("MRC p" # cp ", " # op1 ", %0, c" # CRn ", c" # CRm ", " # op2 : "=r" (Rt) : : "memory" ) |
#define __get_CP64 | ( | cp, | |
op1, | |||
Rt, | |||
CRm | |||
) | __ASM volatile("MRRC p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : "=r" (Rt) : : "memory" ) |
#define __LDREXB (uint8_t)__builtin_arm_ldrex |
LDR Exclusive (8 bit)
Executes a exclusive LDR instruction for 8 bit value.
[in] | ptr | Pointer to data |
#define __LDREXH (uint16_t)__builtin_arm_ldrex |
LDR Exclusive (16 bit)
Executes a exclusive LDR instruction for 16 bit values.
[in] | ptr | Pointer to data |
#define __LDREXW (uint32_t)__builtin_arm_ldrex |
LDR Exclusive (32 bit)
Executes a exclusive LDR instruction for 32 bit values.
[in] | ptr | Pointer to data |
#define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) |
#define __RBIT __builtin_arm_rbit |
Reverse bit order of value.
Reverses the bit order of the given value.
[in] | value | Value to reverse |
#define __REV | ( | value | ) | __builtin_bswap32(value) |
Reverse byte order (32 bit)
Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
[in] | value | Value to reverse |
Reverse byte order (16 bit)
Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
[in] | value | Value to reverse |
#define __REVSH | ( | value | ) | (int16_t)__builtin_bswap16(value) |
Reverse byte order (16 bit)
Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
[in] | value | Value to reverse |
#define __set_CP | ( | cp, | |
op1, | |||
Rt, | |||
CRn, | |||
CRm, | |||
op2 | |||
) | __ASM volatile("MCR p" # cp ", " # op1 ", %0, c" # CRn ", c" # CRm ", " # op2 : : "r" (Rt) : "memory" ) |
#define __set_CP64 | ( | cp, | |
op1, | |||
Rt, | |||
CRm | |||
) | __ASM volatile("MCRR p" # cp ", " # op1 ", %Q0, %R0, c" # CRm : : "r" (Rt) : "memory" ) |
#define __SSAT __builtin_arm_ssat |
Signed Saturate.
Saturates a signed value.
[in] | value | Value to be saturated |
[in] | sat | Bit position to saturate to (1..32) |
#define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline |
#define __STREXB (uint32_t)__builtin_arm_strex |
STR Exclusive (8 bit)
Executes a exclusive STR instruction for 8 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
#define __STREXH (uint32_t)__builtin_arm_strex |
STR Exclusive (16 bit)
Executes a exclusive STR instruction for 16 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
#define __STREXW (uint32_t)__builtin_arm_strex |
STR Exclusive (32 bit)
Executes a exclusive STR instruction for 32 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
#define __UNALIGNED_UINT16_READ | ( | addr | ) | (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
#define __UNALIGNED_UINT16_WRITE | ( | addr, | |
val | |||
) | (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
#define __UNALIGNED_UINT32_READ | ( | addr | ) | (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
#define __UNALIGNED_UINT32_WRITE | ( | addr, | |
val | |||
) | (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
#define __USAT __builtin_arm_usat |
Unsigned Saturate.
Saturates an unsigned value.
[in] | value | Value to be saturated |
[in] | sat | Bit position to saturate to (0..31) |
#define CMSIS_DEPRECATED __attribute__((deprecated)) |
__STATIC_FORCEINLINE void __disable_fault_irq | ( | void | ) |
Disable FIQ.
Disables FIQ interrupts by setting special-purpose register FAULTMASK. Can only be executed in Privileged modes.
__STATIC_FORCEINLINE void __disable_irq | ( | void | ) |
Disable IRQ Interrupts.
Disables IRQ interrupts by setting the I-bit in the CPSR. Can only be executed in Privileged modes.
__STATIC_FORCEINLINE void __enable_fault_irq | ( | void | ) |
Enable FIQ.
Enables FIQ interrupts by clearing special-purpose register FAULTMASK. Can only be executed in Privileged modes.
__STATIC_FORCEINLINE void __enable_irq | ( | void | ) |
Enable IRQ Interrupts.
Enables IRQ interrupts by clearing the I-bit in the CPSR. Can only be executed in Privileged modes.
__STATIC_FORCEINLINE uint32_t __get_mode | ( | void | ) |
Get Mode.
__STATIC_FORCEINLINE uint32_t __get_SP | ( | void | ) |
Get Stack Pointer.
__STATIC_FORCEINLINE uint32_t __get_SP_usr | ( | void | ) |
Get USR/SYS Stack Pointer.
__STATIC_FORCEINLINE uint8_t __LDRBT | ( | volatile uint8_t * | ptr | ) |
LDRT Unprivileged (8 bit)
Executes a Unprivileged LDRT instruction for 8 bit value.
[in] | ptr | Pointer to data |
__STATIC_FORCEINLINE uint16_t __LDRHT | ( | volatile uint16_t * | ptr | ) |
LDRT Unprivileged (16 bit)
Executes a Unprivileged LDRT instruction for 16 bit values.
[in] | ptr | Pointer to data |
__STATIC_FORCEINLINE uint32_t __LDRT | ( | volatile uint32_t * | ptr | ) |
LDRT Unprivileged (32 bit)
Executes a Unprivileged LDRT instruction for 32 bit values.
[in] | ptr | Pointer to data |
__STATIC_FORCEINLINE uint32_t __RRX | ( | uint32_t | value | ) |
Rotate Right with Extend (32 bit)
Moves each bit of a bitstring right by one bit. The carry input is shifted in at the left end of the bitstring.
[in] | value | Value to rotate |
__STATIC_FORCEINLINE void __set_mode | ( | uint32_t | mode | ) |
Set Mode.
[in] | mode | Mode value to set |
__STATIC_FORCEINLINE void __STRBT | ( | uint8_t | value, |
volatile uint8_t * | ptr | ||
) |
STRT Unprivileged (8 bit)
Executes a Unprivileged STRT instruction for 8 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
__STATIC_FORCEINLINE void __STRHT | ( | uint16_t | value, |
volatile uint16_t * | ptr | ||
) |
STRT Unprivileged (16 bit)
Executes a Unprivileged STRT instruction for 16 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
__STATIC_FORCEINLINE void __STRT | ( | uint32_t | value, |
volatile uint32_t * | ptr | ||
) |
STRT Unprivileged (32 bit)
Executes a Unprivileged STRT instruction for 32 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
__PACKED_STRUCT T_UINT16_READ { uint16_t v |
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v |
__PACKED_STRUCT T_UINT32_READ { uint32_t v |
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v |