nRF51 SDK - S210 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Programmable Peripheral Interconnect (PPI) driver. More...

Macros

#define NRF_PPI_RESTRICTED   0
 
#define NRF_PPI_ALL_APP_CHANNELS_MASK   ((uint32_t)0xFFF0FFFFuL)
 
#define NRF_PPI_PROG_APP_CHANNELS_MASK   ((uint32_t)0x0000FFFFuL)
 
#define NRF_PPI_ALL_APP_GROUPS_MASK   ((uint32_t)0x0000000FuL)
 

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...
 
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_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...
 
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...
 
uint32_t nrf_drv_ppi_task_addr_get (nrf_ppi_tasks_t task, uint32_t *p_task)
 Function for getting the address of a PPI task. More...
 

Detailed Description

Programmable Peripheral Interconnect (PPI) driver.

Macro Definition Documentation

#define NRF_PPI_ALL_APP_CHANNELS_MASK   ((uint32_t)0xFFF0FFFFuL)

All PPI channels available to the application.

#define NRF_PPI_ALL_APP_GROUPS_MASK   ((uint32_t)0x0000000FuL)

All PPI groups available to the application.

#define NRF_PPI_PROG_APP_CHANNELS_MASK   ((uint32_t)0x0000FFFFuL)

Programmable PPI channels available to the application.

#define NRF_PPI_RESTRICTED   0

1 if PPI peripheral is restricted, 0 otherwise.

Function Documentation

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.

Parameters
[out]p_channelPointer to the PPI channel that has been allocated.
Return values
NRF_SUCCESSIf the channel was successfully allocated.
NRF_ERROR_NO_MEMIf 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.

Parameters
[in]channelPPI channel to be assigned endpoints.
[in]eepEvent endpoint address.
[in]tepTask endpoint address.
Return values
NRF_SUCCESSIf the channel was successfully assigned.
NRF_ERROR_INVALID_STATEIf the channel is not allocated for the user.
NRF_ERROR_INVALID_PARAMIf the channel is not user-configurable.
uint32_t nrf_drv_ppi_channel_disable ( nrf_ppi_channel_t  channel)

Function for disabling a PPI channel.

Parameters
[in]channelPPI channel to be disabled.
Return values
NRF_SUCCESSIf the channel was successfully disabled.
NRF_ERROR_INVALID_STATEIf the user-configurable channel is not allocated.
NRF_ERROR_INVALID_PARAMIf 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.

Parameters
[in]channelPPI channel to be enabled.
Return values
NRF_SUCCESSIf the channel was successfully enabled.
NRF_ERROR_INVALID_STATEIf the user-configurable channel is not allocated.
NRF_ERROR_INVALID_PARAMIf 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.

Parameters
[in]channelPPI channel to be freed.
Return values
NRF_SUCCESSIf the channel was successfully freed.
NRF_ERROR_INVALID_PARAMIf the channel is not user-configurable.
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.

Parameters
[in]channelPPI channel to be added.
[in]groupChannel group in which to include the channel.
Return values
NRF_SUCCESSIf the channel was successfully included.
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.

Parameters
[in]channelPPI channel to be removed.
[in]groupChannel group from which to remove the channel.
Return values
NRF_SUCCESSIf 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.

Parameters
[out]p_groupPointer to the PPI channel group that has been allocated.
Return values
NRF_SUCCESSIf the channel group was successfully allocated.
NRF_ERROR_NO_MEMIf there is no available channel group to be used.
uint32_t nrf_drv_ppi_group_disable ( nrf_ppi_channel_group_t  group)

Function for disabling a PPI channel group.

Parameters
[in]groupChannel group to be disabled.
Return values
NRF_SUCCESSIf 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.

Parameters
[in]groupChannel group to be enabled.
Return values
NRF_SUCCESSIf 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.

Parameters
[in]groupPPI channel group to be freed.
Return values
NRF_SUCCESSIf the channel group was successfully freed.
NRF_ERROR_INVALID_PARAMIf the channel group is not user-configurable.
uint32_t nrf_drv_ppi_init ( void  )

Function for initializing PPI module.

Return values
NRF_SUCCESSIf the module was successfully initialized.
NRF_ERROR_INVALID_STATEIf the module has already been initialized.
uint32_t nrf_drv_ppi_task_addr_get ( nrf_ppi_tasks_t  task,
uint32_t *  p_task 
)

Function for getting the address of a PPI task.

Parameters
[in]taskTask.
[out]p_taskPointer to the task address.
Return values
NRF_SUCCESSIf the address was successfully copied.
uint32_t nrf_drv_ppi_uninit ( void  )

Function for uninitializing the PPI module.

This function also disables all channels and clears the channel groups.

Return values
NRF_SUCCESSIf the module was successfully uninitialized.
NRF_ERROR_INVALID_STATEIf the module has not been initialized yet.
NRF_ERROR_INTERNALIf the channels or groups could not be disabled.