Go to the documentation of this file.
53 #ifndef __GR55xx_HAL_H__
54 #define __GR55xx_HAL_H__
101 #define CO_MAX(a,b) ((a) > (b) ? (a) : (b))
106 #define BLE_INT_DISABLE() \
108 volatile uint32_t __ble_l_irq_rest = __get_PRIMASK(); \
109 volatile bool __ble_int_status = NVIC_GetEnableIRQ(BLE_IRQn) || NVIC_GetEnableIRQ(BLESLP_IRQn); \
111 if (__ble_int_status) \
113 NVIC_DisableIRQ(BLE_IRQn); \
114 NVIC_DisableIRQ(BLESLP_IRQn); \
116 __set_PRIMASK(__ble_l_irq_rest);
121 #define BLE_INT_RESTORE() \
122 __ble_l_irq_rest = __get_PRIMASK(); \
124 if (__ble_int_status) \
126 NVIC_EnableIRQ(BLE_IRQn); \
127 NVIC_EnableIRQ(BLESLP_IRQn); \
129 __set_PRIMASK(__ble_l_irq_rest); \
137 #define GLOBAL_INT_DISABLE() \
139 volatile uint32_t __nvic_iser0 = 0xFFFFFFFF; \
140 volatile uint32_t __nvic_iser1 = 0xFFFFFFFF; \
141 volatile uint32_t __ret_pri = __get_PRIMASK(); \
143 if( (NVIC->ICER[0] != 0xFFFFFFFF) || (NVIC->ICER[1] != 0xFFFFFFFF) ) \
145 __nvic_iser0 = NVIC->ISER[0]; \
146 __nvic_iser1 = NVIC->ISER[1]; \
147 NVIC->ICER[0] = 0xFFFFFFFF; \
148 NVIC->ICER[1] = 0xFFFFFFFF; \
150 __set_PRIMASK(__ret_pri); \
157 #define GLOBAL_INT_RESTORE() \
158 __ret_pri = __get_PRIMASK(); \
160 if( (__nvic_iser0 != 0xFFFFFFFF) || (__nvic_iser1 != 0xFFFFFFFF) ) \
162 NVIC->ISER[0] = __nvic_iser0; \
163 NVIC->ISER[1] = __nvic_iser1; \
165 __set_PRIMASK(__ret_pri); \
173 #define LOCAL_INT_DISABLE(IRQn_Type) \
175 uint32_t __l_irq_rest = __get_BASEPRI(); \
176 __set_BASEPRI(NVIC_GetPriority(IRQn_Type) + \
177 (1 << (NVIC_GetPriorityGrouping() + 1))); \
182 #define LOCAL_INT_RESTORE() \
183 __set_BASEPRI(__l_irq_rest); \
189 #define CHECK_IS_ON_FPGA() (AON->FPGA_CTRL & AON_REG_FPGA_CTRL_EXIST)
191 #define SYSTICK_RELOAD_VALUE (SysTick->LOAD)
192 #define SYSTICK_CURRENT_VALUE (SysTick->VAL)
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 hal_msp_init(void)
Initialize the MSP.
void hal_msp_deinit(void)
De-initialize the MSP.