Goodix
GR551x API Reference  V1_6_06_B5676
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 external interrupts(Exception Type: 16~255) 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 { \
extern volatile uint32_t g_ble_irq_disable_cnt; \
extern volatile uint32_t g_max_ble_irq_disable_depth; \
extern volatile uint32_t g_ble_irq_enable_status; \
extern volatile uint32_t g_ble_slp_irq_enable_status; \
volatile uint32_t __ble_l_irq_rest = __get_PRIMASK(); \
__set_PRIMASK(1); \
if(g_ble_irq_disable_cnt == 0) \
{ \
g_ble_irq_enable_status = NVIC_GetEnableIRQ(BLE_IRQn); \
g_ble_slp_irq_enable_status = NVIC_GetEnableIRQ(BLESLP_IRQn); \
if (g_ble_irq_enable_status) \
{ \
NVIC_DisableIRQ(BLE_IRQn); \
} \
if (g_ble_slp_irq_enable_status) \
{ \
NVIC_DisableIRQ(BLESLP_IRQn); \
} \
} \
g_ble_irq_disable_cnt++; \
g_max_ble_irq_disable_depth = CO_MAX(g_max_ble_irq_disable_depth, g_ble_irq_disable_cnt); \
__set_PRIMASK(__ble_l_irq_rest);

Disable BLE_IRQn and BLESLP_IRQn.

See also
BLE_INT_DISABLE

Definition at line 131 of file gr55xx_hal.h.

◆ BLE_INT_RESTORE

#define BLE_INT_RESTORE ( )
Value:
__ble_l_irq_rest = __get_PRIMASK(); \
__set_PRIMASK(1); \
g_ble_irq_disable_cnt--; \
if(g_ble_irq_disable_cnt == 0) \
{ \
if (g_ble_irq_enable_status) \
{ \
NVIC_EnableIRQ(BLE_IRQn); \
} \
if (g_ble_slp_irq_enable_status) \
{ \
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 159 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 222 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 126 of file gr55xx_hal.h.

◆ GLOBAL_INT_DISABLE

#define GLOBAL_INT_DISABLE ( )
Value:
do { \
uint32_t __nvic_iser0; \
uint32_t __nvic_iser1; \
__nvic_iser0 = NVIC->ISER[0]; \
__nvic_iser1 = NVIC->ISER[1]; \
NVIC->ICER[0] = 0xFFFFFFFF; \
NVIC->ICER[1] = 0xFFFFFFFF; \
__DSB(); \
__ISB(); \

Disable external interrupts(Exception Type: 16~255) in the system.

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

Definition at line 182 of file gr55xx_hal.h.

◆ GLOBAL_INT_RESTORE

#define GLOBAL_INT_RESTORE ( )
Value:
NVIC->ISER[0] = __nvic_iser0; \
NVIC->ISER[1] = __nvic_iser1; \
} while(0)

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

See also
GLOBAL_INT_RESTORE

Definition at line 196 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 206 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 215 of file gr55xx_hal.h.

◆ SYSTICK_CURRENT_VALUE

#define SYSTICK_CURRENT_VALUE   (SysTick->VAL)

SysTick Current value.

Definition at line 225 of file gr55xx_hal.h.

◆ SYSTICK_RELOAD_VALUE

#define SYSTICK_RELOAD_VALUE   (SysTick->LOAD)

SysTick Reload value.

Definition at line 224 of file gr55xx_hal.h.

CO_MAX
#define CO_MAX(a, b)
compare if a > b
Definition: gr55xx_hal.h:126