HAL Exported Constants
+ Collaboration diagram for HAL Exported Constants:

Macros

#define CO_MAX(a, b)   ((a) > (b) ? (a) : (b))
 compare if a > b More...
 
#define BLE_INT_DISABLE()
 Disable BLE_IRQn and BLESLP_IRQn. More...
 
#define BLE_INT_RESTORE()
 Restore BLE_IRQn and BLESLP_IRQn. More...
 
#define GLOBAL_INT_DISABLE()
 Disable interrupts globally in the system. More...
 
#define GLOBAL_INT_RESTORE()
 Restore external interrupts(Exception Type: 16~255) from the previous disable. More...
 
#define LOCAL_INT_DISABLE(IRQn_Type)
 Disable external interrupts with a priority lower than IRQn_Type in the system. More...
 
#define LOCAL_INT_RESTORE()
 Restore external interrupts(apart from the BLE) from the previous disable. More...
 
#define CHECK_IS_ON_FPGA()   (AON->FPGA_CTRL & AON_REG_FPGA_CTRL_EXIST)
 Check if the program is running on the FPGA platform. More...
 
#define SYSTICK_RELOAD_VALUE   (SysTick->LOAD)
 SysTick Reload value. More...
 
#define SYSTICK_CURRENT_VALUE   (SysTick->VAL)
 SysTick Current value. More...
 

Detailed Description

Macro Definition Documentation

◆ BLE_INT_DISABLE

#define BLE_INT_DISABLE ( )
Value:
do { \
volatile uint32_t __ble_l_irq_rest = __get_PRIMASK(); \
volatile bool __ble_int_status = NVIC_GetEnableIRQ(BLE_IRQn) || NVIC_GetEnableIRQ(BLESLP_IRQn); \
__set_PRIMASK(1); \
if (__ble_int_status) \
{ \
NVIC_DisableIRQ(BLE_IRQn); \
NVIC_DisableIRQ(BLESLP_IRQn); \
} \
__set_PRIMASK(__ble_l_irq_rest);

Disable BLE_IRQn and BLESLP_IRQn.

See also
BLE_INT_DISABLE

Definition at line 106 of file gr55xx_hal.h.

◆ BLE_INT_RESTORE

#define BLE_INT_RESTORE ( )
Value:
__ble_l_irq_rest = __get_PRIMASK(); \
__set_PRIMASK(1); \
if (__ble_int_status) \
{ \
NVIC_EnableIRQ(BLE_IRQn); \
NVIC_EnableIRQ(BLESLP_IRQn); \
} \
__set_PRIMASK(__ble_l_irq_rest); \
} while(0)

Restore BLE_IRQn and BLESLP_IRQn.

See also
BLE_INT_RESTORE

Definition at line 121 of file gr55xx_hal.h.

◆ CHECK_IS_ON_FPGA

#define CHECK_IS_ON_FPGA ( )    (AON->FPGA_CTRL & AON_REG_FPGA_CTRL_EXIST)

Check if the program is running on the FPGA platform.

Definition at line 189 of file gr55xx_hal.h.

◆ CO_MAX

#define CO_MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

compare if a > b

See also
CO_MAX

Definition at line 101 of file gr55xx_hal.h.

◆ GLOBAL_INT_DISABLE

#define GLOBAL_INT_DISABLE ( )
Value:
do { \
volatile uint32_t __nvic_iser0 = 0xFFFFFFFF; \
volatile uint32_t __nvic_iser1 = 0xFFFFFFFF; \
volatile uint32_t __ret_pri = __get_PRIMASK(); \
__set_PRIMASK(1); \
if( (NVIC->ICER[0] != 0xFFFFFFFF) || (NVIC->ICER[1] != 0xFFFFFFFF) ) \
{ \
__nvic_iser0 = NVIC->ISER[0]; \
__nvic_iser1 = NVIC->ISER[1]; \
NVIC->ICER[0] = 0xFFFFFFFF; \
NVIC->ICER[1] = 0xFFFFFFFF; \
} \
__set_PRIMASK(__ret_pri); \
__DSB(); \
__ISB(); \

Disable interrupts globally in the system.

This macro must be used in conjunction with the GLOBAL_INT_RESTORE macro since this last one will close the brace that the current macro opens. This means that both macros must be located at the same scope level.

Definition at line 137 of file gr55xx_hal.h.

◆ GLOBAL_INT_RESTORE

#define GLOBAL_INT_RESTORE ( )
Value:
__ret_pri = __get_PRIMASK(); \
__set_PRIMASK(1); \
if( (__nvic_iser0 != 0xFFFFFFFF) || (__nvic_iser1 != 0xFFFFFFFF) ) \
{ \
NVIC->ISER[0] = __nvic_iser0; \
NVIC->ISER[1] = __nvic_iser1; \
} \
__set_PRIMASK(__ret_pri); \
} while(0)

Restore external interrupts(Exception Type: 16~255) from the previous disable.

See also
GLOBAL_INT_RESTORE

Definition at line 157 of file gr55xx_hal.h.

◆ LOCAL_INT_DISABLE

#define LOCAL_INT_DISABLE (   IRQn_Type)
Value:
do { \
uint32_t __l_irq_rest = __get_BASEPRI(); \
__set_BASEPRI(NVIC_GetPriority(IRQn_Type) + \
(1 << (NVIC_GetPriorityGrouping() + 1))); \

Disable external interrupts with a priority lower than IRQn_Type in the system.

This macro must be used in conjunction with the LOCAL_INT_RESTORE macro since this last one will close the brace that the current macro opens. This means that both macros must be located at the same scope level.

Definition at line 173 of file gr55xx_hal.h.

◆ LOCAL_INT_RESTORE

#define LOCAL_INT_RESTORE ( )
Value:
__set_BASEPRI(__l_irq_rest); \
} while(0)

Restore external interrupts(apart from the BLE) from the previous disable.

See also
EXP_BLE_INT_RESTORE

Definition at line 182 of file gr55xx_hal.h.

◆ SYSTICK_CURRENT_VALUE

#define SYSTICK_CURRENT_VALUE   (SysTick->VAL)

SysTick Current value.

Definition at line 192 of file gr55xx_hal.h.

◆ SYSTICK_RELOAD_VALUE

#define SYSTICK_RELOAD_VALUE   (SysTick->LOAD)

SysTick Reload value.

Definition at line 191 of file gr55xx_hal.h.