Modules | |
Peripheral drivers common module configuration | |
Macros | |
#define | NRF_DRV_COMMON_EVREGS_OFFSET 0x100U |
Offset of event registers in every peripheral instance. More... | |
#define | NRF_DRV_COMMON_POWER_CLOCK_ISR (NRF_MODULE_ENABLED(CLOCK) && NRF_MODULE_ENABLED(POWER)) |
The flag that is set when POWER_CLOCK ISR is implemented in common module. More... | |
Typedefs | |
typedef void(* | nrf_drv_irq_handler_t )(void) |
IRQ handler type. | |
Enumerations | |
enum | nrf_drv_state_t { NRF_DRV_STATE_UNINITIALIZED, NRF_DRV_STATE_INITIALIZED, NRF_DRV_STATE_POWERED_ON } |
Driver state. More... | |
enum | nrf_drv_pwr_ctrl_t { NRF_DRV_PWR_CTRL_ON, NRF_DRV_PWR_CTRL_OFF } |
Driver power state selection. More... | |
Functions | |
void | nrf_drv_common_irq_enable (IRQn_Type IRQn, uint8_t priority) |
Function sets priority and enables NVIC interrupt. More... | |
__STATIC_INLINE bool | nrf_drv_common_irq_enable_check (IRQn_Type IRQn) |
Check if interrupt is enabled. More... | |
__STATIC_INLINE void | nrf_drv_common_irq_disable (IRQn_Type IRQn) |
Function disables NVIC interrupt. More... | |
__STATIC_INLINE uint32_t | nrf_drv_bitpos_to_event (uint32_t bit) |
Convert bit position to event code. More... | |
__STATIC_INLINE uint32_t | nrf_drv_event_to_bitpos (uint32_t event) |
Convert event code to bit position. More... | |
__STATIC_INLINE IRQn_Type | nrf_drv_get_IRQn (void const *const pinst) |
Get interrupt number connected with given instance. More... | |
__STATIC_INLINE bool | nrf_drv_is_in_RAM (void const *const ptr) |
Check if given object is in RAM. More... | |
#define NRF_DRV_COMMON_EVREGS_OFFSET 0x100U |
Offset of event registers in every peripheral instance.
This is the offset where event registers start in every peripheral.
#define NRF_DRV_COMMON_POWER_CLOCK_ISR (NRF_MODULE_ENABLED(CLOCK) && NRF_MODULE_ENABLED(POWER)) |
The flag that is set when POWER_CLOCK ISR is implemented in common module.
This flag means that the function POWER_CLOCK_IRQHandler is implemented in nrf_drv_common.c file. In the clock
and power
modules functions nrf_drv_clock_onIRQ nrf_drv_power_onIRQ should be implemented and they would be called from common implementation.
None of the checking is done here. The implementation functions in clock
and power
are required to handle correctly the case when they are called without any event bit set.
enum nrf_drv_pwr_ctrl_t |
enum nrf_drv_state_t |
__STATIC_INLINE uint32_t nrf_drv_bitpos_to_event | ( | uint32_t | bit | ) |
Convert bit position to event code.
Function for converting the bit position in INTEN register to event code that is equivalent to the offset of the event register from the beginning of peripheral instance.
For example the result of this function can be casted directly to the types like nrf_twis_event_t or nrf_rng_event_t
bit | Bit position in INTEN register |
__STATIC_INLINE void nrf_drv_common_irq_disable | ( | IRQn_Type | IRQn | ) |
Function disables NVIC interrupt.
[in] | IRQn | Interrupt id |
void nrf_drv_common_irq_enable | ( | IRQn_Type | IRQn, |
uint8_t | priority | ||
) |
Function sets priority and enables NVIC interrupt.
[in] | IRQn | Interrupt id |
[in] | priority | Interrupt priority |
__STATIC_INLINE bool nrf_drv_common_irq_enable_check | ( | IRQn_Type | IRQn | ) |
Check if interrupt is enabled.
Function that checks if selected interrupt is enabled.
[in] | IRQn | Interrupt id |
true | Selected IRQ is enabled. |
false | Selected IRQ is disabled. |
__STATIC_INLINE uint32_t nrf_drv_event_to_bitpos | ( | uint32_t | event | ) |
Convert event code to bit position.
This function can be used to get bit position in INTEN register from event code.
event | Event code that may be casted from enum values from types like nrf_twis_event_t or nrf_rng_event_t |
__STATIC_INLINE IRQn_Type nrf_drv_get_IRQn | ( | void const *const | pinst | ) |
Get interrupt number connected with given instance.
Function returns interrupt number for a given instance of any peripheral.
[in] | pinst | Pointer to peripheral registry |
__STATIC_INLINE bool nrf_drv_is_in_RAM | ( | void const *const | ptr | ) |
Check if given object is in RAM.
Function for analyzing if given location is placed in RAM. This function is used to determine if we have address that can be supported by EasyDMA.
[in] | ptr | Pointer to the object |
true | Object is located in RAM |
false | Object is not located in RAM |