nrfx 4.5.0
Loading...
Searching...
No Matches
Generic PPI layer (legacy)

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_gppiv1_channel_check (uint8_t channel)
 Function for checking if a given channel is enabled.
 
void nrfx_gppiv1_channels_disable_all (void)
 Function for disabling all channels.
 
void nrfx_gppiv1_channels_enable (uint32_t mask)
 Function for enabling multiple channels.
 
void nrfx_gppiv1_channels_disable (uint32_t mask)
 Function for disabling multiple channels.
 
void nrfx_gppiv1_event_endpoint_setup (uint8_t channel, uint32_t eep)
 Function for associating a given channel with the specified event register.
 
void nrfx_gppiv1_task_endpoint_setup (uint8_t channel, uint32_t tep)
 Function for associating a given channel with the specified task register.
 
void nrfx_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_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_gppiv1_group_clear (nrfx_gppi_channel_group_t channel_group)
 Function for removing all channels from a channel group.
 
void nrfx_gppiv1_group_enable (nrfx_gppi_channel_group_t channel_group)
 Function for enabling a channel group.
 
void nrfx_gppiv1_group_disable (nrfx_gppi_channel_group_t channel_group)
 Function for disabling a group.
 
void nrfx_gppiv1_task_trigger (nrfx_gppi_task_t task)
 Function for activating a task.
 
uint32_t nrfx_gppiv1_task_address_get (nrfx_gppi_task_t task)
 Function for returning the address of a specific task register.
 
nrfx_gppi_task_t nrfx_gppiv1_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_gppiv1_group_enable_task_get (nrfx_gppi_channel_group_t group)
 Function for returning the address of a channel group enable task.
 
int nrfx_gppiv1_channel_alloc (uint8_t *p_channel)
 Function for allocating a channel.
 
int nrfx_gppiv1_channel_free (uint8_t channel)
 Function for freeing a channel.
 
int nrfx_gppiv1_group_alloc (nrfx_gppi_channel_group_t *p_group)
 Function for allocating a channel group.
 
int nrfx_gppiv1_group_free (nrfx_gppi_channel_group_t group)
 Function for freeing a channel group.
 

Detailed Description

Helper layer that provides the common functionality of PPI and DPPI drivers.

Warning
This API is deprecated.

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.

Enumeration Type Documentation

◆ nrfx_gppi_channel_group_t

Generic PPI channel groups.

Enumerator
NRFX_GPPI_CHANNEL_GROUP0 

Channel group 0.

NRFX_GPPI_CHANNEL_GROUP1 

Channel group 1.

NRFX_GPPI_CHANNEL_GROUP2 

Channel group 2.

NRFX_GPPI_CHANNEL_GROUP3 

Channel group 3.

NRFX_GPPI_CHANNEL_GROUP4 

Channel group 4.

NRFX_GPPI_CHANNEL_GROUP5 

Channel group 5.

◆ nrfx_gppi_task_t

Generic PPI tasks.

Enumerator
NRFX_GPPI_TASK_CHG0_EN 

Task for enabling channel group 0

NRFX_GPPI_TASK_CHG0_DIS 

Task for disabling channel group 0

NRFX_GPPI_TASK_CHG1_EN 

Task for enabling channel group 1

NRFX_GPPI_TASK_CHG1_DIS 

Task for disabling channel group 1

NRFX_GPPI_TASK_CHG2_EN 

Task for enabling channel group 2

NRFX_GPPI_TASK_CHG2_DIS 

Task for disabling channel group 2

NRFX_GPPI_TASK_CHG3_EN 

Task for enabling channel group 3

NRFX_GPPI_TASK_CHG3_DIS 

Task for disabling channel group 3

NRFX_GPPI_TASK_CHG4_EN 

Task for enabling channel group 4

NRFX_GPPI_TASK_CHG4_DIS 

Task for disabling channel group 4

NRFX_GPPI_TASK_CHG5_EN 

Task for enabling channel group 5

NRFX_GPPI_TASK_CHG5_DIS 

Task for disabling channel group 5

Function Documentation

◆ nrfx_gppiv1_channel_alloc()

int nrfx_gppiv1_channel_alloc ( uint8_t * p_channel)

Function for allocating a channel.

Parameters
[out]p_channelAfter successful allocation, index of the allocated channel.
Return values
0Channel was successfully allocated.
-ENOMEMThere is no available channel to be used.
-ENOTSUPDriver is not enabled.

◆ nrfx_gppiv1_channel_check()

bool nrfx_gppiv1_channel_check ( uint8_t channel)

Function for checking if a given channel is enabled.

Parameters
[in]channelChannel to check.
Return values
trueThe channel is enabled.
falseThe channel is not enabled.

◆ nrfx_gppiv1_channel_endpoints_clear()

void nrfx_gppiv1_channel_endpoints_clear ( uint8_t channel,
uint32_t eep,
uint32_t tep )

Function for clearing the event and task endpoints for a given channel.

Parameters
[in]channelChannel to which the given endpoints are assigned.
[in]eepAddress of the event register.
[in]tepAddress of the task register.

◆ nrfx_gppiv1_channel_endpoints_setup()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel to which the given endpoints are assigned.
[in]eepAddress of the event register.
[in]tepAddress of the task register.

◆ nrfx_gppiv1_channel_free()

int nrfx_gppiv1_channel_free ( uint8_t channel)

Function for freeing a channel.

Parameters
[in]channel(D)PPI channel to be freed.
Return values
0The channel was successfully freed.
-EINVALThe specified channel is not allocated or is not user-configurable.
-ENOTSUPDriver is not enabled.

◆ nrfx_gppiv1_channels_disable()

void nrfx_gppiv1_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.

Parameters
[in]maskChannel mask.

◆ nrfx_gppiv1_channels_enable()

void nrfx_gppiv1_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.

Parameters
[in]maskChannel mask.

◆ nrfx_gppiv1_channels_group_set()

void nrfx_gppiv1_channels_group_set ( uint32_t channel_mask,
nrfx_gppi_channel_group_t channel_group )

Function for setting multiple channels in a channel group.

Parameters
[in]channel_maskChannels to be set in the group.
[in]channel_groupChannel group.

◆ nrfx_gppiv1_channels_include_in_group()

void nrfx_gppiv1_channels_include_in_group ( uint32_t channel_mask,
nrfx_gppi_channel_group_t channel_group )

Function for including multiple channels in a channel group.

Parameters
[in]channel_maskChannels to be included in the group.
[in]channel_groupChannel group.

◆ nrfx_gppiv1_channels_remove_from_group()

void nrfx_gppiv1_channels_remove_from_group ( uint32_t channel_mask,
nrfx_gppi_channel_group_t channel_group )

Function for removing multiple channels from a channel group.

Parameters
[in]channel_maskChannels to be removed from the group.
[in]channel_groupChannel group.

◆ nrfx_gppiv1_event_endpoint_clear()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel for which to clear the event endpoint. Not used in DPPI.
[in]eepAddress of the event register. Not used in PPI.

◆ nrfx_gppiv1_event_endpoint_setup()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel to which to assign the event.
[in]eepAddress of the event register.

◆ nrfx_gppiv1_fork_endpoint_clear()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel for which to clear the fork endpoint. Not used in DPPI.
[in]fork_tepAddress of the task register. Not used in PPI.

◆ nrfx_gppiv1_fork_endpoint_setup()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel to which the given fork endpoint is assigned.
[in]fork_tepAddress of the task register.

◆ nrfx_gppiv1_group_alloc()

int nrfx_gppiv1_group_alloc ( nrfx_gppi_channel_group_t * p_group)

Function for allocating a channel group.

Parameters
[out]p_groupPointer to the (D)PPI channel group that has been allocated.
Return values
0The channel group was successfully allocated.
-ENOMEMThere is no available channel group to be used.
-ENOTSUPDriver is not enabled.

◆ nrfx_gppiv1_group_clear()

void nrfx_gppiv1_group_clear ( nrfx_gppi_channel_group_t channel_group)

Function for removing all channels from a channel group.

Parameters
[in]channel_groupChannel group.

◆ nrfx_gppiv1_group_disable()

void nrfx_gppiv1_group_disable ( nrfx_gppi_channel_group_t channel_group)

Function for disabling a group.

Parameters
[in]channel_groupChannel group.

◆ nrfx_gppiv1_group_disable_task_get()

nrfx_gppi_task_t nrfx_gppiv1_group_disable_task_get ( nrfx_gppi_channel_group_t group)

Function for returning the address of a channel group disable task.

Parameters
[in]groupChannel group.
Returns
Disable task address of the specified group.

◆ nrfx_gppiv1_group_enable()

void nrfx_gppiv1_group_enable ( nrfx_gppi_channel_group_t channel_group)

Function for enabling a channel group.

Parameters
[in]channel_groupChannel group.

◆ nrfx_gppiv1_group_enable_task_get()

nrfx_gppi_task_t nrfx_gppiv1_group_enable_task_get ( nrfx_gppi_channel_group_t group)

Function for returning the address of a channel group enable task.

Parameters
[in]groupChannel group.
Returns
Enable task address of the specified group.

◆ nrfx_gppiv1_group_free()

int nrfx_gppiv1_group_free ( nrfx_gppi_channel_group_t group)

Function for freeing a channel group.

Parameters
[in]group(D)PPI channel group to be freed.
Return values
0The channel was successfully freed.
-EINVALThe specified channel is not allocated or is not user-configurable.
-ENOTSUPDriver is not enabled.

◆ nrfx_gppiv1_task_address_get()

uint32_t nrfx_gppiv1_task_address_get ( nrfx_gppi_task_t task)

Function for returning the address of a specific task register.

Parameters
[in]taskPPI or DPPI task.
Returns
Address of the requested task register.

◆ nrfx_gppiv1_task_endpoint_clear()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel from which to disconnect the task enpoint. Not used in DPPI.
[in]tepAddress of the task register. Not used in PPI.

◆ nrfx_gppiv1_task_endpoint_setup()

void nrfx_gppiv1_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.

Parameters
[in]channelChannel to which to assign the task.
[in]tepAddress of the task register.

◆ nrfx_gppiv1_task_trigger()

void nrfx_gppiv1_task_trigger ( nrfx_gppi_task_t task)

Function for activating a task.

Parameters
[in]taskTask to be activated.