nRF5 SDK v15.3.0
Macros | Enumerations | Functions
Utility Functions and Definitions (Platform)

Various types and definitions available to all applications when using SoftDevice. More...

Macros

#define _PRIO_SD_HIGH   0
 
#define _PRIO_APP_HIGH   1
 
#define _PRIO_APP_MID   1
 
#define _PRIO_SD_LOW   2
 
#define _PRIO_APP_LOW   3
 
#define _PRIO_APP_LOWEST   3
 
#define _PRIO_THREAD   4
 
#define NRF_BREAKPOINT   __BKPT(0)
 Macro for setting a breakpoint.
 
#define NRF_BREAKPOINT_COND   NRF_BREAKPOINT
 Macro for setting a breakpoint. More...
 
#define PACKED(TYPE)   __packed TYPE
 
#define PACKED_STRUCT   PACKED(struct)
 
#define PRAGMA_OPTIMIZATION_FORCE_START
 
#define PRAGMA_OPTIMIZATION_FORCE_END   _Pragma ("pop")
 
#define CRITICAL_REGION_ENTER()
 Macro for entering a critical region. More...
 
#define CRITICAL_REGION_EXIT()
 Macro for leaving a critical region. More...
 
#define IPSR_ISR_Msk   (0x1FFUL /*<< IPSR_ISR_Pos*/)
 
#define ANON_UNIONS_ENABLE
 Macro to enable anonymous unions from a certain point in the code. More...
 
#define ANON_UNIONS_DISABLE
 Macro to disable anonymous unions from a certain point in the code. More...
 
#define GCC_PRAGMA(v)
 Macro for adding pragma directive only for GCC.
 
#define CONTROL_nPRIV_Msk   (1UL /*<< CONTROL_nPRIV_Pos*/)
 

Enumerations

enum  app_irq_priority_t {
  APP_IRQ_PRIORITY_HIGHEST = 1,
  APP_IRQ_PRIORITY_HIGH = 1,
  APP_IRQ_PRIORITY_MID = 1,
  APP_IRQ_PRIORITY_LOW = 3,
  APP_IRQ_PRIORITY_LOWEST = 3,
  APP_IRQ_PRIORITY_THREAD = 4
}
 The interrupt priorities available to the application while the SoftDevice is active. More...
 
enum  app_level_t {
  APP_LEVEL_UNPRIVILEGED,
  APP_LEVEL_PRIVILEGED
}
 

Functions

void app_util_critical_region_enter (uint8_t *p_nested)
 
void app_util_critical_region_exit (uint8_t nested)
 
uint8_t current_int_priority_get (void)
 Function for finding the current interrupt level. More...
 
uint8_t privilege_level_get (void)
 Function for finding out the current privilege level. More...
 

Detailed Description

Various types and definitions available to all applications when using SoftDevice.

Macro Definition Documentation

#define ANON_UNIONS_DISABLE
Value:
_Pragma("pop") \
struct semicolon_swallower

Macro to disable anonymous unions from a certain point in the code.

Note
Call only after first calling ANON_UNIONS_ENABLE.
#define ANON_UNIONS_ENABLE
Value:
_Pragma("push") \
_Pragma("anon_unions") \
struct semicolon_swallower

Macro to enable anonymous unions from a certain point in the code.

#define CONTROL_nPRIV_Msk   (1UL /*<< CONTROL_nPRIV_Pos*/)

CONTROL: nPRIV Mask

#define CRITICAL_REGION_ENTER ( )
Value:
{ \
uint8_t __CR_NESTED = 0; \
app_util_critical_region_enter(&__CR_NESTED);

Macro for entering a critical region.

Note
Due to implementation details, there must exist one and only one call to CRITICAL_REGION_EXIT() for each call to CRITICAL_REGION_ENTER(), and they must be located in the same scope.
#define CRITICAL_REGION_EXIT ( )
Value:
app_util_critical_region_exit(__CR_NESTED); \
}

Macro for leaving a critical region.

Note
Due to implementation details, there must exist one and only one call to CRITICAL_REGION_EXIT() for each call to CRITICAL_REGION_ENTER(), and they must be located in the same scope.
#define IPSR_ISR_Msk   (0x1FFUL /*<< IPSR_ISR_Pos*/)

IPSR: ISR Mask

#define NRF_BREAKPOINT_COND   NRF_BREAKPOINT

Macro for setting a breakpoint.

If it is possible to detect debugger presence then it is set only in that case.

#define PRAGMA_OPTIMIZATION_FORCE_START
Value:
_Pragma ("push") \
_Pragma ("O3")

Enumeration Type Documentation

The interrupt priorities available to the application while the SoftDevice is active.

Enumerator
APP_IRQ_PRIORITY_THREAD 

"Interrupt level" when running in Thread Mode.

Function Documentation

uint8_t current_int_priority_get ( void  )

Function for finding the current interrupt level.

Returns
Current interrupt level.
Return values
APP_IRQ_PRIORITY_HIGHWe are running in Application High interrupt level.
APP_IRQ_PRIORITY_LOWWe are running in Application Low interrupt level.
APP_IRQ_PRIORITY_THREADWe are running in Thread Mode.
uint8_t privilege_level_get ( void  )

Function for finding out the current privilege level.

Returns
Current privilege level.
Return values
APP_LEVEL_UNPRIVILEGEDWe are running in unprivileged level.
APP_LEVEL_PRIVILEGEDWe are running in privileged level.

Documentation feedback | Developer Zone | Subscribe | Updated