|
MG32F10x Standard Peripherals Firmware Library
|
宏定义 | |
| #define | __NOP __nop |
| No Operation 更多... | |
| #define | __WFI __wfi |
| Wait For Interrupt 更多... | |
| #define | __WFE __wfe |
| Wait For Event 更多... | |
| #define | __SEV __sev |
| Send Event 更多... | |
| #define | __ISB() |
| Instruction Synchronization Barrier 更多... | |
| #define | __DSB() |
| Data Synchronization Barrier 更多... | |
| #define | __DMB() |
| Data Memory Barrier 更多... | |
| #define | __REV __rev |
| Reverse byte order (32 bit) 更多... | |
| #define | __ROR __ror |
| Rotate Right in unsigned value (32 bit) 更多... | |
| #define | __BKPT(value) __breakpoint(value) |
| Breakpoint 更多... | |
| #define | __CLZ __clz |
| Count leading zeros 更多... | |
| #define | __CMSIS_GCC_OUT_REG(r) "=r" (r) |
| #define | __CMSIS_GCC_USE_REG(r) "r" (r) |
| #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 | __CLZ (uint8_t)__builtin_clz |
| Count leading zeros 更多... | |
| #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 | __CLZ (uint8_t)__builtin_clz |
| Count leading zeros 更多... | |
函数 | |
| __attribute__ ((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) | |
| Reverse byte order (16 bit) 更多... | |
| __attribute__ ((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) | |
| Reverse byte order (16 bit) 更多... | |
| __attribute__ ((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) | |
| Reverse bit order of value 更多... | |
| __STATIC_FORCEINLINE uint32_t | __ROR (uint32_t op1, uint32_t op2) |
| Rotate Right in unsigned value (32 bit) 更多... | |
| __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 更多... | |
| __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 | __RBIT (uint32_t value) |
| Reverse bit order of value 更多... | |
变量 | |
| uint32_t | sat |
Access to dedicated instructions
| #define __BKPT | ( | value | ) | __breakpoint(value) |
Breakpoint
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.
| [in] | value | is ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint. |
| #define __BKPT | ( | value | ) | __ASM volatile ("bkpt "#value) |
Breakpoint
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.
| [in] | value | is ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint. |
| #define __BKPT | ( | value | ) | __ASM volatile ("bkpt "#value) |
Breakpoint
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.
| [in] | value | is ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint. |
| #define __CLZ __clz |
Count leading zeros
Counts the number of leading zeros of a data value.
| [in] | value | Value to count the leading zeros |
| #define __CLZ (uint8_t)__builtin_clz |
Count leading zeros
Counts the number of leading zeros of a data value.
| [in] | value | Value to count the leading zeros |
| #define __CLZ (uint8_t)__builtin_clz |
Count leading zeros
Counts the number of leading zeros of a data value.
| [in] | value | Value to count the leading zeros |
| #define __DMB | ( | void | ) |
Data Memory Barrier
Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.
| #define __DMB | ( | void | ) | __builtin_arm_dmb(0xF); |
Data Memory Barrier
Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.
| #define __DSB | ( | void | ) |
Data Synchronization Barrier
Acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.
| #define __DSB | ( | void | ) | __builtin_arm_dsb(0xF); |
Data Synchronization Barrier
Acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.
| #define __ISB | ( | void | ) |
Instruction Synchronization Barrier
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.
| #define __ISB | ( | void | ) | __builtin_arm_isb(0xF); |
Instruction Synchronization Barrier
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.
| #define __NOP __nop |
No Operation
No Operation does nothing. This instruction can be used for code alignment purposes.
| #define __NOP __builtin_arm_nop |
No Operation
No Operation does nothing. This instruction can be used for code alignment purposes.
| #define __NOP | ( | ) | __ASM volatile ("nop") |
No Operation
No Operation does nothing. This instruction can be used for code alignment purposes.
| #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 __rev |
Reverse byte order (32 bit)
Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
| [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 __ROR __ror |
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.
| [in] | op1 | Value to rotate |
| [in] | op2 | Number of Bits to rotate |
| #define __SEV __sev |
Send Event
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
| #define __SEV __builtin_arm_sev |
Send Event
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
| #define __SEV | ( | ) | __ASM volatile ("sev") |
Send Event
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
| #define __WFE __wfe |
Wait For Event
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.
| #define __WFE __builtin_arm_wfe |
Wait For Event
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.
| #define __WFE | ( | ) | __ASM volatile ("wfe") |
Wait For Event
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.
| #define __WFI __wfi |
Wait For Interrupt
Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
| #define __WFI __builtin_arm_wfi |
Wait For Interrupt
Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
| #define __WFI | ( | ) | __ASM volatile ("wfi") |
Wait For Interrupt
Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
| __attribute__ | ( | (section(".rev16_text")) | ) |
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 |
| __attribute__ | ( | (section(".revsh_text")) | ) |
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 |
| __attribute__ | ( | (always_inline) | ) |
Reverse bit order of value
Unsigned Saturate
Signed Saturate
Reverses the bit order of the given value.
| [in] | value | Value to reverse |
Saturates a signed value.
| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to (1..32) |
Saturates an unsigned value.
| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to (0..31) |
| __STATIC_FORCEINLINE void __DMB | ( | void | ) |
Data Memory Barrier
Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.
| __STATIC_FORCEINLINE void __DSB | ( | void | ) |
Data Synchronization Barrier
Acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.
| __STATIC_FORCEINLINE void __ISB | ( | void | ) |
Instruction Synchronization Barrier
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.
| __STATIC_FORCEINLINE uint32_t __RBIT | ( | uint32_t | value | ) |
Reverse bit order of value
Reverses the bit order of the given value.
| [in] | value | Value to reverse |
| __STATIC_FORCEINLINE uint32_t __REV | ( | uint32_t | value | ) |
Reverse byte order (32 bit)
Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
| [in] | value | Value to reverse |
| __STATIC_FORCEINLINE uint32_t __REV16 | ( | uint32_t | value | ) |
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 |
| __STATIC_FORCEINLINE int16_t __REVSH | ( | int16_t | 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 |
| __STATIC_FORCEINLINE uint32_t __ROR | ( | uint32_t | op1, |
| uint32_t | op2 | ||
| ) |
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.
| [in] | op1 | Value to rotate |
| [in] | op2 | Number of Bits to rotate |
| __STATIC_FORCEINLINE int32_t __SSAT | ( | int32_t | val, |
| uint32_t | sat | ||
| ) |
Signed Saturate
Saturates a signed value.
| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to (1..32) |
| __STATIC_FORCEINLINE uint32_t __USAT | ( | int32_t | val, |
| uint32_t | sat | ||
| ) |
Unsigned Saturate
Saturates an unsigned value.
| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to (0..31) |
| uint32_t sat |