nRF51 SDK - S110 SoftDevice
|
Programmable Peripheral Interconnect (PPI) driver. More...
Macros | |
#define | NRF_PPI_ALL_APP_CHANNELS_MASK ((uint32_t)0xFFF0FFFFuL & ~(NRF_PPI_CHANNELS_USED)) |
#define | NRF_PPI_PROG_APP_CHANNELS_MASK ((uint32_t)0x0000FFFFuL & ~(NRF_PPI_CHANNELS_USED)) |
#define | NRF_PPI_ALL_APP_GROUPS_MASK ((uint32_t)0x0000000FuL & ~(NRF_PPI_GROUPS_USED)) |
Functions | |
uint32_t | nrf_drv_ppi_init (void) |
Function for initializing PPI module. More... | |
uint32_t | nrf_drv_ppi_uninit (void) |
Function for uninitializing the PPI module. More... | |
uint32_t | nrf_drv_ppi_channel_alloc (nrf_ppi_channel_t *p_channel) |
Function for allocating a PPI channel. More... | |
uint32_t | nrf_drv_ppi_channel_free (nrf_ppi_channel_t channel) |
Function for freeing a PPI channel. More... | |
uint32_t | nrf_drv_ppi_channel_assign (nrf_ppi_channel_t channel, uint32_t eep, uint32_t tep) |
Function for assigning task and event endpoints to the PPI channel. More... | |
uint32_t | nrf_drv_ppi_channel_enable (nrf_ppi_channel_t channel) |
Function for enabling a PPI channel. More... | |
uint32_t | nrf_drv_ppi_channel_disable (nrf_ppi_channel_t channel) |
Function for disabling a PPI channel. More... | |
uint32_t | nrf_drv_ppi_group_alloc (nrf_ppi_channel_group_t *p_group) |
Function for allocating a PPI channel group. More... | |
uint32_t | nrf_drv_ppi_group_free (nrf_ppi_channel_group_t group) |
Function for freeing a PPI channel group. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_channel_to_mask (nrf_ppi_channel_t channel) |
Compute a channel mask for NRF_PPI registers. More... | |
uint32_t | nrf_drv_ppi_channels_include_in_group (uint32_t channel_mask, nrf_ppi_channel_group_t group) |
Function for including multiple PPI channels in a channel group. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_channel_include_in_group (nrf_ppi_channel_t channel, nrf_ppi_channel_group_t group) |
Function for including a PPI channel in a channel group. More... | |
uint32_t | nrf_drv_ppi_channels_remove_from_group (uint32_t channel_mask, nrf_ppi_channel_group_t group) |
Function for removing multiple PPI channels from a channel group. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_channel_remove_from_group (nrf_ppi_channel_t channel, nrf_ppi_channel_group_t group) |
Function for removing a PPI channel from a channel group. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_group_clear (nrf_ppi_channel_group_t group) |
Function for clearing a PPI channel group. More... | |
uint32_t | nrf_drv_ppi_group_enable (nrf_ppi_channel_group_t group) |
Function for enabling a PPI channel group. More... | |
uint32_t | nrf_drv_ppi_group_disable (nrf_ppi_channel_group_t group) |
Function for disabling a PPI channel group. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_task_addr_get (nrf_ppi_task_t task) |
Function for getting the address of a PPI task. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_task_addr_group_enable_get (nrf_ppi_channel_group_t group) |
Function for getting the address of a PPI group enable task. More... | |
__STATIC_INLINE uint32_t | nrf_drv_ppi_task_addr_group_disable_get (nrf_ppi_channel_group_t group) |
Function for getting the address of a PPI group enable task. More... | |
Programmable Peripheral Interconnect (PPI) driver.
#define NRF_PPI_ALL_APP_CHANNELS_MASK ((uint32_t)0xFFF0FFFFuL & ~(NRF_PPI_CHANNELS_USED)) |
All PPI channels available to the application.
#define NRF_PPI_ALL_APP_GROUPS_MASK ((uint32_t)0x0000000FuL & ~(NRF_PPI_GROUPS_USED)) |
All PPI groups available to the application.
#define NRF_PPI_PROG_APP_CHANNELS_MASK ((uint32_t)0x0000FFFFuL & ~(NRF_PPI_CHANNELS_USED)) |
Programmable PPI channels available to the application.
uint32_t nrf_drv_ppi_channel_alloc | ( | nrf_ppi_channel_t * | p_channel | ) |
Function for allocating a PPI channel.
This function allocates the first unused PPI channel.
[out] | p_channel | Pointer to the PPI channel that has been allocated. |
NRF_SUCCESS | If the channel was successfully allocated. |
NRF_ERROR_NO_MEM | If there is no available channel to be used. |
uint32_t nrf_drv_ppi_channel_assign | ( | nrf_ppi_channel_t | channel, |
uint32_t | eep, | ||
uint32_t | tep | ||
) |
Function for assigning task and event endpoints to the PPI channel.
[in] | channel | PPI channel to be assigned endpoints. |
[in] | eep | Event endpoint address. |
[in] | tep | Task endpoint address. |
NRF_SUCCESS | If the channel was successfully assigned. |
NRF_ERROR_INVALID_STATE | If the channel is not allocated for the user. |
NRF_ERROR_INVALID_PARAM | If the channel is not user-configurable. |
uint32_t nrf_drv_ppi_channel_disable | ( | nrf_ppi_channel_t | channel | ) |
Function for disabling a PPI channel.
[in] | channel | PPI channel to be disabled. |
NRF_SUCCESS | If the channel was successfully disabled. |
NRF_ERROR_INVALID_STATE | If the user-configurable channel is not allocated. |
NRF_ERROR_INVALID_PARAM | If the channel cannot be disabled by the user. |
uint32_t nrf_drv_ppi_channel_enable | ( | nrf_ppi_channel_t | channel | ) |
Function for enabling a PPI channel.
[in] | channel | PPI channel to be enabled. |
NRF_SUCCESS | If the channel was successfully enabled. |
NRF_ERROR_INVALID_STATE | If the user-configurable channel is not allocated. |
NRF_ERROR_INVALID_PARAM | If the channel cannot be enabled by the user. |
uint32_t nrf_drv_ppi_channel_free | ( | nrf_ppi_channel_t | channel | ) |
Function for freeing a PPI channel.
This function also disables the chosen channel.
[in] | channel | PPI channel to be freed. |
NRF_SUCCESS | If the channel was successfully freed. |
NRF_ERROR_INVALID_PARAM | If the channel is not user-configurable. |
__STATIC_INLINE uint32_t nrf_drv_ppi_channel_include_in_group | ( | nrf_ppi_channel_t | channel, |
nrf_ppi_channel_group_t | group | ||
) |
Function for including a PPI channel in a channel group.
[in] | channel | PPI channel to be added. |
[in] | group | Channel group in which to include the channel. |
NRF_SUCCESS | If the channel was successfully included. |
__STATIC_INLINE uint32_t nrf_drv_ppi_channel_remove_from_group | ( | nrf_ppi_channel_t | channel, |
nrf_ppi_channel_group_t | group | ||
) |
Function for removing a PPI channel from a channel group.
[in] | channel | PPI channel to be removed. |
[in] | group | Channel group from which to remove the channel. |
NRF_SUCCESS | If the channel was successfully removed. |
__STATIC_INLINE uint32_t nrf_drv_ppi_channel_to_mask | ( | nrf_ppi_channel_t | channel | ) |
Compute a channel mask for NRF_PPI registers.
[in] | channel | Channel number to transform to a mask. |
Channel | mask. |
uint32_t nrf_drv_ppi_channels_include_in_group | ( | uint32_t | channel_mask, |
nrf_ppi_channel_group_t | group | ||
) |
Function for including multiple PPI channels in a channel group.
[in] | channel_mask | PPI channels to be added. |
[in] | group | Channel group in which to include the channels. |
NRF_SUCCESS | If the channels was successfully included. |
uint32_t nrf_drv_ppi_channels_remove_from_group | ( | uint32_t | channel_mask, |
nrf_ppi_channel_group_t | group | ||
) |
Function for removing multiple PPI channels from a channel group.
[in] | channel_mask | PPI channels to be removed. |
[in] | group | Channel group from which to remove the channels. |
NRF_SUCCESS | If the channel was successfully removed. |
uint32_t nrf_drv_ppi_group_alloc | ( | nrf_ppi_channel_group_t * | p_group | ) |
Function for allocating a PPI channel group.
This function allocates the first unused PPI group.
[out] | p_group | Pointer to the PPI channel group that has been allocated. |
NRF_SUCCESS | If the channel group was successfully allocated. |
NRF_ERROR_NO_MEM | If there is no available channel group to be used. |
__STATIC_INLINE uint32_t nrf_drv_ppi_group_clear | ( | nrf_ppi_channel_group_t | group | ) |
Function for clearing a PPI channel group.
[in] | group | Channel group to be cleared. |
NRF_SUCCESS | If the group was successfully cleared. |
< All PPI channels available to the application.
uint32_t nrf_drv_ppi_group_disable | ( | nrf_ppi_channel_group_t | group | ) |
Function for disabling a PPI channel group.
[in] | group | Channel group to be disabled. |
NRF_SUCCESS | If the group was successfully disabled. |
uint32_t nrf_drv_ppi_group_enable | ( | nrf_ppi_channel_group_t | group | ) |
Function for enabling a PPI channel group.
[in] | group | Channel group to be enabled. |
NRF_SUCCESS | If the group was successfully enabled. |
uint32_t nrf_drv_ppi_group_free | ( | nrf_ppi_channel_group_t | group | ) |
Function for freeing a PPI channel group.
This function also disables the chosen group.
[in] | group | PPI channel group to be freed. |
NRF_SUCCESS | If the channel group was successfully freed. |
NRF_ERROR_INVALID_PARAM | If the channel group is not user-configurable. |
uint32_t nrf_drv_ppi_init | ( | void | ) |
Function for initializing PPI module.
NRF_SUCCESS | If the module was successfully initialized. |
MODULE_ALREADY_INITIALIZED | If the module has already been initialized. |
__STATIC_INLINE uint32_t nrf_drv_ppi_task_addr_get | ( | nrf_ppi_task_t | task | ) |
Function for getting the address of a PPI task.
[in] | task | Task. |
Task | address. |
__STATIC_INLINE uint32_t nrf_drv_ppi_task_addr_group_disable_get | ( | nrf_ppi_channel_group_t | group | ) |
Function for getting the address of a PPI group enable task.
[in] | group | PPI channel group |
Task | address. |
__STATIC_INLINE uint32_t nrf_drv_ppi_task_addr_group_enable_get | ( | nrf_ppi_channel_group_t | group | ) |
Function for getting the address of a PPI group enable task.
[in] | group | PPI channel group |
Task | address. |
uint32_t nrf_drv_ppi_uninit | ( | void | ) |
Function for uninitializing the PPI module.
This function also disables all channels and clears the channel groups.
NRF_SUCCESS | If the module was successfully uninitialized. |
NRF_ERROR_INVALID_STATE | If the module has not been initialized yet. |
NRF_ERROR_INTERNAL | If the channels or groups could not be disabled. |