Helper layer that provides the common functionality of PPI and DPPI drivers. More...
Enumerations | |
enum | nrfx_gppi_channel_group_t { NRFX_GPPI_CHANNEL_GROUP0 , NRFX_GPPI_CHANNEL_GROUP1 , NRFX_GPPI_CHANNEL_GROUP2 , NRFX_GPPI_CHANNEL_GROUP3 , NRFX_GPPI_CHANNEL_GROUP4 , NRFX_GPPI_CHANNEL_GROUP5 } |
Generic PPI channel groups. More... | |
enum | nrfx_gppi_task_t { NRFX_GPPI_TASK_CHG0_EN , NRFX_GPPI_TASK_CHG0_DIS , NRFX_GPPI_TASK_CHG1_EN , NRFX_GPPI_TASK_CHG1_DIS , NRFX_GPPI_TASK_CHG2_EN , NRFX_GPPI_TASK_CHG2_DIS , NRFX_GPPI_TASK_CHG3_EN , NRFX_GPPI_TASK_CHG3_DIS , NRFX_GPPI_TASK_CHG4_EN , NRFX_GPPI_TASK_CHG4_DIS , NRFX_GPPI_TASK_CHG5_EN , NRFX_GPPI_TASK_CHG5_DIS } |
Generic PPI tasks. More... | |
Functions | |
bool | nrfx_gppi_channel_check (uint8_t channel) |
Function for checking if a given channel is enabled. | |
void | nrfx_gppi_channels_disable_all (void) |
Function for disabling all channels. | |
void | nrfx_gppi_channels_enable (uint32_t mask) |
Function for enabling multiple channels. | |
void | nrfx_gppi_channels_disable (uint32_t mask) |
Function for disabling multiple channels. | |
void | nrfx_gppi_event_endpoint_setup (uint8_t channel, uint32_t eep) |
Function for associating a given channel with the specified event register. | |
void | nrfx_gppi_task_endpoint_setup (uint8_t channel, uint32_t tep) |
Function for associating a given channel with the specified task register. | |
void | nrfx_gppi_channel_endpoints_setup (uint8_t channel, uint32_t eep, uint32_t tep) |
Function for setting up the event and task endpoints for a given channel. | |
void | nrfx_gppi_channel_endpoints_clear (uint8_t channel, uint32_t eep, uint32_t tep) |
Function for clearing the event and task endpoints for a given channel. | |
void | nrfx_gppi_event_endpoint_clear (uint8_t channel, uint32_t eep) |
Function for clearing the DPPI publish configuration for a given event register or for clearing the PPI event endpoint register. | |
void | nrfx_gppi_task_endpoint_clear (uint8_t channel, uint32_t tep) |
Function for clearing the DPPI subscribe configuration for a given task register or for clearing the PPI task endpoint register. | |
void | nrfx_gppi_fork_endpoint_setup (uint8_t channel, uint32_t fork_tep) |
Function for setting up the task endpoint for a given PPI fork or for associating the DPPI channel with an additional task register. | |
void | nrfx_gppi_fork_endpoint_clear (uint8_t channel, uint32_t fork_tep) |
Function for clearing the task endpoint for a given PPI fork or for clearing the DPPI subscribe register. | |
void | nrfx_gppi_channels_group_set (uint32_t channel_mask, nrfx_gppi_channel_group_t channel_group) |
Function for setting multiple channels in a channel group. | |
void | nrfx_gppi_channels_include_in_group (uint32_t channel_mask, nrfx_gppi_channel_group_t channel_group) |
Function for including multiple channels in a channel group. | |
void | nrfx_gppi_channels_remove_from_group (uint32_t channel_mask, nrfx_gppi_channel_group_t channel_group) |
Function for removing multiple channels from a channel group. | |
void | nrfx_gppi_group_clear (nrfx_gppi_channel_group_t channel_group) |
Function for removing all channels from a channel group. | |
void | nrfx_gppi_group_enable (nrfx_gppi_channel_group_t channel_group) |
Function for enabling a channel group. | |
void | nrfx_gppi_group_disable (nrfx_gppi_channel_group_t channel_group) |
Function for disabling a group. | |
void | nrfx_gppi_task_trigger (nrfx_gppi_task_t task) |
Function for activating a task. | |
uint32_t | nrfx_gppi_task_address_get (nrfx_gppi_task_t task) |
Function for returning the address of a specific task register. | |
nrfx_gppi_task_t | nrfx_gppi_group_disable_task_get (nrfx_gppi_channel_group_t group) |
Function for returning the address of a channel group disable task. | |
nrfx_gppi_task_t | nrfx_gppi_group_enable_task_get (nrfx_gppi_channel_group_t group) |
Function for returning the address of a channel group enable task. | |
nrfx_err_t | nrfx_gppi_channel_alloc (uint8_t *p_channel) |
Function for allocating a channel. | |
nrfx_err_t | nrfx_gppi_channel_free (uint8_t channel) |
Function for freeing a channel. | |
nrfx_err_t | nrfx_gppi_group_alloc (nrfx_gppi_channel_group_t *p_group) |
Function for allocating a channel group. | |
nrfx_err_t | nrfx_gppi_group_free (nrfx_gppi_channel_group_t group) |
Function for freeing a channel group. | |
Helper layer that provides the common functionality of PPI and DPPI drivers.
Use PPI and DPPI drivers directly. This layer is provided only to help create generic code that can be built for SoCs equipped with either of these peripherals. When using this layer, take into account that there are significant differences between the PPI and DPPI interfaces that affect the behavior of this layer.
One difference is that PPI allows associating of one task or event with more than one channel, whereas DPPI does not allow this. In DPPI, the second association overwrites the first one. Consequently, this helper layer cannot be used in applications that need to connect a task or event to multiple channels.
Another difference is that in DPPI one channel can be associated with multiple tasks and multiple events, while in PPI this is not possible (with the exception of the association of a second task as a fork). Because of this difference, it is important to clear the previous endpoints of the channel that is to be reused with some different ones. Otherwise, the behavior of this helper layer will be different, depending on the actual interface used: in DPPI the channel configuration will be extended with the new endpoints, and in PPI the new endpoints will replace the previous ones.
enum nrfx_gppi_task_t |
Generic PPI tasks.
nrfx_err_t nrfx_gppi_channel_alloc | ( | uint8_t * | p_channel | ) |
Function for allocating a channel.
[out] | p_channel | After successful allocation, index of the allocated channel. |
NRFX_SUCCESS | Channel was successfully allocated. |
NRFX_ERROR_NO_MEM | There is no available channel to be used. |
NRFX_ERROR_NOT_SUPPORTED | Driver is not enabled. |
bool nrfx_gppi_channel_check | ( | uint8_t | channel | ) |
Function for checking if a given channel is enabled.
[in] | channel | Channel to check. |
true | The channel is enabled. |
false | The channel is not enabled. |
void nrfx_gppi_channel_endpoints_clear | ( | uint8_t | channel, |
uint32_t | eep, | ||
uint32_t | tep | ||
) |
Function for clearing the event and task endpoints for a given channel.
[in] | channel | Channel to which the given endpoints are assigned. |
[in] | eep | Address of the event register. |
[in] | tep | Address of the task register. |
void nrfx_gppi_channel_endpoints_setup | ( | uint8_t | channel, |
uint32_t | eep, | ||
uint32_t | tep | ||
) |
Function for setting up the event and task endpoints for a given channel.
[in] | channel | Channel to which the given endpoints are assigned. |
[in] | eep | Address of the event register. |
[in] | tep | Address of the task register. |
nrfx_err_t nrfx_gppi_channel_free | ( | uint8_t | channel | ) |
Function for freeing a channel.
[in] | channel | (D)PPI channel to be freed. |
NRFX_SUCCESS | The channel was successfully freed. |
NRFX_ERROR_INVALID_PARAM | The specified channel is not allocated or is not user-configurable. |
NRFX_ERROR_NOT_SUPPORTED | Driver is not enabled. |
void nrfx_gppi_channels_disable | ( | uint32_t | mask | ) |
Function for disabling multiple channels.
The bits in mask
value correspond to particular channels. This means that writing 1 to bit 0 disables channel 0, writing 1 to bit 1 disables channel 1, etc.
[in] | mask | Channel mask. |
void nrfx_gppi_channels_enable | ( | uint32_t | mask | ) |
Function for enabling multiple channels.
The bits in mask
value correspond to particular channels. This means that writing 1 to bit 0 enables channel 0, writing 1 to bit 1 enables channel 1, etc.
[in] | mask | Channel mask. |
void nrfx_gppi_channels_group_set | ( | uint32_t | channel_mask, |
nrfx_gppi_channel_group_t | channel_group | ||
) |
Function for setting multiple channels in a channel group.
[in] | channel_mask | Channels to be set in the group. |
[in] | channel_group | Channel group. |
void nrfx_gppi_channels_include_in_group | ( | uint32_t | channel_mask, |
nrfx_gppi_channel_group_t | channel_group | ||
) |
Function for including multiple channels in a channel group.
[in] | channel_mask | Channels to be included in the group. |
[in] | channel_group | Channel group. |
void nrfx_gppi_channels_remove_from_group | ( | uint32_t | channel_mask, |
nrfx_gppi_channel_group_t | channel_group | ||
) |
Function for removing multiple channels from a channel group.
[in] | channel_mask | Channels to be removed from the group. |
[in] | channel_group | Channel group. |
void nrfx_gppi_event_endpoint_clear | ( | uint8_t | channel, |
uint32_t | eep | ||
) |
Function for clearing the DPPI publish configuration for a given event register or for clearing the PPI event endpoint register.
[in] | channel | Channel for which to clear the event endpoint. Not used in DPPI. |
[in] | eep | Address of the event register. Not used in PPI. |
void nrfx_gppi_event_endpoint_setup | ( | uint8_t | channel, |
uint32_t | eep | ||
) |
Function for associating a given channel with the specified event register.
This function sets the DPPI publish configuration for a given event or sets the PPI event endpoint register.
[in] | channel | Channel to which to assign the event. |
[in] | eep | Address of the event register. |
void nrfx_gppi_fork_endpoint_clear | ( | uint8_t | channel, |
uint32_t | fork_tep | ||
) |
Function for clearing the task endpoint for a given PPI fork or for clearing the DPPI subscribe register.
[in] | channel | Channel for which to clear the fork endpoint. Not used in DPPI. |
[in] | fork_tep | Address of the task register. Not used in PPI. |
void nrfx_gppi_fork_endpoint_setup | ( | uint8_t | channel, |
uint32_t | fork_tep | ||
) |
Function for setting up the task endpoint for a given PPI fork or for associating the DPPI channel with an additional task register.
[in] | channel | Channel to which the given fork endpoint is assigned. |
[in] | fork_tep | Address of the task register. |
nrfx_err_t nrfx_gppi_group_alloc | ( | nrfx_gppi_channel_group_t * | p_group | ) |
Function for allocating a channel group.
[out] | p_group | Pointer to the (D)PPI channel group that has been allocated. |
NRFX_SUCCESS | The channel group was successfully allocated. |
NRFX_ERROR_NO_MEM | There is no available channel group to be used. |
NRFX_ERROR_NOT_SUPPORTED | Driver is not enabled. |
void nrfx_gppi_group_clear | ( | nrfx_gppi_channel_group_t | channel_group | ) |
Function for removing all channels from a channel group.
[in] | channel_group | Channel group. |
void nrfx_gppi_group_disable | ( | nrfx_gppi_channel_group_t | channel_group | ) |
Function for disabling a group.
[in] | channel_group | Channel group. |
nrfx_gppi_task_t nrfx_gppi_group_disable_task_get | ( | nrfx_gppi_channel_group_t | group | ) |
Function for returning the address of a channel group disable task.
[in] | group | Channel group. |
void nrfx_gppi_group_enable | ( | nrfx_gppi_channel_group_t | channel_group | ) |
Function for enabling a channel group.
[in] | channel_group | Channel group. |
nrfx_gppi_task_t nrfx_gppi_group_enable_task_get | ( | nrfx_gppi_channel_group_t | group | ) |
Function for returning the address of a channel group enable task.
[in] | group | Channel group. |
nrfx_err_t nrfx_gppi_group_free | ( | nrfx_gppi_channel_group_t | group | ) |
Function for freeing a channel group.
[in] | group | (D)PPI channel group to be freed. |
NRFX_SUCCESS | The channel was successfully freed. |
NRFX_ERROR_INVALID_PARAM | The specified channel is not allocated or is not user-configurable. |
NRFX_ERROR_NOT_SUPPORTED | Driver is not enabled. |
uint32_t nrfx_gppi_task_address_get | ( | nrfx_gppi_task_t | task | ) |
Function for returning the address of a specific task register.
[in] | task | PPI or DPPI task. |
void nrfx_gppi_task_endpoint_clear | ( | uint8_t | channel, |
uint32_t | tep | ||
) |
Function for clearing the DPPI subscribe configuration for a given task register or for clearing the PPI task endpoint register.
[in] | channel | Channel from which to disconnect the task enpoint. Not used in DPPI. |
[in] | tep | Address of the task register. Not used in PPI. |
void nrfx_gppi_task_endpoint_setup | ( | uint8_t | channel, |
uint32_t | tep | ||
) |
Function for associating a given channel with the specified task register.
This function sets the DPPI subscribe configuration for a given task or sets the PPI task endpoint register.
[in] | channel | Channel to which to assign the task. |
[in] | tep | Address of the task register. |
void nrfx_gppi_task_trigger | ( | nrfx_gppi_task_t | task | ) |
Function for activating a task.
[in] | task | Task to be activated. |