gr_common.h File Reference
#include "cmsis_compiler.h"
#include "gr5x.h"

Go to the source code of this file.

Macros

#define gr_assert_param(expr)   ((void)0U)
 
#define GLOBAL_EXCEPTION_DISABLE()
 Disable interrupts globally in the system(apart from the NMI). This macro must be used in conjunction with the GLOBAL_EXCEPTION_ENABLE 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. More...
 
#define GLOBAL_EXCEPTION_ENABLE()
 Restore interrupts from the previous global disable(apart from the NMI). More...
 
#define GLOBAL_INT_DISABLE()
 Disable interrupts globally in the system. This macro must be used in conjunction with the GLOBAL_INT_RESTORE macro. More...
 
#define GLOBAL_INT_RESTORE()
 Restore global interrupt. More...
 
#define LOCAL_INT_DISABLE(IRQn_Type)
 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. More...
 
#define LOCAL_INT_RESTORE()
 Restore external interrupts(apart from the BLE) from the previous disable. More...
 

Enumerations

enum  hal_status_t {
  HAL_OK = 0x00U,
  HAL_ERROR = 0x01U,
  HAL_BUSY = 0x02U,
  HAL_TIMEOUT = 0x03
}
 HAL Status structures definition. More...
 

Macro Definition Documentation

◆ GLOBAL_EXCEPTION_DISABLE

#define GLOBAL_EXCEPTION_DISABLE ( )
Value:
do { \
uint32_t __l_irq_rest = __get_PRIMASK(); \
__set_PRIMASK(1)

Disable interrupts globally in the system(apart from the NMI). This macro must be used in conjunction with the GLOBAL_EXCEPTION_ENABLE 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 74 of file gr_common.h.

◆ GLOBAL_EXCEPTION_ENABLE

#define GLOBAL_EXCEPTION_ENABLE ( )
Value:
if(__l_irq_rest == (uint32_t)0) \
{ \
__set_PRIMASK(0); \
} \
else \
{ \
__set_PRIMASK(1); \
} \
} while(0)

Restore interrupts from the previous global disable(apart from the NMI).

See also
GLOBAL_EXCEPTION_ENABLE

Definition at line 85 of file gr_common.h.

◆ GLOBAL_INT_DISABLE

#define GLOBAL_INT_DISABLE ( )
Value:
do { \
extern uint32_t global_int_disable(void); \
uint32_t __res_mask = global_int_disable()

Disable interrupts globally in the system. This macro must be used in conjunction with the GLOBAL_INT_RESTORE macro.

Definition at line 101 of file gr_common.h.

◆ GLOBAL_INT_RESTORE

#define GLOBAL_INT_RESTORE ( )
Value:
extern void global_int_enable(uint32_t mask); \
global_int_enable(__res_mask); \
} while(0)

Restore global interrupt.

See also
GLOBAL_INT_RESTORE

Definition at line 111 of file gr_common.h.

◆ gr_assert_param

#define gr_assert_param (   expr)    ((void)0U)

Definition at line 63 of file gr_common.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 122 of file gr_common.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 131 of file gr_common.h.

Enumeration Type Documentation

◆ hal_status_t

HAL Status structures definition.

Enumerator
HAL_OK 

Operation is OK.

HAL_ERROR 

Parameter error or operation is not supported.

HAL_BUSY 

Driver is busy.

HAL_TIMEOUT 

Timeout occurred.

Definition at line 139 of file gr_common.h.