Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /*
sahilmgandhi 18:6a4db94011d3 2 * Copyright (c) 2015 Nordic Semiconductor ASA
sahilmgandhi 18:6a4db94011d3 3 * All rights reserved.
sahilmgandhi 18:6a4db94011d3 4 *
sahilmgandhi 18:6a4db94011d3 5 * Redistribution and use in source and binary forms, with or without modification,
sahilmgandhi 18:6a4db94011d3 6 * are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 7 *
sahilmgandhi 18:6a4db94011d3 8 * 1. Redistributions of source code must retain the above copyright notice, this list
sahilmgandhi 18:6a4db94011d3 9 * of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 10 *
sahilmgandhi 18:6a4db94011d3 11 * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
sahilmgandhi 18:6a4db94011d3 12 * integrated circuit in a product or a software update for such product, must reproduce
sahilmgandhi 18:6a4db94011d3 13 * the above copyright notice, this list of conditions and the following disclaimer in
sahilmgandhi 18:6a4db94011d3 14 * the documentation and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 15 *
sahilmgandhi 18:6a4db94011d3 16 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
sahilmgandhi 18:6a4db94011d3 17 * used to endorse or promote products derived from this software without specific prior
sahilmgandhi 18:6a4db94011d3 18 * written permission.
sahilmgandhi 18:6a4db94011d3 19 *
sahilmgandhi 18:6a4db94011d3 20 * 4. This software, with or without modification, must only be used with a
sahilmgandhi 18:6a4db94011d3 21 * Nordic Semiconductor ASA integrated circuit.
sahilmgandhi 18:6a4db94011d3 22 *
sahilmgandhi 18:6a4db94011d3 23 * 5. Any software provided in binary or object form under this license must not be reverse
sahilmgandhi 18:6a4db94011d3 24 * engineered, decompiled, modified and/or disassembled.
sahilmgandhi 18:6a4db94011d3 25 *
sahilmgandhi 18:6a4db94011d3 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
sahilmgandhi 18:6a4db94011d3 27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
sahilmgandhi 18:6a4db94011d3 28 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
sahilmgandhi 18:6a4db94011d3 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
sahilmgandhi 18:6a4db94011d3 30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
sahilmgandhi 18:6a4db94011d3 31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
sahilmgandhi 18:6a4db94011d3 32 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
sahilmgandhi 18:6a4db94011d3 33 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
sahilmgandhi 18:6a4db94011d3 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
sahilmgandhi 18:6a4db94011d3 35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 36 *
sahilmgandhi 18:6a4db94011d3 37 */
sahilmgandhi 18:6a4db94011d3 38
sahilmgandhi 18:6a4db94011d3 39
sahilmgandhi 18:6a4db94011d3 40 #ifndef NRF_DRV_PPI_H
sahilmgandhi 18:6a4db94011d3 41 #define NRF_DRV_PPI_H
sahilmgandhi 18:6a4db94011d3 42
sahilmgandhi 18:6a4db94011d3 43 /*lint ++flb "Enter library region" */
sahilmgandhi 18:6a4db94011d3 44 #include "sdk_errors.h"
sahilmgandhi 18:6a4db94011d3 45 #include "nrf_ppi.h"
sahilmgandhi 18:6a4db94011d3 46 #include <stdbool.h>
sahilmgandhi 18:6a4db94011d3 47 #include <stdint.h>
sahilmgandhi 18:6a4db94011d3 48
sahilmgandhi 18:6a4db94011d3 49 /** @file
sahilmgandhi 18:6a4db94011d3 50 *
sahilmgandhi 18:6a4db94011d3 51 * @addtogroup nrf_ppi PPI HAL and driver
sahilmgandhi 18:6a4db94011d3 52 * @ingroup nrf_drivers
sahilmgandhi 18:6a4db94011d3 53 * @brief Programmable Peripheral Interconnect (PPI) APIs.
sahilmgandhi 18:6a4db94011d3 54 *
sahilmgandhi 18:6a4db94011d3 55 * @details The PPI HAL provides basic APIs for accessing the registers of the PPI.
sahilmgandhi 18:6a4db94011d3 56 * The PPI driver provides APIs on a higher level.
sahilmgandhi 18:6a4db94011d3 57 *
sahilmgandhi 18:6a4db94011d3 58 * @defgroup lib_driver_ppi PPI driver
sahilmgandhi 18:6a4db94011d3 59 * @{
sahilmgandhi 18:6a4db94011d3 60 * @ingroup nrf_ppi
sahilmgandhi 18:6a4db94011d3 61 *
sahilmgandhi 18:6a4db94011d3 62 * @brief Programmable Peripheral Interconnect (PPI) driver.
sahilmgandhi 18:6a4db94011d3 63 */
sahilmgandhi 18:6a4db94011d3 64
sahilmgandhi 18:6a4db94011d3 65 #include "sdk_resources.h"
sahilmgandhi 18:6a4db94011d3 66
sahilmgandhi 18:6a4db94011d3 67 #ifdef NRF52
sahilmgandhi 18:6a4db94011d3 68
sahilmgandhi 18:6a4db94011d3 69 #define NRF_PPI_ALL_APP_CHANNELS_MASK ((uint32_t)0xFFFFFFFFuL & ~(NRF_PPI_CHANNELS_USED)) /**< All PPI channels available to the application. */
sahilmgandhi 18:6a4db94011d3 70 #define NRF_PPI_PROG_APP_CHANNELS_MASK ((uint32_t)0x000FFFFFuL & ~(NRF_PPI_CHANNELS_USED)) /**< Programmable PPI channels available to the application. */
sahilmgandhi 18:6a4db94011d3 71 #define NRF_PPI_ALL_APP_GROUPS_MASK ((uint32_t)0x0000003FuL & ~(NRF_PPI_GROUPS_USED)) /**< All PPI groups available to the application. */
sahilmgandhi 18:6a4db94011d3 72
sahilmgandhi 18:6a4db94011d3 73 #else
sahilmgandhi 18:6a4db94011d3 74
sahilmgandhi 18:6a4db94011d3 75 #define NRF_PPI_ALL_APP_CHANNELS_MASK ((uint32_t)0xFFF0FFFFuL & ~(NRF_PPI_CHANNELS_USED)) /**< All PPI channels available to the application. */
sahilmgandhi 18:6a4db94011d3 76 #define NRF_PPI_PROG_APP_CHANNELS_MASK ((uint32_t)0x0000FFFFuL & ~(NRF_PPI_CHANNELS_USED)) /**< Programmable PPI channels available to the application. */
sahilmgandhi 18:6a4db94011d3 77 #define NRF_PPI_ALL_APP_GROUPS_MASK ((uint32_t)0x0000000FuL & ~(NRF_PPI_GROUPS_USED)) /**< All PPI groups available to the application. */
sahilmgandhi 18:6a4db94011d3 78
sahilmgandhi 18:6a4db94011d3 79 #endif
sahilmgandhi 18:6a4db94011d3 80
sahilmgandhi 18:6a4db94011d3 81
sahilmgandhi 18:6a4db94011d3 82 /**@brief Function for initializing PPI module.
sahilmgandhi 18:6a4db94011d3 83 *
sahilmgandhi 18:6a4db94011d3 84 * @retval NRF_SUCCESS If the module was successfully initialized.
sahilmgandhi 18:6a4db94011d3 85 * @retval MODULE_ALREADY_INITIALIZED If the module has already been initialized.
sahilmgandhi 18:6a4db94011d3 86 */
sahilmgandhi 18:6a4db94011d3 87 uint32_t nrf_drv_ppi_init(void);
sahilmgandhi 18:6a4db94011d3 88
sahilmgandhi 18:6a4db94011d3 89 /**@brief Function for uninitializing the PPI module.
sahilmgandhi 18:6a4db94011d3 90 *
sahilmgandhi 18:6a4db94011d3 91 * This function also disables all channels and clears the channel groups.
sahilmgandhi 18:6a4db94011d3 92 *
sahilmgandhi 18:6a4db94011d3 93 * @retval NRF_SUCCESS If the module was successfully uninitialized.
sahilmgandhi 18:6a4db94011d3 94 * @retval NRF_ERROR_INVALID_STATE If the module has not been initialized yet.
sahilmgandhi 18:6a4db94011d3 95 * @retval NRF_ERROR_INTERNAL If the channels or groups could not be disabled.
sahilmgandhi 18:6a4db94011d3 96 */
sahilmgandhi 18:6a4db94011d3 97 uint32_t nrf_drv_ppi_uninit(void);
sahilmgandhi 18:6a4db94011d3 98
sahilmgandhi 18:6a4db94011d3 99 /**@brief Function for allocating a PPI channel.
sahilmgandhi 18:6a4db94011d3 100 * @details This function allocates the first unused PPI channel.
sahilmgandhi 18:6a4db94011d3 101 *
sahilmgandhi 18:6a4db94011d3 102 * @param[out] p_channel Pointer to the PPI channel that has been allocated.
sahilmgandhi 18:6a4db94011d3 103 *
sahilmgandhi 18:6a4db94011d3 104 * @retval NRF_SUCCESS If the channel was successfully allocated.
sahilmgandhi 18:6a4db94011d3 105 * @retval NRF_ERROR_NO_MEM If there is no available channel to be used.
sahilmgandhi 18:6a4db94011d3 106 */
sahilmgandhi 18:6a4db94011d3 107 uint32_t nrf_drv_ppi_channel_alloc(nrf_ppi_channel_t * p_channel);
sahilmgandhi 18:6a4db94011d3 108
sahilmgandhi 18:6a4db94011d3 109 /**@brief Function for freeing a PPI channel.
sahilmgandhi 18:6a4db94011d3 110 * @details This function also disables the chosen channel.
sahilmgandhi 18:6a4db94011d3 111 *
sahilmgandhi 18:6a4db94011d3 112 * @param[in] channel PPI channel to be freed.
sahilmgandhi 18:6a4db94011d3 113 *
sahilmgandhi 18:6a4db94011d3 114 * @retval NRF_SUCCESS If the channel was successfully freed.
sahilmgandhi 18:6a4db94011d3 115 * @retval NRF_ERROR_INVALID_PARAM If the channel is not user-configurable.
sahilmgandhi 18:6a4db94011d3 116 */
sahilmgandhi 18:6a4db94011d3 117 uint32_t nrf_drv_ppi_channel_free(nrf_ppi_channel_t channel);
sahilmgandhi 18:6a4db94011d3 118
sahilmgandhi 18:6a4db94011d3 119 /**@brief Function for assigning task and event endpoints to the PPI channel.
sahilmgandhi 18:6a4db94011d3 120 *
sahilmgandhi 18:6a4db94011d3 121 * @param[in] channel PPI channel to be assigned endpoints.
sahilmgandhi 18:6a4db94011d3 122 *
sahilmgandhi 18:6a4db94011d3 123 * @param[in] eep Event endpoint address.
sahilmgandhi 18:6a4db94011d3 124 *
sahilmgandhi 18:6a4db94011d3 125 * @param[in] tep Task endpoint address.
sahilmgandhi 18:6a4db94011d3 126 *
sahilmgandhi 18:6a4db94011d3 127 * @retval NRF_SUCCESS If the channel was successfully assigned.
sahilmgandhi 18:6a4db94011d3 128 * @retval NRF_ERROR_INVALID_STATE If the channel is not allocated for the user.
sahilmgandhi 18:6a4db94011d3 129 * @retval NRF_ERROR_INVALID_PARAM If the channel is not user-configurable.
sahilmgandhi 18:6a4db94011d3 130 */
sahilmgandhi 18:6a4db94011d3 131 uint32_t nrf_drv_ppi_channel_assign(nrf_ppi_channel_t channel, uint32_t eep, uint32_t tep);
sahilmgandhi 18:6a4db94011d3 132
sahilmgandhi 18:6a4db94011d3 133 /**@brief Function for assigning or clearing fork endpoint to the PPI channel.
sahilmgandhi 18:6a4db94011d3 134 *
sahilmgandhi 18:6a4db94011d3 135 * @param[in] channel PPI channel to be assigned endpoints.
sahilmgandhi 18:6a4db94011d3 136 *
sahilmgandhi 18:6a4db94011d3 137 * @param[in] fork_tep Fork task endpoint address or 0 to clear.
sahilmgandhi 18:6a4db94011d3 138 *
sahilmgandhi 18:6a4db94011d3 139 * @retval NRF_SUCCESS If the channel was successfully assigned.
sahilmgandhi 18:6a4db94011d3 140 * @retval NRF_ERROR_INVALID_STATE If the channel is not allocated for the user.
sahilmgandhi 18:6a4db94011d3 141 * @retval NRF_ERROR_INVALID_PARAM If the channel is not user-configurable.
sahilmgandhi 18:6a4db94011d3 142 * @retval NRF_ERROR_NOT_SUPPORTED If function is not supported.
sahilmgandhi 18:6a4db94011d3 143 */
sahilmgandhi 18:6a4db94011d3 144 uint32_t nrf_drv_ppi_channel_fork_assign(nrf_ppi_channel_t channel, uint32_t fork_tep);
sahilmgandhi 18:6a4db94011d3 145
sahilmgandhi 18:6a4db94011d3 146 /**@brief Function for enabling a PPI channel.
sahilmgandhi 18:6a4db94011d3 147 *
sahilmgandhi 18:6a4db94011d3 148 * @param[in] channel PPI channel to be enabled.
sahilmgandhi 18:6a4db94011d3 149 *
sahilmgandhi 18:6a4db94011d3 150 * @retval NRF_SUCCESS If the channel was successfully enabled.
sahilmgandhi 18:6a4db94011d3 151 * @retval NRF_ERROR_INVALID_STATE If the user-configurable channel is not allocated.
sahilmgandhi 18:6a4db94011d3 152 * @retval NRF_ERROR_INVALID_PARAM If the channel cannot be enabled by the user.
sahilmgandhi 18:6a4db94011d3 153 */
sahilmgandhi 18:6a4db94011d3 154 uint32_t nrf_drv_ppi_channel_enable(nrf_ppi_channel_t channel);
sahilmgandhi 18:6a4db94011d3 155
sahilmgandhi 18:6a4db94011d3 156 /**@brief Function for disabling a PPI channel.
sahilmgandhi 18:6a4db94011d3 157 *
sahilmgandhi 18:6a4db94011d3 158 * @param[in] channel PPI channel to be disabled.
sahilmgandhi 18:6a4db94011d3 159 *
sahilmgandhi 18:6a4db94011d3 160 * @retval NRF_SUCCESS If the channel was successfully disabled.
sahilmgandhi 18:6a4db94011d3 161 * @retval NRF_ERROR_INVALID_STATE If the user-configurable channel is not allocated.
sahilmgandhi 18:6a4db94011d3 162 * @retval NRF_ERROR_INVALID_PARAM If the channel cannot be disabled by the user.
sahilmgandhi 18:6a4db94011d3 163 */
sahilmgandhi 18:6a4db94011d3 164 uint32_t nrf_drv_ppi_channel_disable(nrf_ppi_channel_t channel);
sahilmgandhi 18:6a4db94011d3 165
sahilmgandhi 18:6a4db94011d3 166 /**@brief Function for allocating a PPI channel group.
sahilmgandhi 18:6a4db94011d3 167 * @details This function allocates the first unused PPI group.
sahilmgandhi 18:6a4db94011d3 168 *
sahilmgandhi 18:6a4db94011d3 169 * @param[out] p_group Pointer to the PPI channel group that has been allocated.
sahilmgandhi 18:6a4db94011d3 170 *
sahilmgandhi 18:6a4db94011d3 171 * @retval NRF_SUCCESS If the channel group was successfully allocated.
sahilmgandhi 18:6a4db94011d3 172 * @retval NRF_ERROR_NO_MEM If there is no available channel group to be used.
sahilmgandhi 18:6a4db94011d3 173 */
sahilmgandhi 18:6a4db94011d3 174 uint32_t nrf_drv_ppi_group_alloc(nrf_ppi_channel_group_t * p_group);
sahilmgandhi 18:6a4db94011d3 175
sahilmgandhi 18:6a4db94011d3 176 /**@brief Function for freeing a PPI channel group.
sahilmgandhi 18:6a4db94011d3 177 * @details This function also disables the chosen group.
sahilmgandhi 18:6a4db94011d3 178 *
sahilmgandhi 18:6a4db94011d3 179 * @param[in] group PPI channel group to be freed.
sahilmgandhi 18:6a4db94011d3 180 *
sahilmgandhi 18:6a4db94011d3 181 * @retval NRF_SUCCESS If the channel group was successfully freed.
sahilmgandhi 18:6a4db94011d3 182 * @retval NRF_ERROR_INVALID_PARAM If the channel group is not user-configurable.
sahilmgandhi 18:6a4db94011d3 183 */
sahilmgandhi 18:6a4db94011d3 184 uint32_t nrf_drv_ppi_group_free(nrf_ppi_channel_group_t group);
sahilmgandhi 18:6a4db94011d3 185
sahilmgandhi 18:6a4db94011d3 186 /**@brief Compute a channel mask for NRF_PPI registers.
sahilmgandhi 18:6a4db94011d3 187 *
sahilmgandhi 18:6a4db94011d3 188 * @param[in] channel Channel number to transform to a mask.
sahilmgandhi 18:6a4db94011d3 189 *
sahilmgandhi 18:6a4db94011d3 190 * @retval Channel mask.
sahilmgandhi 18:6a4db94011d3 191 */
sahilmgandhi 18:6a4db94011d3 192 __STATIC_INLINE uint32_t nrf_drv_ppi_channel_to_mask(nrf_ppi_channel_t channel)
sahilmgandhi 18:6a4db94011d3 193 {
sahilmgandhi 18:6a4db94011d3 194 return (1uL << (uint32_t) channel);
sahilmgandhi 18:6a4db94011d3 195 }
sahilmgandhi 18:6a4db94011d3 196
sahilmgandhi 18:6a4db94011d3 197 /**@brief Function for including multiple PPI channels in a channel group.
sahilmgandhi 18:6a4db94011d3 198 *
sahilmgandhi 18:6a4db94011d3 199 * @param[in] channel_mask PPI channels to be added.
sahilmgandhi 18:6a4db94011d3 200 * @param[in] group Channel group in which to include the channels.
sahilmgandhi 18:6a4db94011d3 201 *
sahilmgandhi 18:6a4db94011d3 202 * @retval NRF_SUCCESS If the channels was successfully included.
sahilmgandhi 18:6a4db94011d3 203 */
sahilmgandhi 18:6a4db94011d3 204 uint32_t nrf_drv_ppi_channels_include_in_group(uint32_t channel_mask,
sahilmgandhi 18:6a4db94011d3 205 nrf_ppi_channel_group_t group);
sahilmgandhi 18:6a4db94011d3 206
sahilmgandhi 18:6a4db94011d3 207 /**@brief Function for including a PPI channel in a channel group.
sahilmgandhi 18:6a4db94011d3 208 *
sahilmgandhi 18:6a4db94011d3 209 * @param[in] channel PPI channel to be added.
sahilmgandhi 18:6a4db94011d3 210 * @param[in] group Channel group in which to include the channel.
sahilmgandhi 18:6a4db94011d3 211 *
sahilmgandhi 18:6a4db94011d3 212 * @retval NRF_SUCCESS If the channel was successfully included.
sahilmgandhi 18:6a4db94011d3 213 */
sahilmgandhi 18:6a4db94011d3 214 __STATIC_INLINE uint32_t nrf_drv_ppi_channel_include_in_group(nrf_ppi_channel_t channel,
sahilmgandhi 18:6a4db94011d3 215 nrf_ppi_channel_group_t group)
sahilmgandhi 18:6a4db94011d3 216 {
sahilmgandhi 18:6a4db94011d3 217 return nrf_drv_ppi_channels_include_in_group(nrf_drv_ppi_channel_to_mask(channel), group);
sahilmgandhi 18:6a4db94011d3 218 }
sahilmgandhi 18:6a4db94011d3 219
sahilmgandhi 18:6a4db94011d3 220 /**@brief Function for removing multiple PPI channels from a channel group.
sahilmgandhi 18:6a4db94011d3 221 *
sahilmgandhi 18:6a4db94011d3 222 * @param[in] channel_mask PPI channels to be removed.
sahilmgandhi 18:6a4db94011d3 223 * @param[in] group Channel group from which to remove the channels.
sahilmgandhi 18:6a4db94011d3 224 *
sahilmgandhi 18:6a4db94011d3 225 * @retval NRF_SUCCESS If the channel was successfully removed.
sahilmgandhi 18:6a4db94011d3 226 */
sahilmgandhi 18:6a4db94011d3 227 uint32_t nrf_drv_ppi_channels_remove_from_group(uint32_t channel_mask,
sahilmgandhi 18:6a4db94011d3 228 nrf_ppi_channel_group_t group);
sahilmgandhi 18:6a4db94011d3 229
sahilmgandhi 18:6a4db94011d3 230 /**@brief Function for removing a PPI channel from a channel group.
sahilmgandhi 18:6a4db94011d3 231 *
sahilmgandhi 18:6a4db94011d3 232 * @param[in] channel PPI channel to be removed.
sahilmgandhi 18:6a4db94011d3 233 * @param[in] group Channel group from which to remove the channel.
sahilmgandhi 18:6a4db94011d3 234 *
sahilmgandhi 18:6a4db94011d3 235 * @retval NRF_SUCCESS If the channel was successfully removed.
sahilmgandhi 18:6a4db94011d3 236 */
sahilmgandhi 18:6a4db94011d3 237 __STATIC_INLINE uint32_t nrf_drv_ppi_channel_remove_from_group(nrf_ppi_channel_t channel,
sahilmgandhi 18:6a4db94011d3 238 nrf_ppi_channel_group_t group)
sahilmgandhi 18:6a4db94011d3 239 {
sahilmgandhi 18:6a4db94011d3 240 return nrf_drv_ppi_channels_remove_from_group(nrf_drv_ppi_channel_to_mask(channel), group);
sahilmgandhi 18:6a4db94011d3 241 }
sahilmgandhi 18:6a4db94011d3 242
sahilmgandhi 18:6a4db94011d3 243 /**@brief Function for clearing a PPI channel group.
sahilmgandhi 18:6a4db94011d3 244 *
sahilmgandhi 18:6a4db94011d3 245 * @param[in] group Channel group to be cleared.
sahilmgandhi 18:6a4db94011d3 246 *
sahilmgandhi 18:6a4db94011d3 247 * @retval NRF_SUCCESS If the group was successfully cleared.
sahilmgandhi 18:6a4db94011d3 248 */
sahilmgandhi 18:6a4db94011d3 249 __STATIC_INLINE uint32_t nrf_drv_ppi_group_clear(nrf_ppi_channel_group_t group)
sahilmgandhi 18:6a4db94011d3 250 {
sahilmgandhi 18:6a4db94011d3 251 return nrf_drv_ppi_channels_remove_from_group(NRF_PPI_ALL_APP_CHANNELS_MASK, group);
sahilmgandhi 18:6a4db94011d3 252 }
sahilmgandhi 18:6a4db94011d3 253
sahilmgandhi 18:6a4db94011d3 254 /**@brief Function for enabling a PPI channel group.
sahilmgandhi 18:6a4db94011d3 255 *
sahilmgandhi 18:6a4db94011d3 256 * @param[in] group Channel group to be enabled.
sahilmgandhi 18:6a4db94011d3 257 *
sahilmgandhi 18:6a4db94011d3 258 * @retval NRF_SUCCESS If the group was successfully enabled.
sahilmgandhi 18:6a4db94011d3 259 */
sahilmgandhi 18:6a4db94011d3 260 uint32_t nrf_drv_ppi_group_enable(nrf_ppi_channel_group_t group);
sahilmgandhi 18:6a4db94011d3 261
sahilmgandhi 18:6a4db94011d3 262 /**@brief Function for disabling a PPI channel group.
sahilmgandhi 18:6a4db94011d3 263 *
sahilmgandhi 18:6a4db94011d3 264 * @param[in] group Channel group to be disabled.
sahilmgandhi 18:6a4db94011d3 265 *
sahilmgandhi 18:6a4db94011d3 266 * @retval NRF_SUCCESS If the group was successfully disabled.
sahilmgandhi 18:6a4db94011d3 267 */
sahilmgandhi 18:6a4db94011d3 268 uint32_t nrf_drv_ppi_group_disable(nrf_ppi_channel_group_t group);
sahilmgandhi 18:6a4db94011d3 269
sahilmgandhi 18:6a4db94011d3 270 /**
sahilmgandhi 18:6a4db94011d3 271 * @brief Function for getting the address of a PPI task.
sahilmgandhi 18:6a4db94011d3 272 *
sahilmgandhi 18:6a4db94011d3 273 * @param[in] task Task.
sahilmgandhi 18:6a4db94011d3 274 *
sahilmgandhi 18:6a4db94011d3 275 * @retval Task address.
sahilmgandhi 18:6a4db94011d3 276 */
sahilmgandhi 18:6a4db94011d3 277 __STATIC_INLINE uint32_t nrf_drv_ppi_task_addr_get(nrf_ppi_task_t task)
sahilmgandhi 18:6a4db94011d3 278 {
sahilmgandhi 18:6a4db94011d3 279 return (uint32_t) nrf_ppi_task_address_get(task);
sahilmgandhi 18:6a4db94011d3 280 }
sahilmgandhi 18:6a4db94011d3 281
sahilmgandhi 18:6a4db94011d3 282 /**
sahilmgandhi 18:6a4db94011d3 283 * @brief Function for getting the address of a PPI group enable task.
sahilmgandhi 18:6a4db94011d3 284 *
sahilmgandhi 18:6a4db94011d3 285 * @param[in] group PPI channel group
sahilmgandhi 18:6a4db94011d3 286 *
sahilmgandhi 18:6a4db94011d3 287 * @retval Task address.
sahilmgandhi 18:6a4db94011d3 288 */
sahilmgandhi 18:6a4db94011d3 289 __STATIC_INLINE uint32_t nrf_drv_ppi_task_addr_group_enable_get(nrf_ppi_channel_group_t group)
sahilmgandhi 18:6a4db94011d3 290 {
sahilmgandhi 18:6a4db94011d3 291 return (uint32_t) nrf_ppi_task_group_enable_address_get(group);
sahilmgandhi 18:6a4db94011d3 292 }
sahilmgandhi 18:6a4db94011d3 293
sahilmgandhi 18:6a4db94011d3 294 /**
sahilmgandhi 18:6a4db94011d3 295 * @brief Function for getting the address of a PPI group enable task.
sahilmgandhi 18:6a4db94011d3 296 *
sahilmgandhi 18:6a4db94011d3 297 * @param[in] group PPI channel group
sahilmgandhi 18:6a4db94011d3 298 *
sahilmgandhi 18:6a4db94011d3 299 * @retval Task address.
sahilmgandhi 18:6a4db94011d3 300 */
sahilmgandhi 18:6a4db94011d3 301 __STATIC_INLINE uint32_t nrf_drv_ppi_task_addr_group_disable_get(nrf_ppi_channel_group_t group)
sahilmgandhi 18:6a4db94011d3 302 {
sahilmgandhi 18:6a4db94011d3 303 return (uint32_t) nrf_ppi_task_group_disable_address_get(group);
sahilmgandhi 18:6a4db94011d3 304 }
sahilmgandhi 18:6a4db94011d3 305
sahilmgandhi 18:6a4db94011d3 306 /**
sahilmgandhi 18:6a4db94011d3 307 *@}
sahilmgandhi 18:6a4db94011d3 308 **/
sahilmgandhi 18:6a4db94011d3 309
sahilmgandhi 18:6a4db94011d3 310 /*lint --flb "Leave library region" */
sahilmgandhi 18:6a4db94011d3 311 #endif // NRF_DRV_PPI_H