Lines Matching full:group
43 …roups_allocated; /**< Bitmap representing groups availability. 1 when a group is allocated, 0 ot…
47 * @brief Compute a group mask (needed for driver internals, not used for NRF_PPI registers).
49 * @param[in] group Group number to transform to a mask.
51 * @retval Group mask.
53 __STATIC_INLINE uint32_t group_to_mask(nrf_ppi_channel_group_t group) in group_to_mask() argument
55 return (1uL << (uint32_t) group); in group_to_mask()
103 * @brief Check whether a channel group can be used by an application.
105 * @param[in] group Group to check.
107 * @retval true The group is an application group.
108 * @retval false The group is not an application group (this group either does not exist or
111 __STATIC_INLINE bool is_app_group(nrf_ppi_channel_group_t group) in is_app_group() argument
113 return ((NRFX_PPI_ALL_APP_GROUPS_MASK & group_to_mask(group)) != 0); in is_app_group()
163 * @brief Check whether a group is allocated.
165 * @param[in] group_num Group number to check.
167 * @retval true The group is allocated.
168 * false The group is not allocated.
170 __STATIC_INLINE bool is_allocated_group(nrf_ppi_channel_group_t group) in is_allocated_group() argument
172 return ((m_groups_allocated & group_to_mask(group)) != 0); in is_allocated_group()
177 * @brief Set group allocated indication.
179 * @param[in] group_num Specifies the group to set the "allocated" indication.
181 __STATIC_INLINE void group_allocated_set(nrf_ppi_channel_group_t group) in group_allocated_set() argument
183 m_groups_allocated |= group_to_mask(group); in group_allocated_set()
188 * @brief Clear group allocated indication.
190 * @param[in] group_num Specifies the group to clear the "allocated" indication.
192 __STATIC_INLINE void group_allocated_clr(nrf_ppi_channel_group_t group) in group_allocated_clr() argument
194 m_groups_allocated &= ~group_to_mask(group); in group_allocated_clr()
210 nrf_ppi_channel_group_t group; in nrfx_ppi_free_all() local
215 for (group = NRF_PPI_CHANNEL_GROUP0; mask != 0; mask &= ~group_to_mask(group), group++) in nrfx_ppi_free_all()
217 if (mask & group_to_mask(group)) in nrfx_ppi_free_all()
219 nrf_ppi_channel_group_clear(group); in nrfx_ppi_free_all()
380 nrf_ppi_channel_group_t group; in nrfx_ppi_group_alloc() local
385 for (group = NRF_PPI_CHANNEL_GROUP0; mask != 0; mask &= ~group_to_mask(group), group++) in nrfx_ppi_group_alloc()
388 if ((mask & group_to_mask(group)) && (!is_allocated_group(group))) in nrfx_ppi_group_alloc()
390 group_allocated_set(group); in nrfx_ppi_group_alloc()
391 *p_group = group; in nrfx_ppi_group_alloc()
397 NRFX_LOG_INFO("Allocated group: %d.", group); in nrfx_ppi_group_alloc()
407 nrfx_err_t nrfx_ppi_group_free(nrf_ppi_channel_group_t group) in nrfx_ppi_group_free() argument
411 if (!is_app_group(group)) in nrfx_ppi_group_free()
415 if (!is_allocated_group(group)) in nrfx_ppi_group_free()
421 nrf_ppi_group_disable(group); in nrfx_ppi_group_free()
423 group_allocated_clr(group); in nrfx_ppi_group_free()
431 nrfx_err_t nrfx_ppi_group_enable(nrf_ppi_channel_group_t group) in nrfx_ppi_group_enable() argument
435 if (!is_app_group(group)) in nrfx_ppi_group_enable()
439 else if (!is_allocated_group(group)) in nrfx_ppi_group_enable()
445 nrf_ppi_group_enable(group); in nrfx_ppi_group_enable()
452 nrfx_err_t nrfx_ppi_group_disable(nrf_ppi_channel_group_t group) in nrfx_ppi_group_disable() argument
456 if (!is_app_group(group)) in nrfx_ppi_group_disable()
462 nrf_ppi_group_disable(group); in nrfx_ppi_group_disable()
469 nrf_ppi_channel_group_t group) in nrfx_ppi_channels_remove_from_group() argument
473 if (!is_app_group(group)) in nrfx_ppi_channels_remove_from_group()
477 else if (!is_allocated_group(group)) in nrfx_ppi_channels_remove_from_group()
488 nrf_ppi_channels_remove_from_group(channel_mask, group); in nrfx_ppi_channels_remove_from_group()
496 nrf_ppi_channel_group_t group) in nrfx_ppi_channels_include_in_group() argument
500 if (!is_app_group(group)) in nrfx_ppi_channels_include_in_group()
504 else if (!is_allocated_group(group)) in nrfx_ppi_channels_include_in_group()
515 nrf_ppi_channels_include_in_group(channel_mask, group); in nrfx_ppi_channels_include_in_group()