libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
PPI peripheral API

Access functions for the Programmable Peripheral Interconnect More...

Collaboration diagram for PPI peripheral API:

Functions

void ppi_configure_channel (uint8_t chan_num, uint32_t eep, uint32_t tep)
 Configure PPI Channel. More...
 
void ppi_enable_channels (uint32_t channels)
 Enable PPI channels, given the channels mask. More...
 
void ppi_disable_channels (uint32_t channels)
 Disable PPI channels, given the channels mask. More...
 
void ppi_set_group (uint8_t group, uint32_t channels)
 Set channels group, given channels mask. More...
 
void ppi_enable_group (uint8_t group)
 Enable previously configured group of channels. More...
 
void ppi_disable_group (uint8_t group)
 Disable previously configured group of channels. More...
 
uint8_t ppi_add_channel (uint32_t *chan_map, uint32_t eep, uint32_t tep, bool enable)
 Configure new channel. More...
 
void ppi_remove_channel (uint32_t *chan_map, uint8_t chan_num)
 Disable channel and remove it from the map of used channels. More...
 

Detailed Description

Access functions for the Programmable Peripheral Interconnect

LGPL License Terms libopencm3 License

Author
© 2016 Maxim Sloyko maxim.nosp@m.s@go.nosp@m.ogle..nosp@m.com

Function Documentation

◆ ppi_add_channel()

uint8_t ppi_add_channel ( uint32_t *  chan_map,
uint32_t  eep,
uint32_t  tep,
bool  enable 
)

Configure new channel.

This is the alternative API, which requires the caller to store the mask of used channels.

Parameters
chan_mapuint32_t* The mask of channels that are already in use. For the first call initialize with zero and pass in.
[in]eepuint32_t Event endpoint.
[in]tepuint32_t Task endpoint.
enablebool If true, enable the channel immediately.
Returns
The number of the new channel. If there are no channels available, returns 0xff.

Definition at line 106 of file ppi.c.

References ppi_configure_channel(), ppi_enable_channels(), and PPI_MAX_PROG_CHANNEL.

Here is the call graph for this function:

◆ ppi_configure_channel()

void ppi_configure_channel ( uint8_t  chan_num,
uint32_t  eep,
uint32_t  tep 
)

Configure PPI Channel.

Parameters
[in]chan_numuint8_t Channel number (0-15).
[in]eepuint32_t Event endpoint. Memory address of the event endpoint.
[in]tepuint32_t Task endpoint. Memory address of the task endpoint.

Definition at line 43 of file ppi.c.

References PPI_CH_EEP, and PPI_CH_TEP.

Referenced by ppi_add_channel().

Here is the caller graph for this function:

◆ ppi_disable_channels()

void ppi_disable_channels ( uint32_t  channels)

Disable PPI channels, given the channels mask.

Parameters
[in]channelsuint32_t mask of the channels to disable.

Definition at line 62 of file ppi.c.

References PPI_CHENCLR.

Referenced by ppi_remove_channel().

Here is the caller graph for this function:

◆ ppi_disable_group()

void ppi_disable_group ( uint8_t  group)

Disable previously configured group of channels.

Parameters
[in]groupuint8_t group number (0-3)

Definition at line 90 of file ppi.c.

References PPI_TASK_CHG_DIS.

◆ ppi_enable_channels()

void ppi_enable_channels ( uint32_t  channels)

Enable PPI channels, given the channels mask.

Parameters
[in]channelsuint32_t mask of the channels to enable.

Definition at line 53 of file ppi.c.

References PPI_CHENSET.

Referenced by ppi_add_channel().

Here is the caller graph for this function:

◆ ppi_enable_group()

void ppi_enable_group ( uint8_t  group)

Enable previously configured group of channels.

Parameters
[in]groupuint8_t group number (0-3)

Definition at line 81 of file ppi.c.

References PPI_TASK_CHG_EN.

◆ ppi_remove_channel()

void ppi_remove_channel ( uint32_t *  chan_map,
uint8_t  chan_num 
)

Disable channel and remove it from the map of used channels.

This is the alternative API, which requires the caller to store the mask of used channels.

Parameters
chan_mapuint32_t* The mask of channels that are already in use. For the first call initialize with zero and pass in.
[in]chan_numuint8_t the number of the channel to remove from the map.

Definition at line 139 of file ppi.c.

References PPI_CH, and ppi_disable_channels().

Here is the call graph for this function:

◆ ppi_set_group()

void ppi_set_group ( uint8_t  group,
uint32_t  channels 
)

Set channels group, given channels mask.

Parameters
[in]groupuint8_t group number (0-3)
[in]channelsuint32_t mask of the channels to group together.

Definition at line 72 of file ppi.c.

References PPI_CHG.