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

Hardware abstraction layer for setting up Programmable Peripheral Interconnect (PPI) channels. More...

Macros

#define NRF_PPI_TASK_SET   (1UL)
 

Enumerations

enum  nrf_ppi_channel_t {
  NRF_PPI_CHANNEL0 = PPI_CHEN_CH0_Pos,
  NRF_PPI_CHANNEL1 = PPI_CHEN_CH1_Pos,
  NRF_PPI_CHANNEL2 = PPI_CHEN_CH2_Pos,
  NRF_PPI_CHANNEL3 = PPI_CHEN_CH3_Pos,
  NRF_PPI_CHANNEL4 = PPI_CHEN_CH4_Pos,
  NRF_PPI_CHANNEL5 = PPI_CHEN_CH5_Pos,
  NRF_PPI_CHANNEL6 = PPI_CHEN_CH6_Pos,
  NRF_PPI_CHANNEL7 = PPI_CHEN_CH7_Pos,
  NRF_PPI_CHANNEL8 = PPI_CHEN_CH8_Pos,
  NRF_PPI_CHANNEL9 = PPI_CHEN_CH9_Pos,
  NRF_PPI_CHANNEL10 = PPI_CHEN_CH10_Pos,
  NRF_PPI_CHANNEL11 = PPI_CHEN_CH11_Pos,
  NRF_PPI_CHANNEL12 = PPI_CHEN_CH12_Pos,
  NRF_PPI_CHANNEL13 = PPI_CHEN_CH13_Pos,
  NRF_PPI_CHANNEL14 = PPI_CHEN_CH14_Pos,
  NRF_PPI_CHANNEL15 = PPI_CHEN_CH15_Pos,
  NRF_PPI_CHANNEL20 = PPI_CHEN_CH20_Pos,
  NRF_PPI_CHANNEL21 = PPI_CHEN_CH21_Pos,
  NRF_PPI_CHANNEL22 = PPI_CHEN_CH22_Pos,
  NRF_PPI_CHANNEL23 = PPI_CHEN_CH23_Pos,
  NRF_PPI_CHANNEL24 = PPI_CHEN_CH24_Pos,
  NRF_PPI_CHANNEL25 = PPI_CHEN_CH25_Pos,
  NRF_PPI_CHANNEL26 = PPI_CHEN_CH26_Pos,
  NRF_PPI_CHANNEL27 = PPI_CHEN_CH27_Pos,
  NRF_PPI_CHANNEL28 = PPI_CHEN_CH28_Pos,
  NRF_PPI_CHANNEL29 = PPI_CHEN_CH29_Pos,
  NRF_PPI_CHANNEL30 = PPI_CHEN_CH30_Pos,
  NRF_PPI_CHANNEL31 = PPI_CHEN_CH31_Pos
}
 PPI channels. More...
 
enum  nrf_ppi_channel_group_t {
  NRF_PPI_CHANNEL_GROUP0 = 0,
  NRF_PPI_CHANNEL_GROUP1 = 1,
  NRF_PPI_CHANNEL_GROUP2 = 2,
  NRF_PPI_CHANNEL_GROUP3 = 3
}
 PPI channel groups. More...
 
enum  nrf_ppi_channel_include_t {
  NRF_PPI_CHANNEL_EXCLUDE = PPI_CHG_CH0_Excluded,
  NRF_PPI_CHANNEL_INCLUDE = PPI_CHG_CH0_Included
}
 Definition of which PPI channels belong to a group. More...
 
enum  nrf_ppi_channel_enable_t {
  NRF_PPI_CHANNEL_DISABLED = PPI_CHEN_CH0_Disabled,
  NRF_PPI_CHANNEL_ENABLED = PPI_CHEN_CH0_Enabled
}
 Definition if a PPI channel is enabled. More...
 
enum  nrf_ppi_task_t {
  NRF_PPI_TASK_CHG0_EN = offsetof(NRF_PPI_Type, TASKS_CHG[0].EN),
  NRF_PPI_TASK_CHG0_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[0].DIS),
  NRF_PPI_TASK_CHG1_EN = offsetof(NRF_PPI_Type, TASKS_CHG[1].EN),
  NRF_PPI_TASK_CHG1_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[1].DIS),
  NRF_PPI_TASK_CHG2_EN = offsetof(NRF_PPI_Type, TASKS_CHG[2].EN),
  NRF_PPI_TASK_CHG2_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[2].DIS),
  NRF_PPI_TASK_CHG3_EN = offsetof(NRF_PPI_Type, TASKS_CHG[3].EN),
  NRF_PPI_TASK_CHG3_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[3].DIS)
}
 PPI tasks. More...
 

Functions

__STATIC_INLINE void nrf_ppi_channel_enable (nrf_ppi_channel_t channel)
 Function for enabling a given PPI channel. More...
 
__STATIC_INLINE void nrf_ppi_channel_disable (nrf_ppi_channel_t channel)
 Function for disabling a given PPI channel. More...
 
__STATIC_INLINE
nrf_ppi_channel_enable_t 
nrf_ppi_channel_enable_get (nrf_ppi_channel_t channel)
 Function for checking if a given PPI channel is enabled. More...
 
__STATIC_INLINE void nrf_ppi_channel_disable_all (void)
 Function for disabling all PPI channels.
 
__STATIC_INLINE void nrf_ppi_channel_endpoint_setup (nrf_ppi_channel_t channel, uint32_t eep, uint32_t tep)
 Function for setting up event and task endpoints for a given PPI channel. More...
 
__STATIC_INLINE void nrf_ppi_channel_include_in_group (nrf_ppi_channel_t channel, nrf_ppi_channel_group_t channel_group)
 Function for including a PPI channel in a channel group. More...
 
__STATIC_INLINE void nrf_ppi_channels_include_in_group (uint32_t channel_mask, nrf_ppi_channel_group_t channel_group)
 Function for including multiple PPI channels in a channel group. More...
 
__STATIC_INLINE void nrf_ppi_channel_remove_from_group (nrf_ppi_channel_t channel, nrf_ppi_channel_group_t channel_group)
 Function for removing a PPI channel from a channel group. More...
 
__STATIC_INLINE void nrf_ppi_channels_remove_from_group (uint32_t channel_mask, nrf_ppi_channel_group_t channel_group)
 Function for removing multiple PPI channels from a channel group. More...
 
__STATIC_INLINE void nrf_ppi_channel_group_clear (nrf_ppi_channel_group_t group)
 Function for removing all PPI channels from a channel group. More...
 
__STATIC_INLINE void nrf_ppi_group_enable (nrf_ppi_channel_group_t group)
 Function for enabling a channel group. More...
 
__STATIC_INLINE void nrf_ppi_group_disable (nrf_ppi_channel_group_t group)
 Function for disabling a channel group. More...
 
__STATIC_INLINE void nrf_ppi_task_trigger (nrf_ppi_task_t ppi_task)
 Function for setting a PPI task. More...
 
__STATIC_INLINE uint32_t * nrf_ppi_task_address_get (nrf_ppi_task_t ppi_task)
 Function for returning the address of a specific PPI task register. More...
 
__STATIC_INLINE uint32_t * nrf_ppi_task_group_enable_address_get (nrf_ppi_channel_group_t group)
 Function for returning the PPI enable task address of a specific group. More...
 
__STATIC_INLINE uint32_t * nrf_ppi_task_group_disable_address_get (nrf_ppi_channel_group_t group)
 Function for returning the PPI disable task address of a specific group. More...
 

Detailed Description

Hardware abstraction layer for setting up Programmable Peripheral Interconnect (PPI) channels.

Enumeration Type Documentation

Definition if a PPI channel is enabled.

Enumerator
NRF_PPI_CHANNEL_DISABLED 

Channel disabled.

NRF_PPI_CHANNEL_ENABLED 

Channel enabled.

PPI channel groups.

Enumerator
NRF_PPI_CHANNEL_GROUP0 

Channel group 0.

NRF_PPI_CHANNEL_GROUP1 

Channel group 1.

NRF_PPI_CHANNEL_GROUP2 

Channel group 2.

NRF_PPI_CHANNEL_GROUP3 

Channel group 3.

Definition of which PPI channels belong to a group.

Enumerator
NRF_PPI_CHANNEL_EXCLUDE 

Channel excluded from a group.

NRF_PPI_CHANNEL_INCLUDE 

Channel included in a group.

PPI channels.

Enumerator
NRF_PPI_CHANNEL0 

Channel 0.

NRF_PPI_CHANNEL1 

Channel 1.

NRF_PPI_CHANNEL2 

Channel 2.

NRF_PPI_CHANNEL3 

Channel 3.

NRF_PPI_CHANNEL4 

Channel 4.

NRF_PPI_CHANNEL5 

Channel 5.

NRF_PPI_CHANNEL6 

Channel 6.

NRF_PPI_CHANNEL7 

Channel 7.

NRF_PPI_CHANNEL8 

Channel 8.

NRF_PPI_CHANNEL9 

Channel 9.

NRF_PPI_CHANNEL10 

Channel 10.

NRF_PPI_CHANNEL11 

Channel 11.

NRF_PPI_CHANNEL12 

Channel 12.

NRF_PPI_CHANNEL13 

Channel 13.

NRF_PPI_CHANNEL14 

Channel 14.

NRF_PPI_CHANNEL15 

Channel 15.

NRF_PPI_CHANNEL20 

Channel 20.

NRF_PPI_CHANNEL21 

Channel 21.

NRF_PPI_CHANNEL22 

Channel 22.

NRF_PPI_CHANNEL23 

Channel 23.

NRF_PPI_CHANNEL24 

Channel 24.

NRF_PPI_CHANNEL25 

Channel 25.

NRF_PPI_CHANNEL26 

Channel 26.

NRF_PPI_CHANNEL27 

Channel 27.

NRF_PPI_CHANNEL28 

Channel 28.

NRF_PPI_CHANNEL29 

Channel 29.

NRF_PPI_CHANNEL30 

Channel 30.

NRF_PPI_CHANNEL31 

Channel 31.

PPI tasks.

Enumerator
NRF_PPI_TASK_CHG0_EN 

Task for enabling channel group 0

NRF_PPI_TASK_CHG0_DIS 

Task for disabling channel group 0

NRF_PPI_TASK_CHG1_EN 

Task for enabling channel group 1

NRF_PPI_TASK_CHG1_DIS 

Task for disabling channel group 1

NRF_PPI_TASK_CHG2_EN 

Task for enabling channel group 2

NRF_PPI_TASK_CHG2_DIS 

Task for disabling channel group 2

NRF_PPI_TASK_CHG3_EN 

Task for enabling channel group 3

NRF_PPI_TASK_CHG3_DIS 

Task for disabling channel group 3

Function Documentation

__STATIC_INLINE void nrf_ppi_channel_disable ( nrf_ppi_channel_t  channel)

Function for disabling a given PPI channel.

This function disables only one channel.

Parameters
[in]channelChannel to disable.
__STATIC_INLINE void nrf_ppi_channel_enable ( nrf_ppi_channel_t  channel)

Function for enabling a given PPI channel.

This function enables only one channel.

Parameters
[in]channelChannel to enable.
__STATIC_INLINE nrf_ppi_channel_enable_t nrf_ppi_channel_enable_get ( nrf_ppi_channel_t  channel)

Function for checking if a given PPI channel is enabled.

This function checks only one channel.

Parameters
[in]channelChannel to check.
Return values
NRF_PPI_CHANNEL_ENABLEDIf the channel is enabled.
NRF_PPI_CHANNEL_DISABLEDIf the channel is not enabled.
__STATIC_INLINE void nrf_ppi_channel_endpoint_setup ( nrf_ppi_channel_t  channel,
uint32_t  eep,
uint32_t  tep 
)

Function for setting up event and task endpoints for a given PPI channel.

Parameters
[in]eepEvent register address (register value).
[in]tepTask register address (register value).
[in]channelChannel to which the given endpoints are assigned.
__STATIC_INLINE void nrf_ppi_channel_group_clear ( nrf_ppi_channel_group_t  group)

Function for removing all PPI channels from a channel group.

Parameters
[in]groupChannel group.
__STATIC_INLINE void nrf_ppi_channel_include_in_group ( nrf_ppi_channel_t  channel,
nrf_ppi_channel_group_t  channel_group 
)

Function for including a PPI channel in a channel group.

This function adds only one channel to the group.

Parameters
[in]channelChannel to be included in the group.
[in]channel_groupChannel group.
__STATIC_INLINE void nrf_ppi_channel_remove_from_group ( nrf_ppi_channel_t  channel,
nrf_ppi_channel_group_t  channel_group 
)

Function for removing a PPI channel from a channel group.

This function removes only one channel from the group.

Parameters
[in]channelChannel to be removed from the group.
[in]channel_groupChannel group.
__STATIC_INLINE void nrf_ppi_channels_include_in_group ( uint32_t  channel_mask,
nrf_ppi_channel_group_t  channel_group 
)

Function for including multiple PPI channels in a channel group.

This function adds all specified channels to the group.

Parameters
[in]channel_maskChannels to be included in the group.
[in]channel_groupChannel group.
__STATIC_INLINE void nrf_ppi_channels_remove_from_group ( uint32_t  channel_mask,
nrf_ppi_channel_group_t  channel_group 
)

Function for removing multiple PPI channels from a channel group.

This function removes all specified channels from the group.

Parameters
[in]channel_maskChannels to be removed from the group.
[in]channel_groupChannel group.
__STATIC_INLINE void nrf_ppi_group_disable ( nrf_ppi_channel_group_t  group)

Function for disabling a channel group.

Parameters
[in]groupChannel group.
__STATIC_INLINE void nrf_ppi_group_enable ( nrf_ppi_channel_group_t  group)

Function for enabling a channel group.

Parameters
[in]groupChannel group.
__STATIC_INLINE uint32_t* nrf_ppi_task_address_get ( nrf_ppi_task_t  ppi_task)

Function for returning the address of a specific PPI task register.

Parameters
[in]ppi_taskPPI task.
__STATIC_INLINE uint32_t* nrf_ppi_task_group_disable_address_get ( nrf_ppi_channel_group_t  group)

Function for returning the PPI disable task address of a specific group.

Parameters
[in]groupPPI group.
__STATIC_INLINE uint32_t* nrf_ppi_task_group_enable_address_get ( nrf_ppi_channel_group_t  group)

Function for returning the PPI enable task address of a specific group.

Parameters
[in]groupPPI group.
__STATIC_INLINE void nrf_ppi_task_trigger ( nrf_ppi_task_t  ppi_task)

Function for setting a PPI task.

Parameters
[in]ppi_taskPPI task to set.