cmsis_armclang_ltm.h File Reference

CMSIS compiler armclang (Arm Compiler 6) header file. More...

#include <arm_compat.h>

Go to the source code of this file.

Data Structures

struct  T_UINT32
 
struct  T_UINT16_WRITE
 
struct  T_UINT16_READ
 
struct  T_UINT32_WRITE
 
struct  T_UINT32_READ
 

Macros

#define __ASM   __asm
 
#define __INLINE   __inline
 
#define __STATIC_INLINE   static __inline
 
#define __STATIC_FORCEINLINE   __attribute__((always_inline)) static __inline
 
#define __NO_RETURN   __attribute__((__noreturn__))
 
#define __USED   __attribute__((used))
 
#define __WEAK   __attribute__((weak))
 
#define __PACKED   __attribute__((packed, aligned(1)))
 
#define __PACKED_STRUCT   struct __attribute__((packed, aligned(1)))
 
#define __PACKED_UNION   union __attribute__((packed, aligned(1)))
 
#define __UNALIGNED_UINT32(x)   (((struct T_UINT32 *)(x))->v)
 
#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)))
 
#define __RESTRICT   __restrict
 
#define __COMPILER_BARRIER()   __ASM volatile("":::"memory")
 
#define __PROGRAM_START   __main
 
#define __INITIAL_SP   Image$$ARM_LIB_STACK$$ZI$$Limit
 
#define __STACK_LIMIT   Image$$ARM_LIB_STACK$$ZI$$Base
 
#define __VECTOR_TABLE   __Vectors
 
#define __VECTOR_TABLE_ATTRIBUTE   __attribute__((used, section("RESET")))
 
#define __get_FPSCR()   ((uint32_t)0U)
 Get FPSCR. More...
 
#define __set_FPSCR(x)   ((void)(x))
 Set FPSCR. More...
 
#define __CMSIS_GCC_OUT_REG(r)   "=r" (r)
 
#define __CMSIS_GCC_USE_REG(r)   "r" (r)
 
#define __NOP   __builtin_arm_nop
 No Operation. More...
 
#define __WFI   __builtin_arm_wfi
 Wait For Interrupt. More...
 
#define __WFE   __builtin_arm_wfe
 Wait For Event. More...
 
#define __SEV   __builtin_arm_sev
 Send Event. More...
 
#define __ISB()   __builtin_arm_isb(0xF)
 Instruction Synchronization Barrier. More...
 
#define __DSB()   __builtin_arm_dsb(0xF)
 Data Synchronization Barrier. More...
 
#define __DMB()   __builtin_arm_dmb(0xF)
 Data Memory Barrier. More...
 
#define __REV(value)   __builtin_bswap32(value)
 Reverse byte order (32 bit) More...
 
#define __REV16(value)   __ROR(__REV(value), 16)
 Reverse byte order (16 bit) More...
 
#define __REVSH(value)   (int16_t)__builtin_bswap16(value)
 Reverse byte order (16 bit) More...
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint. More...
 
#define __RBIT   __builtin_arm_rbit
 Reverse bit order of value. More...
 

Functions

static __inline uint32_t __get_CONTROL (void)
 Enable IRQ Interrupts. More...
 
static __inline void __set_CONTROL (uint32_t control)
 Set Control Register. More...
 
static __inline uint32_t __get_IPSR (void)
 Get IPSR Register. More...
 
static __inline uint32_t __get_APSR (void)
 Get APSR Register. More...
 
static __inline uint32_t __get_xPSR (void)
 Get xPSR Register. More...
 
static __inline uint32_t __get_PSP (void)
 Get Process Stack Pointer. More...
 
static __inline void __set_PSP (uint32_t topOfProcStack)
 Set Process Stack Pointer. More...
 
static __inline uint32_t __get_MSP (void)
 Get Main Stack Pointer. More...
 
static __inline void __set_MSP (uint32_t topOfMainStack)
 Set Main Stack Pointer. More...
 
static __inline uint32_t __get_PRIMASK (void)
 Get Priority Mask. More...
 
static __inline void __set_PRIMASK (uint32_t priMask)
 Set Priority Mask. More...
 
static __inline uint32_t __ROR (uint32_t op1, uint32_t op2)
 Rotate Right in unsigned value (32 bit) More...
 
static __inline uint8_t __CLZ (uint32_t value)
 Count leading zeros. More...
 
static __inline int32_t __SSAT (int32_t val, uint32_t sat)
 Signed Saturate. More...
 
static __inline uint32_t __USAT (int32_t val, uint32_t sat)
 Unsigned Saturate. More...
 

Detailed Description

CMSIS compiler armclang (Arm Compiler 6) header file.

Version
V1.3.0
Date
26. March 2020

Function Documentation

◆ __CLZ()

static __inline uint8_t __CLZ ( uint32_t  value)
static

Count leading zeros.

Counts the number of leading zeros of a data value.

Parameters
[in]valueValue to count the leading zeros
Returns
number of leading zeros in value

◆ __get_APSR()

static __inline uint32_t __get_APSR ( void  )
static

Get APSR Register.

Returns the content of the APSR Register.

Returns
APSR Register value

◆ __get_CONTROL()

static __inline uint32_t __get_CONTROL ( void  )
static

Enable IRQ Interrupts.

Enables IRQ interrupts by clearing the I-bit in the CPSR. Can only be executed in Privileged modes.

Disable IRQ Interrupts

Disables IRQ interrupts by setting the I-bit in the CPSR. Can only be executed in Privileged modes.

Get Control Register

Returns the content of the Control Register.

Returns
Control Register value

◆ __get_IPSR()

static __inline uint32_t __get_IPSR ( void  )
static

Get IPSR Register.

Returns the content of the IPSR Register.

Returns
IPSR Register value

◆ __get_MSP()

static __inline uint32_t __get_MSP ( void  )
static

Get Main Stack Pointer.

Returns the current value of the Main Stack Pointer (MSP).

Returns
MSP Register value

◆ __get_PRIMASK()

static __inline uint32_t __get_PRIMASK ( void  )
static

Get Priority Mask.

Returns the current state of the priority mask bit from the Priority Mask Register.

Returns
Priority Mask value

◆ __get_PSP()

static __inline uint32_t __get_PSP ( void  )
static

Get Process Stack Pointer.

Returns the current value of the Process Stack Pointer (PSP).

Returns
PSP Register value

◆ __get_xPSR()

static __inline uint32_t __get_xPSR ( void  )
static

Get xPSR Register.

Returns the content of the xPSR Register.

Returns
xPSR Register value

◆ __ROR()

static __inline uint32_t __ROR ( uint32_t  op1,
uint32_t  op2 
)
static

Rotate Right in unsigned value (32 bit)

Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.

Parameters
[in]op1Value to rotate
[in]op2Number of Bits to rotate
Returns
Rotated value

◆ __set_CONTROL()

static __inline void __set_CONTROL ( uint32_t  control)
static

Set Control Register.

Writes the given value to the Control Register.

Parameters
[in]controlControl Register value to set

◆ __set_MSP()

static __inline void __set_MSP ( uint32_t  topOfMainStack)
static

Set Main Stack Pointer.

Assigns the given value to the Main Stack Pointer (MSP).

Parameters
[in]topOfMainStackMain Stack Pointer value to set

◆ __set_PRIMASK()

static __inline void __set_PRIMASK ( uint32_t  priMask)
static

Set Priority Mask.

Assigns the given value to the Priority Mask Register.

Parameters
[in]priMaskPriority Mask

◆ __set_PSP()

static __inline void __set_PSP ( uint32_t  topOfProcStack)
static

Set Process Stack Pointer.

Assigns the given value to the Process Stack Pointer (PSP).

Parameters
[in]topOfProcStackProcess Stack Pointer value to set

◆ __SSAT()

static __inline int32_t __SSAT ( int32_t  val,
uint32_t  sat 
)
static

Signed Saturate.

Saturates a signed value.

Parameters
[in]valueValue to be saturated
[in]satBit position to saturate to (1..32)
Returns
Saturated value

◆ __USAT()

static __inline uint32_t __USAT ( int32_t  val,
uint32_t  sat 
)
static

Unsigned Saturate.

Saturates an unsigned value.

Parameters
[in]valueValue to be saturated
[in]satBit position to saturate to (0..31)
Returns
Saturated value