mikroSDK Reference Manual

Topics

 CMSIS SIMD Intrinsics
 

Macros

#define __CMSIS_GCC_OUT_REG(r)   "=r" (r)
 
#define __CMSIS_GCC_RW_REG(r)   "+r" (r)
 
#define __CMSIS_GCC_USE_REG(r)   "r" (r)
 
#define __NOP()   __ASM volatile ("nop")
 No Operation.
 
#define __WFI()   __ASM volatile ("wfi")
 Wait For Interrupt.
 
#define __WFE()   __ASM volatile ("wfe")
 Wait For Event.
 
#define __SEV()   __ASM volatile ("sev")
 Send Event.
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint.
 
#define __CMSIS_GCC_OUT_REG(r)   "=r" (r)
 
#define __CMSIS_GCC_RW_REG(r)   "+r" (r)
 
#define __CMSIS_GCC_USE_REG(r)   "r" (r)
 
#define __NOP()   __ASM volatile ("nop")
 No Operation.
 
#define __WFI()   __ASM volatile ("wfi")
 Wait For Interrupt.
 
#define __WFE()   __ASM volatile ("wfe")
 Wait For Event.
 
#define __SEV()   __ASM volatile ("sev")
 Send Event.
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint.
 
#define __CMSIS_GCC_OUT_REG(r)   "=r" (r)
 
#define __CMSIS_GCC_RW_REG(r)   "+r" (r)
 
#define __CMSIS_GCC_USE_REG(r)   "r" (r)
 
#define __NOP()   __ASM volatile ("nop")
 No Operation.
 
#define __WFI()   __ASM volatile ("wfi")
 Wait For Interrupt.
 
#define __WFE()   __ASM volatile ("wfe")
 Wait For Event.
 
#define __SEV()   __ASM volatile ("sev")
 Send Event.
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint.
 

Functions list

__STATIC_FORCEINLINE void __ISB (void)
 Instruction Synchronization Barrier.
 
__STATIC_FORCEINLINE void __DSB (void)
 Data Synchronization Barrier.
 
__STATIC_FORCEINLINE void __DMB (void)
 Data Memory Barrier.
 
__STATIC_FORCEINLINE uint32_t __REV (uint32_t value)
 Reverse byte order (32 bit)
 
__STATIC_FORCEINLINE uint32_t __REV16 (uint32_t value)
 Reverse byte order (16 bit)
 
__STATIC_FORCEINLINE int16_t __REVSH (int16_t value)
 Reverse byte order (16 bit)
 
__STATIC_FORCEINLINE uint32_t __ROR (uint32_t op1, uint32_t op2)
 Rotate Right in unsigned value (32 bit)
 
__STATIC_FORCEINLINE uint32_t __RBIT (uint32_t value)
 Reverse bit order of value.
 
__STATIC_FORCEINLINE uint8_t __CLZ (uint32_t value)
 Count leading zeros.
 
__STATIC_FORCEINLINE int32_t __SSAT (int32_t val, uint32_t sat)
 Signed Saturate.
 
__STATIC_FORCEINLINE uint32_t __USAT (int32_t val, uint32_t sat)
 Unsigned Saturate.
 

Macro Definition Documentation

◆ __BKPT [1/3]

#define __BKPT ( value)    __ASM volatile ("bkpt "#value)

Causes the processor to enter Debug state. Debug tools can use this to investigate system state when the instruction at a particular address is reached.

Parameters
[in]valueis ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint.

◆ __BKPT [2/3]

#define __BKPT ( value)    __ASM volatile ("bkpt "#value)

Causes the processor to enter Debug state. Debug tools can use this to investigate system state when the instruction at a particular address is reached.

Parameters
[in]valueis ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint.

◆ __BKPT [3/3]

#define __BKPT ( value)    __ASM volatile ("bkpt "#value)

Causes the processor to enter Debug state. Debug tools can use this to investigate system state when the instruction at a particular address is reached.

Parameters
[in]valueis ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint.

◆ __NOP [1/3]

#define __NOP ( )    __ASM volatile ("nop")

No Operation does nothing. This instruction can be used for code alignment purposes.

◆ __NOP [2/3]

#define __NOP ( )    __ASM volatile ("nop")

No Operation does nothing. This instruction can be used for code alignment purposes.

◆ __NOP [3/3]

#define __NOP ( )    __ASM volatile ("nop")

No Operation does nothing. This instruction can be used for code alignment purposes.

◆ __SEV [1/3]

#define __SEV ( )    __ASM volatile ("sev")

Send Event is a hint instruction. It causes an event to be signaled to the CPU.

◆ __SEV [2/3]

#define __SEV ( )    __ASM volatile ("sev")

Send Event is a hint instruction. It causes an event to be signaled to the CPU.

◆ __SEV [3/3]

#define __SEV ( )    __ASM volatile ("sev")

Send Event is a hint instruction. It causes an event to be signaled to the CPU.

◆ __WFE [1/3]

#define __WFE ( )    __ASM volatile ("wfe")

Wait For Event is a hint instruction that permits the processor to enter a low-power state until one of a number of events occurs.

◆ __WFE [2/3]

#define __WFE ( )    __ASM volatile ("wfe")

Wait For Event is a hint instruction that permits the processor to enter a low-power state until one of a number of events occurs.

◆ __WFE [3/3]

#define __WFE ( )    __ASM volatile ("wfe")

Wait For Event is a hint instruction that permits the processor to enter a low-power state until one of a number of events occurs.

◆ __WFI [1/3]

#define __WFI ( )    __ASM volatile ("wfi")

Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.

◆ __WFI [2/3]

#define __WFI ( )    __ASM volatile ("wfi")

Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.

◆ __WFI [3/3]

#define __WFI ( )    __ASM volatile ("wfi")

Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.

Function Documentation

◆ __CLZ()

__STATIC_FORCEINLINE uint8_t __CLZ ( uint32_t value)

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

◆ __DMB()

__STATIC_FORCEINLINE void __DMB ( void )

Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.

◆ __DSB()

__STATIC_FORCEINLINE void __DSB ( void )

Acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.

◆ __ISB()

__STATIC_FORCEINLINE void __ISB ( void )

Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed.

◆ __RBIT()

__STATIC_FORCEINLINE uint32_t __RBIT ( uint32_t value)

Reverses the bit order of the given value.

Parameters
[in]valueValue to reverse
Returns
Reversed value

◆ __REV()

__STATIC_FORCEINLINE uint32_t __REV ( uint32_t value)

Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.

Parameters
[in]valueValue to reverse
Returns
Reversed value

◆ __REV16()

__STATIC_FORCEINLINE uint32_t __REV16 ( uint32_t value)

Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.

Parameters
[in]valueValue to reverse
Returns
Reversed value

◆ __REVSH()

__STATIC_FORCEINLINE int16_t __REVSH ( int16_t value)

Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.

Parameters
[in]valueValue to reverse
Returns
Reversed value

◆ __ROR()

__STATIC_FORCEINLINE uint32_t __ROR ( uint32_t op1,
uint32_t op2 )

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

◆ __SSAT()

__STATIC_FORCEINLINE int32_t __SSAT ( int32_t val,
uint32_t sat )

Saturates a signed value.

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

◆ __USAT()

__STATIC_FORCEINLINE uint32_t __USAT ( int32_t val,
uint32_t sat )

Saturates an unsigned value.

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