GR551x API Reference
V1_6_06_B5676
Go to the documentation of this file.
53 #ifndef __GR55xx_HAL_H__
54 #define __GR55xx_HAL_H__
126 #define CO_MAX(a,b) ((a) > (b) ? (a) : (b))
131 #define BLE_INT_DISABLE() \
133 extern volatile uint32_t g_ble_irq_disable_cnt; \
134 extern volatile uint32_t g_max_ble_irq_disable_depth; \
135 extern volatile uint32_t g_ble_irq_enable_status; \
136 extern volatile uint32_t g_ble_slp_irq_enable_status; \
137 volatile uint32_t __ble_l_irq_rest = __get_PRIMASK(); \
139 if(g_ble_irq_disable_cnt == 0) \
141 g_ble_irq_enable_status = NVIC_GetEnableIRQ(BLE_IRQn); \
142 g_ble_slp_irq_enable_status = NVIC_GetEnableIRQ(BLESLP_IRQn); \
143 if (g_ble_irq_enable_status) \
145 NVIC_DisableIRQ(BLE_IRQn); \
147 if (g_ble_slp_irq_enable_status) \
149 NVIC_DisableIRQ(BLESLP_IRQn); \
152 g_ble_irq_disable_cnt++; \
153 g_max_ble_irq_disable_depth = CO_MAX(g_max_ble_irq_disable_depth, g_ble_irq_disable_cnt); \
154 __set_PRIMASK(__ble_l_irq_rest);
159 #define BLE_INT_RESTORE() \
160 __ble_l_irq_rest = __get_PRIMASK(); \
162 g_ble_irq_disable_cnt--; \
163 if(g_ble_irq_disable_cnt == 0) \
165 if (g_ble_irq_enable_status) \
167 NVIC_EnableIRQ(BLE_IRQn); \
169 if (g_ble_slp_irq_enable_status) \
171 NVIC_EnableIRQ(BLESLP_IRQn); \
174 __set_PRIMASK(__ble_l_irq_rest); \
182 #define GLOBAL_INT_DISABLE() \
184 uint32_t __nvic_iser0; \
185 uint32_t __nvic_iser1; \
186 __nvic_iser0 = NVIC->ISER[0]; \
187 __nvic_iser1 = NVIC->ISER[1]; \
188 NVIC->ICER[0] = 0xFFFFFFFF; \
189 NVIC->ICER[1] = 0xFFFFFFFF; \
196 #define GLOBAL_INT_RESTORE() \
197 NVIC->ISER[0] = __nvic_iser0; \
198 NVIC->ISER[1] = __nvic_iser1; \
206 #define LOCAL_INT_DISABLE(IRQn_Type) \
208 uint32_t __l_irq_rest = __get_BASEPRI(); \
209 __set_BASEPRI(NVIC_GetPriority(IRQn_Type) + \
210 (1 << (NVIC_GetPriorityGrouping() + 1))); \
215 #define LOCAL_INT_RESTORE() \
216 __set_BASEPRI(__l_irq_rest); \
222 #define CHECK_IS_ON_FPGA() (AON->FPGA_CTRL & AON_REG_FPGA_CTRL_EXIST)
224 #define SYSTICK_RELOAD_VALUE (SysTick->LOAD)
225 #define SYSTICK_CURRENT_VALUE (SysTick->VAL)
void(* msp_deinit)(void)
HAL de-init MSP callback
PERIPHERAL API DELAY DRIVER.
hal_status_t hal_init(void)
This function configures time base source, NVIC and Low level hardware.
uint32_t hal_get_hal_version(void)
This function returns the HAL revision.
struct _hal_callback hal_callback_t
HAL_HAL Callback function definition.
void hal_suspend_tick(void)
Suspend Tick increment.
hal_status_t hal_deinit(void)
This function de-initializes common part of the HAL and stops the source of time base.
void hal_resume_tick(void)
Resume Tick increment.
hal_status_t
HAL Status structures definition.
HAL_HAL Callback function definition.
hal_status_t hal_init_tick(uint32_t tick_priority)
This function configures the source of the time base.
void(* msp_init)(void)
HAL init MSP callback
void hal_msp_init(void)
Initialize the MSP.
void hal_msp_deinit(void)
De-initialize the MSP.