28 #ifndef CODEBASE_NRF_UTIL_H_ 29 #define CODEBASE_NRF_UTIL_H_ 32 #include "common_util.h" 62 #if __CORTEX_M == (0x00U) 65 APP_IRQ_PRIORITY_HIGHEST = 0,
66 APP_IRQ_PRIORITY_HIGH = 1,
67 APP_IRQ_PRIORITY_MID = 2,
68 APP_IRQ_PRIORITY_LOW = 3,
69 APP_IRQ_PRIORITY_THREAD = 4
71 #elif __CORTEX_M == (0x04U) 74 APP_IRQ_PRIORITY_HIGHEST = 2,
75 APP_IRQ_PRIORITY_HIGH = 3,
76 APP_IRQ_PRIORITY_MID = 5,
77 APP_IRQ_PRIORITY_LOW = 6,
78 APP_IRQ_PRIORITY_LOWEST = 7,
79 APP_IRQ_PRIORITY_THREAD = 15
84 #define LFCLK_FREQ 32768 87 #define LFCLK_TICKS_MS(ms) ((uint32_t) ROUNDED_DIV( (LFCLK_FREQ*(uint64_t)ms) , 1000) ) 89 #define LFCLK_TICKS_625(ms) ((uint32_t) ROUNDED_DIV( (LFCLK_FREQ*(uint64_t)ms) , 1600) ) 91 #define LFCLK_TICKS_977(ms) ((uint32_t) (32*ms) ) 93 #define LFCLK_TICKS_1250(ms) ((uint32_t) ROUNDED_DIV( (LFCLK_FREQ*(uint64_t)ms) , 800) ) 96 void nrf_util_critical_region_exit(uint8_t critical_entered);
103 #define CRITICAL_REGION_ENTER() \ 105 uint8_t __CR_ENTERED = 0; \ 106 nrf_util_critical_region_enter(&__CR_ENTERED); 113 #define CRITICAL_REGION_EXIT() \ 114 nrf_util_critical_region_exit(__CR_ENTERED); \ app_irq_priority_t
Priority levels that the application can use based on whether the SoftDevice (SD) is used.
void nrf_util_critical_region_enter(uint8_t *is_critical_entered)