![]() |
nrfx 4.5.0
|
Helper layer that provides the common functionality of PPI system. More...
Topics | |
| Generic PPI layer configuration | |
| Generic PPI layer (legacy) | |
| Helper layer that provides the common functionality of PPI and DPPI drivers. | |
| GPPI Routes | |
| Structures and macros for handling GPPI routes in multi-domain DPPI system. | |
| GPPI structures specific to Distributed (across multiple domains) DPPI (D2PPI) architecture. | |
| Structures for SoC specific GPPI API. | |
Data Structures | |
| struct | nrfx_gppi_t |
| Structure which holds resources for PPI system. More... | |
| struct | nrfx_gppi_resource_t |
| A structure describing a DPPI resource in multi domain system. More... | |
Typedefs | |
| typedef uint32_t | nrfx_gppi_handle_t |
| Handle used for PPI connection. | |
| typedef uint32_t | nrfx_gppi_group_handle_t |
| Handle used for PPI group resource. | |
Functions | |
| void | nrfx_gppi_init (nrfx_gppi_t *p_instance) |
| Function for initializing GPPI with a structure with resources. | |
| NRFX_STATIC_INLINE uint32_t | nrfx_gppi_group_domain_id_get (nrfx_gppi_group_handle_t handle) |
| Function for getting the domain ID from the group handle. | |
| NRFX_STATIC_INLINE uint32_t | nrfx_gppi_domain_id_get (uint32_t addr) |
| Function for getting the domain ID from the peripheral register address. | |
| NRFX_STATIC_INLINE int | nrfx_gppi_ep_channel_get (uint32_t ep) |
| Function for getting the channel that is used for an endpoint. | |
| int | nrfx_gppi_domain_channel_get (nrfx_gppi_handle_t handle, uint32_t node_id) |
| Function for getting one of a channels that is used in a connection. | |
| int | nrfx_gppi_domain_conn_alloc (uint32_t producer, uint32_t consumer, nrfx_gppi_handle_t *p_handle) |
| Function for allocating and setup a connection between two domains. | |
| int | nrfx_gppi_ep_attach (uint32_t ep, nrfx_gppi_handle_t handle) |
| Function for attaching an endpoint to the connection. | |
| int | nrfx_gppi_ep_to_ch_attach (uint32_t ep, uint8_t channel) |
| Function for attaching an endpoint to the channel. | |
| int | nrfx_gppi_conn_alloc (uint32_t eep, uint32_t tep, nrfx_gppi_handle_t *p_handle) |
| Function for allocating a connection between Task and Event. | |
| void | nrfx_gppi_domain_conn_free (nrfx_gppi_handle_t handle) |
| Function for freeing a connection between domains. | |
| void | nrfx_gppi_ep_clear (uint32_t ep) |
| Function for clearing an endpoint. | |
| void | nrfx_gppi_ep_ch_clear (uint32_t ep, uint8_t channel) |
| Function for clearing an endpoint. | |
| void | nrfx_gppi_ep_enable (uint32_t ep) |
| Function for enabling an endpoint. | |
| void | nrfx_gppi_ep_disable (uint32_t ep) |
| Function for disabling an endpoint. | |
| void | nrfx_gppi_conn_free (uint32_t eep, uint32_t tep, nrfx_gppi_handle_t handle) |
| Function for clearing and freeing a connection. | |
| void | nrfx_gppi_conn_enable (nrfx_gppi_handle_t handle) |
| Function for enabling a connection. | |
| void | nrfx_gppi_conn_disable (nrfx_gppi_handle_t handle) |
| Function for disabling a connection. | |
| void | nrfx_gppi_channels_enable (uint32_t domain_id, uint32_t ch_mask) |
| Function for enabling channels in a domain. | |
| void | nrfx_gppi_channels_disable (uint32_t domain_id, uint32_t ch_mask) |
| Function for disabling channels in a domain. | |
| bool | nrfx_gppi_chan_is_enabled (uint32_t domain_id, uint32_t ch) |
| Function for checking if a channel is enabled. | |
| NRFX_STATIC_INLINE int | nrfx_gppi_ep_chan_enable (uint32_t ep) |
| Function for enabling a channel used by the endpoint. | |
| NRFX_STATIC_INLINE int | nrfx_gppi_ep_is_enabled (uint32_t ep) |
| Function for checking if a channel assigned to the endpoint is enabled. | |
| NRFX_STATIC_INLINE int | nrfx_gppi_ep_chan_disable (uint32_t ep) |
| Function for disabling a channel used by the endpoint. | |
| int | nrfx_gppi_group_alloc (uint32_t domain_id, nrfx_gppi_group_handle_t *p_handle) |
| Function for allocating a group for given set of endpoints. | |
| void | nrfx_gppi_group_free (nrfx_gppi_group_handle_t handle) |
| Function for freeing a group. | |
| void | nrfx_gppi_group_ch_add (nrfx_gppi_group_handle_t handle, uint32_t channel) |
| Function for adding a channel to a group. | |
| void | nrfx_gppi_group_ch_remove (nrfx_gppi_group_handle_t handle, uint32_t channel) |
| Function for removing a channel from a group. | |
| NRFX_STATIC_INLINE int | nrfx_gppi_group_ep_add (nrfx_gppi_group_handle_t handle, uint32_t ep) |
| Function for adding a configured endpoint to a group. | |
| NRFX_STATIC_INLINE int | nrfx_gppi_group_ep_remove (nrfx_gppi_group_handle_t handle, uint32_t ep) |
| Function for removing a configured endpoint from a group. | |
| uint32_t | nrfx_gppi_group_channels_get (nrfx_gppi_group_handle_t handle) |
| Function for getting a mask with channels which are assigned to the group. | |
| void | nrfx_gppi_group_enable (nrfx_gppi_group_handle_t handle) |
| Function for enabling a group. | |
| void | nrfx_gppi_group_disable (nrfx_gppi_group_handle_t handle) |
| Function for disabling a group. | |
| uint32_t | nrfx_gppi_group_task_en_addr (nrfx_gppi_group_handle_t handle) |
| Function for getting the enable group task address. | |
| uint32_t | nrfx_gppi_group_task_dis_addr (nrfx_gppi_group_handle_t handle) |
| Function for getting the disable group task address. | |
| int | nrfx_gppi_channel_alloc (uint32_t node_id) |
| Function for allocating a group channel in a specific node of the DPPI system. | |
| void | nrfx_gppi_channel_free (uint32_t node_id, uint8_t channel) |
| Function for freeing a channel in a specific node of the DPPI system. | |
| int | nrfx_gppi_group_channel_alloc (uint32_t domain_id) |
| Function for allocating a group channel in a specific node of the DPPI system. | |
| void | nrfx_gppi_group_channel_free (uint32_t domain_id, uint8_t channel) |
| Function for freeing a group channel in a specific node of the DPPI system. | |
| int | nrfx_gppi_ext_conn_alloc (uint32_t producer, uint32_t consumer, nrfx_gppi_handle_t *p_handle, nrfx_gppi_resource_t *p_resource) |
| Function for allocating and setting up a connection using an external resource. | |
Helper layer that provides the common functionality of PPI system.
This is the only place where PPI system resources are managed.
There are 4 types of peripheral interconnection systems:
| bool nrfx_gppi_chan_is_enabled | ( | uint32_t | domain_id, |
| uint32_t | ch ) |
Function for checking if a channel is enabled.
| [in] | domain_id | Domain ID. nrfx_gppi_domain_id_get can be used to get domain_id. |
| [in] | ch | Channel. |
| true | Channel is enabled. |
| false | Channel is disabled. |
| int nrfx_gppi_channel_alloc | ( | uint32_t | node_id | ) |
Function for allocating a group channel in a specific node of the DPPI system.
Function can be used to allocate a resource and use it outside of this driver.
node_id parameter is used only in the system with multiple domains. nrfx_gppi_domain_id_get or target-specific header can be used to get the node ID (see nrfx_gppi_node_id_t).| [in] | node_id | Target-specific identifier of the DPPI system node (DPPIC or PPIB). |
| non-negative | Allocated channel. |
| -ENOMEM | Failed to allocate a channel. |
| void nrfx_gppi_channel_free | ( | uint32_t | node_id, |
| uint8_t | channel ) |
Function for freeing a channel in a specific node of the DPPI system.
channel must be allocated earlier using nrfx_gppi_channel_alloc. node_id must be the same as the one used in nrfx_gppi_channel_alloc for allocating that resource.
| [in] | node_id | Target-specific identifier of the DPPI system node (DPPIC or PPIB). |
| [in] | channel | Channel. |
| void nrfx_gppi_channels_disable | ( | uint32_t | domain_id, |
| uint32_t | ch_mask ) |
Function for disabling channels in a domain.
| [in] | domain_id | Domain ID. nrfx_gppi_domain_id_get can be used to get domain_id. |
| [in] | ch_mask | Channel mask. |
| void nrfx_gppi_channels_enable | ( | uint32_t | domain_id, |
| uint32_t | ch_mask ) |
Function for enabling channels in a domain.
| [in] | domain_id | Domain ID. nrfx_gppi_domain_id_get can be used to get domain_id. |
| [in] | ch_mask | Channel mask. |
| int nrfx_gppi_conn_alloc | ( | uint32_t | eep, |
| uint32_t | tep, | ||
| nrfx_gppi_handle_t * | p_handle ) |
Function for allocating a connection between Task and Event.
Function performs nrfx_gppi_domain_conn_alloc followed by the configuration of endpoints.
| [in] | eep | Event endpoint address. |
| [in] | tep | Task endpoint address. |
| [out] | p_handle | Handle used to control the connection. |
| 0 | Successful connection allocation. |
| -ENOMEM | There is not enough resources to allocate the connection. |
| -EINVAL | eep or tep is already configured to be used by the DPPI. |
| void nrfx_gppi_conn_disable | ( | nrfx_gppi_handle_t | handle | ) |
Function for disabling a connection.
Function disables channels in every DPPI instance which belongs to the connection.
| [in] | handle | Connection handle. |
| void nrfx_gppi_conn_enable | ( | nrfx_gppi_handle_t | handle | ) |
Function for enabling a connection.
Function enables channels in every DPPI instance which belongs to the connection.
| [in] | handle | Connection handle. |
| void nrfx_gppi_conn_free | ( | uint32_t | eep, |
| uint32_t | tep, | ||
| nrfx_gppi_handle_t | handle ) |
Function for clearing and freeing a connection.
Function performs nrfx_gppi_domain_conn_free followed by clearing of endpoints.
| [in] | eep | Event endpoint. |
| [in] | tep | Task endpoint. |
| [in] | handle | Connection handle. |
| int nrfx_gppi_domain_channel_get | ( | nrfx_gppi_handle_t | handle, |
| uint32_t | node_id ) |
Function for getting one of a channels that is used in a connection.
A connection may consists of a number of nodes which are domains with a unique DPPI or PPIB nodes. nrfx_gppi_domain_id_get can be used to get the domain ID for a given peripheral. Node ID for PPIB is target-specific and can be found in a target-specific header file (see nrfx_gppi_node_id_t).
| [in] | handle | Connection handle. |
| [in] | node_id | Domain or PPIB node ID. |
| non-negative | Configured channel. |
| -EINVAL | Invalid input arguments. |
| int nrfx_gppi_domain_conn_alloc | ( | uint32_t | producer, |
| uint32_t | consumer, | ||
| nrfx_gppi_handle_t * | p_handle ) |
Function for allocating and setup a connection between two domains.
In case of a multi domain DPPI, function is allocating all needed resources and configures PPIB bridges. For single domain cases (PPI or DPPI) only a channel is allocated.
| [in] | producer | Domain that will produce (publish) events. Not used in single domain case. |
| [in] | consumer | Domain that will consume (subsribe to) events. Not used in single domain case. |
| [out] | p_handle | Handle used to control the connection. |
| 0 | On successful connection allocation. |
| -ENOMEM | There is not enough resources to allocate the connection. |
| void nrfx_gppi_domain_conn_free | ( | nrfx_gppi_handle_t | handle | ) |
Function for freeing a connection between domains.
For connection within a single domain a channel is freed. For cross-domain connection channels in bridges (PPIB) are cleared and all used resources are freed.. Connection shall be disabled prior to clearing.
| [in] | handle | Connection handle. |
| NRFX_STATIC_INLINE uint32_t nrfx_gppi_domain_id_get | ( | uint32_t | addr | ) |
Function for getting the domain ID from the peripheral register address.
| [in] | addr | Address. |
| int nrfx_gppi_ep_attach | ( | uint32_t | ep, |
| nrfx_gppi_handle_t | handle ) |
Function for attaching an endpoint to the connection.
Endpoint can be task, event, publish or subscribe register address. In order to allow attaching the endpoint it must belong to the route that connection is using. On SoC with PPI there are limitations regarding how many endpoints can be attached to a handle (channel) - 1 event and 2 tasks (1 if FORK is not present).
| [in] | ep | Endpoint address (task or event register). |
| [in] | handle | Connection handle. |
| 0 | Endpoint attached. |
| -EINVAL | Endpoint cannot be attached, i.e. it does not belong to the route. |
| void nrfx_gppi_ep_ch_clear | ( | uint32_t | ep, |
| uint8_t | channel ) |
Function for clearing an endpoint.
For DPPI it is the same as nrfx_gppi_ep_clear. For PPI it clears channel configuration.
| [in] | ep | Endpoint address (task or event register). |
| [in] | channel | Channel. |
| NRFX_STATIC_INLINE int nrfx_gppi_ep_chan_disable | ( | uint32_t | ep | ) |
Function for disabling a channel used by the endpoint.
| [in] | ep | Endpoint address (task or event register). |
| 0 | Successful operation. |
| -EINVAL | Endpoint has no channel. |
| NRFX_STATIC_INLINE int nrfx_gppi_ep_chan_enable | ( | uint32_t | ep | ) |
Function for enabling a channel used by the endpoint.
| [in] | ep | Endpoint address (task or event register). |
| 0 | Successful operation. |
| -EINVAL | Endpoint has no channel. |
| NRFX_STATIC_INLINE int nrfx_gppi_ep_channel_get | ( | uint32_t | ep | ) |
Function for getting the channel that is used for an endpoint.
| [in] | ep | Endpoint address (task or event register). |
| non-negative | Configured channel. |
| -EINVAL | Endpoint does not have channel. |
| void nrfx_gppi_ep_clear | ( | uint32_t | ep | ) |
Function for clearing an endpoint.
Remove endpoint from DPPI channel. For PPI it searches all channel configurations and clears the first configuration where the endpoint was used. For PPI it is more time consuming so in PPI specific code nrfx_gppi_ep_ch_clear can be used.
| [in] | ep | Endpoint address (task or event register). |
| void nrfx_gppi_ep_disable | ( | uint32_t | ep | ) |
Function for disabling an endpoint.
In case of PPI function disables the channel which is used by the endpoint. In case of DPPI, function is only disabling the endpoint and does not control the channel to which the endpoint is attached.
| [in] | ep | Endpoint address (task or event register). |
| void nrfx_gppi_ep_enable | ( | uint32_t | ep | ) |
Function for enabling an endpoint.
In case of PPI function enables the channel which is used by the endpoint. In case of DPPI, function is only enabling an endpoint and does not control the channel to which the endpoint is attached.
| [in] | ep | Endpoint address (task or event register). |
| NRFX_STATIC_INLINE int nrfx_gppi_ep_is_enabled | ( | uint32_t | ep | ) |
Function for checking if a channel assigned to the endpoint is enabled.
| [in] | ep | Endpoint address (task or event register). |
| 0 | Channel is enabled. |
| -EINVAL | Endpoint has no channel. |
| -EAGAIN | Channel is disabled. |
| int nrfx_gppi_ep_to_ch_attach | ( | uint32_t | ep, |
| uint8_t | channel ) |
Function for attaching an endpoint to the channel.
Endpoint can be task, event, publish or subscribe register address.
| [in] | ep | Endpoint address (task or event register). |
| [in] | channel | Channel. |
| 0 | Endpoint attached. |
| -EINVAL | Endpoint cannot be attached, i.e. endpoints already configured in case of PPI. |
| NRFX_STATIC_INLINE int nrfx_gppi_ext_conn_alloc | ( | uint32_t | producer, |
| uint32_t | consumer, | ||
| nrfx_gppi_handle_t * | p_handle, | ||
| nrfx_gppi_resource_t * | p_resource ) |
Function for allocating and setting up a connection using an external resource.
If DPPI resource is provided then it is used in the connection and additional channel in that domain is not allocated. If connection was set up with an external resource then functions for enabling and disabling the connection are only changing state of channels that were allocated for that connection. If p is null then function is equivalent of nrfx_gppi_domain_conn_alloc.
| [in] | producer | Domain that will produce (publish) events. |
| [in] | consumer | Domain that will consume (subsribe to) events. |
| [out] | p_handle | Handle used to control the connection. |
| [in] | p_resource | Optional external DPPI resource. |
| 0 | Successful connection allocation. |
| -ENOMEM | There is not enough resources to allocate the connection. |
| -ENOTSUP | Not supported. Supported only on multi domain system. |
| int nrfx_gppi_group_alloc | ( | uint32_t | domain_id, |
| nrfx_gppi_group_handle_t * | p_handle ) |
Function for allocating a group for given set of endpoints.
Group can only enable or disable channels in a single DPPI so all endpoints must belong to a single domain. Use nrfx_gppi_domain_id_get with one of the endpoints that is intended to be added to that group to get domain_id.
| [in] | domain_id | Domain ID for the group. |
| [out] | p_handle | Location where handle is written. |
| 0 | Successful allocation of a group. handle can be used. |
| -EINVAL | Endpoints are not from the same domain. |
| -ENOMEM | Failed to allocate a free group channel. |
| void nrfx_gppi_group_ch_add | ( | nrfx_gppi_group_handle_t | handle, |
| uint32_t | channel ) |
Function for adding a channel to a group.
nrfx_gppi_ep_channel_get can be used on a configured endpoint to retrieve the channel that shall be added to the group.
| [in] | handle | Group handle. |
| [in] | channel | Channel. |
| void nrfx_gppi_group_ch_remove | ( | nrfx_gppi_group_handle_t | handle, |
| uint32_t | channel ) |
Function for removing a channel from a group.
nrfx_gppi_ep_channel_get can be used on a configured endpoint to retrieve the channel that shall be added to the group.
| [in] | handle | Group handle. |
| [in] | channel | Channel. |
| int nrfx_gppi_group_channel_alloc | ( | uint32_t | domain_id | ) |
Function for allocating a group channel in a specific node of the DPPI system.
Function can be used to allocate a resource and use it outside of this driver.
domain_id parameter is used only in the system with multiple domains. Use nrfx_gppi_domain_id_get to get the ID.| [in] | domain_id | Target-specific identifier of the DPPI system node. |
| non-negative | Allocated channel. |
| -ENOMEM | Failed to allocate a channel. |
| void nrfx_gppi_group_channel_free | ( | uint32_t | domain_id, |
| uint8_t | channel ) |
Function for freeing a group channel in a specific node of the DPPI system.
channel must be allocated earlier using nrfx_gppi_group_channel_alloc. domain_id must be the same as the one used in nrfx_gppi_group_channel_alloc for allocating that resource.
| [in] | domain_id | Target-specific identifier of the DPPI system node. |
| [in] | channel | Channel. |
| uint32_t nrfx_gppi_group_channels_get | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for getting a mask with channels which are assigned to the group.
| [in] | handle | Group handle. |
| void nrfx_gppi_group_disable | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for disabling a group.
| [in] | handle | Group handle. |
| NRFX_STATIC_INLINE uint32_t nrfx_gppi_group_domain_id_get | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for getting the domain ID from the group handle.
| [in] | handle | Group handle. |
| void nrfx_gppi_group_enable | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for enabling a group.
| [in] | handle | Group handle. |
| NRFX_STATIC_INLINE int nrfx_gppi_group_ep_add | ( | nrfx_gppi_group_handle_t | handle, |
| uint32_t | ep ) |
Function for adding a configured endpoint to a group.
Endpoint must be from the same domain as group and it must already be configured to use a channel.
| [in] | handle | Group handle. |
| [in] | ep | Endpoint address (task or event register). |
| 0 | Successful operation. |
| -EINVAL | Failed to extend the group. |
| NRFX_STATIC_INLINE int nrfx_gppi_group_ep_remove | ( | nrfx_gppi_group_handle_t | handle, |
| uint32_t | ep ) |
Function for removing a configured endpoint from a group.
Endpoint must be added to the group and it must be configured to use a channel.
| [in] | handle | Group handle. |
| [in] | ep | Endpoint address (task or event register). |
| 0 | Successful operation. |
| -EINVAL | Failed to remove from the group. |
| void nrfx_gppi_group_free | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for freeing a group.
| [in] | handle | Group handle. |
| uint32_t nrfx_gppi_group_task_dis_addr | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for getting the disable group task address.
| [in] | handle | Group handle. |
| Address | of the task register. |
| uint32_t nrfx_gppi_group_task_en_addr | ( | nrfx_gppi_group_handle_t | handle | ) |
Function for getting the enable group task address.
| [in] | handle | Group handle. |
| Address | of the task register. |
| void nrfx_gppi_init | ( | nrfx_gppi_t * | p_instance | ) |
Function for initializing GPPI with a structure with resources.
Function shall be called as early as possible to allow resource allocation. p_instance contains channel resources which need to be initialized before calling that function.
| [in] | p_instance | Instance. |