nrf_ppi.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /**
  2. * Copyright (c) 2015 - 2018, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef NRF_PPI_H__
  41. #define NRF_PPI_H__
  42. #include <nrfx.h>
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. /**
  47. * @defgroup nrf_ppi_hal PPI HAL
  48. * @{
  49. * @ingroup nrf_ppi
  50. * @brief Hardware access layer for managing the Programmable Peripheral Interconnect (PPI)
  51. * channels.
  52. */
  53. #define NRF_PPI_TASK_SET (1UL)
  54. /**
  55. * @enum nrf_ppi_channel_t
  56. * @brief PPI channels.
  57. */
  58. typedef enum
  59. {
  60. NRF_PPI_CHANNEL0 = PPI_CHEN_CH0_Pos, /**< Channel 0. */
  61. NRF_PPI_CHANNEL1 = PPI_CHEN_CH1_Pos, /**< Channel 1. */
  62. NRF_PPI_CHANNEL2 = PPI_CHEN_CH2_Pos, /**< Channel 2. */
  63. NRF_PPI_CHANNEL3 = PPI_CHEN_CH3_Pos, /**< Channel 3. */
  64. NRF_PPI_CHANNEL4 = PPI_CHEN_CH4_Pos, /**< Channel 4. */
  65. NRF_PPI_CHANNEL5 = PPI_CHEN_CH5_Pos, /**< Channel 5. */
  66. NRF_PPI_CHANNEL6 = PPI_CHEN_CH6_Pos, /**< Channel 6. */
  67. NRF_PPI_CHANNEL7 = PPI_CHEN_CH7_Pos, /**< Channel 7. */
  68. NRF_PPI_CHANNEL8 = PPI_CHEN_CH8_Pos, /**< Channel 8. */
  69. NRF_PPI_CHANNEL9 = PPI_CHEN_CH9_Pos, /**< Channel 9. */
  70. NRF_PPI_CHANNEL10 = PPI_CHEN_CH10_Pos, /**< Channel 10. */
  71. NRF_PPI_CHANNEL11 = PPI_CHEN_CH11_Pos, /**< Channel 11. */
  72. NRF_PPI_CHANNEL12 = PPI_CHEN_CH12_Pos, /**< Channel 12. */
  73. NRF_PPI_CHANNEL13 = PPI_CHEN_CH13_Pos, /**< Channel 13. */
  74. NRF_PPI_CHANNEL14 = PPI_CHEN_CH14_Pos, /**< Channel 14. */
  75. NRF_PPI_CHANNEL15 = PPI_CHEN_CH15_Pos, /**< Channel 15. */
  76. #if (PPI_CH_NUM > 16) || defined(__NRFX_DOXYGEN__)
  77. NRF_PPI_CHANNEL16 = PPI_CHEN_CH16_Pos, /**< Channel 16. */
  78. NRF_PPI_CHANNEL17 = PPI_CHEN_CH17_Pos, /**< Channel 17. */
  79. NRF_PPI_CHANNEL18 = PPI_CHEN_CH18_Pos, /**< Channel 18. */
  80. NRF_PPI_CHANNEL19 = PPI_CHEN_CH19_Pos, /**< Channel 19. */
  81. #endif
  82. NRF_PPI_CHANNEL20 = PPI_CHEN_CH20_Pos, /**< Channel 20. */
  83. NRF_PPI_CHANNEL21 = PPI_CHEN_CH21_Pos, /**< Channel 21. */
  84. NRF_PPI_CHANNEL22 = PPI_CHEN_CH22_Pos, /**< Channel 22. */
  85. NRF_PPI_CHANNEL23 = PPI_CHEN_CH23_Pos, /**< Channel 23. */
  86. NRF_PPI_CHANNEL24 = PPI_CHEN_CH24_Pos, /**< Channel 24. */
  87. NRF_PPI_CHANNEL25 = PPI_CHEN_CH25_Pos, /**< Channel 25. */
  88. NRF_PPI_CHANNEL26 = PPI_CHEN_CH26_Pos, /**< Channel 26. */
  89. NRF_PPI_CHANNEL27 = PPI_CHEN_CH27_Pos, /**< Channel 27. */
  90. NRF_PPI_CHANNEL28 = PPI_CHEN_CH28_Pos, /**< Channel 28. */
  91. NRF_PPI_CHANNEL29 = PPI_CHEN_CH29_Pos, /**< Channel 29. */
  92. NRF_PPI_CHANNEL30 = PPI_CHEN_CH30_Pos, /**< Channel 30. */
  93. NRF_PPI_CHANNEL31 = PPI_CHEN_CH31_Pos /**< Channel 31. */
  94. } nrf_ppi_channel_t;
  95. /**
  96. * @enum nrf_ppi_channel_group_t
  97. * @brief PPI channel groups.
  98. */
  99. typedef enum
  100. {
  101. NRF_PPI_CHANNEL_GROUP0 = 0, /**< Channel group 0. */
  102. NRF_PPI_CHANNEL_GROUP1 = 1, /**< Channel group 1. */
  103. NRF_PPI_CHANNEL_GROUP2 = 2, /**< Channel group 2. */
  104. NRF_PPI_CHANNEL_GROUP3 = 3, /**< Channel group 3. */
  105. #if (PPI_GROUP_NUM > 4) || defined(__NRFX_DOXYGEN__)
  106. NRF_PPI_CHANNEL_GROUP4 = 4, /**< Channel group 4. */
  107. NRF_PPI_CHANNEL_GROUP5 = 5 /**< Channel group 5. */
  108. #endif
  109. } nrf_ppi_channel_group_t;
  110. /**
  111. * @enum nrf_ppi_channel_include_t
  112. * @brief Definition of which PPI channels belong to a group.
  113. */
  114. typedef enum
  115. {
  116. NRF_PPI_CHANNEL_EXCLUDE = PPI_CHG_CH0_Excluded, /**< Channel excluded from a group. */
  117. NRF_PPI_CHANNEL_INCLUDE = PPI_CHG_CH0_Included /**< Channel included in a group. */
  118. } nrf_ppi_channel_include_t;
  119. /**
  120. * @enum nrf_ppi_channel_enable_t
  121. * @brief Definition if a PPI channel is enabled.
  122. */
  123. typedef enum
  124. {
  125. NRF_PPI_CHANNEL_DISABLED = PPI_CHEN_CH0_Disabled, /**< Channel disabled. */
  126. NRF_PPI_CHANNEL_ENABLED = PPI_CHEN_CH0_Enabled /**< Channel enabled. */
  127. } nrf_ppi_channel_enable_t;
  128. /**
  129. * @enum nrf_ppi_task_t
  130. * @brief PPI tasks.
  131. */
  132. typedef enum
  133. {
  134. /*lint -save -e30 -esym(628,__INTADDR__)*/
  135. NRF_PPI_TASK_CHG0_EN = offsetof(NRF_PPI_Type, TASKS_CHG[0].EN), /**< Task for enabling channel group 0 */
  136. NRF_PPI_TASK_CHG0_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[0].DIS), /**< Task for disabling channel group 0 */
  137. NRF_PPI_TASK_CHG1_EN = offsetof(NRF_PPI_Type, TASKS_CHG[1].EN), /**< Task for enabling channel group 1 */
  138. NRF_PPI_TASK_CHG1_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[1].DIS), /**< Task for disabling channel group 1 */
  139. NRF_PPI_TASK_CHG2_EN = offsetof(NRF_PPI_Type, TASKS_CHG[2].EN), /**< Task for enabling channel group 2 */
  140. NRF_PPI_TASK_CHG2_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[2].DIS), /**< Task for disabling channel group 2 */
  141. NRF_PPI_TASK_CHG3_EN = offsetof(NRF_PPI_Type, TASKS_CHG[3].EN), /**< Task for enabling channel group 3 */
  142. NRF_PPI_TASK_CHG3_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[3].DIS), /**< Task for disabling channel group 3 */
  143. #if (PPI_GROUP_NUM > 4) || defined(__NRFX_DOXYGEN__)
  144. NRF_PPI_TASK_CHG4_EN = offsetof(NRF_PPI_Type, TASKS_CHG[4].EN), /**< Task for enabling channel group 4 */
  145. NRF_PPI_TASK_CHG4_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[4].DIS), /**< Task for disabling channel group 4 */
  146. NRF_PPI_TASK_CHG5_EN = offsetof(NRF_PPI_Type, TASKS_CHG[5].EN), /**< Task for enabling channel group 5 */
  147. NRF_PPI_TASK_CHG5_DIS = offsetof(NRF_PPI_Type, TASKS_CHG[5].DIS) /**< Task for disabling channel group 5 */
  148. #endif
  149. /*lint -restore*/
  150. } nrf_ppi_task_t;
  151. /**
  152. * @brief Function for enabling a given PPI channel.
  153. *
  154. * @details This function enables only one channel.
  155. *
  156. * @param[in] channel Channel to enable.
  157. *
  158. * */
  159. __STATIC_INLINE void nrf_ppi_channel_enable(nrf_ppi_channel_t channel);
  160. /**
  161. * @brief Function for disabling a given PPI channel.
  162. *
  163. * @details This function disables only one channel.
  164. *
  165. * @param[in] channel Channel to disable.
  166. */
  167. __STATIC_INLINE void nrf_ppi_channel_disable(nrf_ppi_channel_t channel);
  168. /**
  169. * @brief Function for checking if a given PPI channel is enabled.
  170. *
  171. * @details This function checks only one channel.
  172. *
  173. * @param[in] channel Channel to check.
  174. *
  175. * @retval NRF_PPI_CHANNEL_ENABLED If the channel is enabled.
  176. * @retval NRF_PPI_CHANNEL_DISABLED If the channel is not enabled.
  177. *
  178. */
  179. __STATIC_INLINE nrf_ppi_channel_enable_t nrf_ppi_channel_enable_get(nrf_ppi_channel_t channel);
  180. /**
  181. * @brief Function for disabling all PPI channels.
  182. */
  183. __STATIC_INLINE void nrf_ppi_channel_disable_all(void);
  184. /**
  185. * @brief Function for enabling multiple PPI channels.
  186. *
  187. * @param[in] mask Channel mask.
  188. */
  189. __STATIC_INLINE void nrf_ppi_channels_enable(uint32_t mask);
  190. /**
  191. * @brief Function for disabling multiple PPI channels.
  192. *
  193. * @param[in] mask Channel mask.
  194. */
  195. __STATIC_INLINE void nrf_ppi_channels_disable(uint32_t mask);
  196. /**
  197. * @brief Function for setting up event and task endpoints for a given PPI channel.
  198. *
  199. * @param[in] eep Event register address.
  200. *
  201. * @param[in] tep Task register address.
  202. *
  203. * @param[in] channel Channel to which the given endpoints are assigned.
  204. */
  205. __STATIC_INLINE void nrf_ppi_channel_endpoint_setup(nrf_ppi_channel_t channel,
  206. uint32_t eep,
  207. uint32_t tep);
  208. #if defined(PPI_FEATURE_FORKS_PRESENT) || defined(__NRFX_DOXYGEN__)
  209. /**
  210. * @brief Function for setting up task endpoint for a given PPI fork.
  211. *
  212. * @param[in] fork_tep Task register address.
  213. *
  214. * @param[in] channel Channel to which the given fork endpoint is assigned.
  215. */
  216. __STATIC_INLINE void nrf_ppi_fork_endpoint_setup(nrf_ppi_channel_t channel,
  217. uint32_t fork_tep);
  218. /**
  219. * @brief Function for setting up event and task endpoints for a given PPI channel and fork.
  220. *
  221. * @param[in] eep Event register address.
  222. *
  223. * @param[in] tep Task register address.
  224. *
  225. * @param[in] fork_tep Fork task register address (register value).
  226. *
  227. * @param[in] channel Channel to which the given endpoints are assigned.
  228. */
  229. __STATIC_INLINE void nrf_ppi_channel_and_fork_endpoint_setup(nrf_ppi_channel_t channel,
  230. uint32_t eep,
  231. uint32_t tep,
  232. uint32_t fork_tep);
  233. #endif
  234. /**
  235. * @brief Function for including a PPI channel in a channel group.
  236. *
  237. * @details This function adds only one channel to the group.
  238. *
  239. * @param[in] channel Channel to be included in the group.
  240. *
  241. * @param[in] channel_group Channel group.
  242. *
  243. */
  244. __STATIC_INLINE void nrf_ppi_channel_include_in_group(nrf_ppi_channel_t channel,
  245. nrf_ppi_channel_group_t channel_group);
  246. /**
  247. * @brief Function for including multiple PPI channels in a channel group.
  248. *
  249. * @details This function adds all specified channels to the group.
  250. *
  251. * @param[in] channel_mask Channels to be included in the group.
  252. *
  253. * @param[in] channel_group Channel group.
  254. *
  255. */
  256. __STATIC_INLINE void nrf_ppi_channels_include_in_group(uint32_t channel_mask,
  257. nrf_ppi_channel_group_t channel_group);
  258. /**
  259. * @brief Function for removing a PPI channel from a channel group.
  260. *
  261. * @details This function removes only one channel from the group.
  262. *
  263. * @param[in] channel Channel to be removed from the group.
  264. *
  265. * @param[in] channel_group Channel group.
  266. */
  267. __STATIC_INLINE void nrf_ppi_channel_remove_from_group(nrf_ppi_channel_t channel,
  268. nrf_ppi_channel_group_t channel_group);
  269. /**
  270. * @brief Function for removing multiple PPI channels from a channel group.
  271. *
  272. * @details This function removes all specified channels from the group.
  273. *
  274. * @param[in] channel_mask Channels to be removed from the group.
  275. *
  276. * @param[in] channel_group Channel group.
  277. */
  278. __STATIC_INLINE void nrf_ppi_channels_remove_from_group(uint32_t channel_mask,
  279. nrf_ppi_channel_group_t channel_group);
  280. /**
  281. * @brief Function for removing all PPI channels from a channel group.
  282. *
  283. * @param[in] group Channel group.
  284. *
  285. */
  286. __STATIC_INLINE void nrf_ppi_channel_group_clear(nrf_ppi_channel_group_t group);
  287. /**
  288. * @brief Function for enabling a channel group.
  289. *
  290. * @param[in] group Channel group.
  291. *
  292. */
  293. __STATIC_INLINE void nrf_ppi_group_enable(nrf_ppi_channel_group_t group);
  294. /**
  295. * @brief Function for disabling a channel group.
  296. *
  297. * @param[in] group Channel group.
  298. *
  299. */
  300. __STATIC_INLINE void nrf_ppi_group_disable(nrf_ppi_channel_group_t group);
  301. /**
  302. * @brief Function for setting a PPI task.
  303. *
  304. * @param[in] ppi_task PPI task to set.
  305. */
  306. __STATIC_INLINE void nrf_ppi_task_trigger(nrf_ppi_task_t ppi_task);
  307. /**
  308. * @brief Function for returning the address of a specific PPI task register.
  309. *
  310. * @param[in] ppi_task PPI task.
  311. */
  312. __STATIC_INLINE uint32_t * nrf_ppi_task_address_get(nrf_ppi_task_t ppi_task);
  313. /**
  314. * @brief Function for returning the PPI enable task address of a specific group.
  315. *
  316. * @param[in] group PPI group.
  317. */
  318. __STATIC_INLINE uint32_t * nrf_ppi_task_group_enable_address_get(nrf_ppi_channel_group_t group);
  319. /**
  320. * @brief Function for returning the PPI disable task address of a specific group.
  321. *
  322. * @param[in] group PPI group.
  323. */
  324. __STATIC_INLINE uint32_t * nrf_ppi_task_group_disable_address_get(nrf_ppi_channel_group_t group);
  325. #ifndef SUPPRESS_INLINE_IMPLEMENTATION
  326. __STATIC_INLINE void nrf_ppi_channel_enable(nrf_ppi_channel_t channel)
  327. {
  328. NRF_PPI->CHENSET = PPI_CHENSET_CH0_Set << ((uint32_t) channel);
  329. }
  330. __STATIC_INLINE void nrf_ppi_channel_disable(nrf_ppi_channel_t channel)
  331. {
  332. NRF_PPI->CHENCLR = PPI_CHENCLR_CH0_Clear << ((uint32_t) channel);
  333. }
  334. __STATIC_INLINE nrf_ppi_channel_enable_t nrf_ppi_channel_enable_get(nrf_ppi_channel_t channel)
  335. {
  336. if (NRF_PPI->CHEN & (PPI_CHEN_CH0_Msk << ((uint32_t) channel)))
  337. {
  338. return NRF_PPI_CHANNEL_ENABLED;
  339. }
  340. else
  341. {
  342. return NRF_PPI_CHANNEL_DISABLED;
  343. }
  344. }
  345. __STATIC_INLINE void nrf_ppi_channel_disable_all(void)
  346. {
  347. NRF_PPI->CHENCLR = ((uint32_t)0xFFFFFFFFuL);
  348. }
  349. __STATIC_INLINE void nrf_ppi_channels_enable(uint32_t mask)
  350. {
  351. NRF_PPI->CHENSET = mask;
  352. }
  353. __STATIC_INLINE void nrf_ppi_channels_disable(uint32_t mask)
  354. {
  355. NRF_PPI->CHENCLR = mask;
  356. }
  357. __STATIC_INLINE void nrf_ppi_channel_endpoint_setup(nrf_ppi_channel_t channel,
  358. uint32_t eep,
  359. uint32_t tep)
  360. {
  361. NRF_PPI->CH[(uint32_t) channel].EEP = eep;
  362. NRF_PPI->CH[(uint32_t) channel].TEP = tep;
  363. }
  364. #if defined(PPI_FEATURE_FORKS_PRESENT)
  365. __STATIC_INLINE void nrf_ppi_fork_endpoint_setup(nrf_ppi_channel_t channel,
  366. uint32_t fork_tep)
  367. {
  368. NRF_PPI->FORK[(uint32_t) channel].TEP = fork_tep;
  369. }
  370. __STATIC_INLINE void nrf_ppi_channel_and_fork_endpoint_setup(nrf_ppi_channel_t channel,
  371. uint32_t eep,
  372. uint32_t tep,
  373. uint32_t fork_tep)
  374. {
  375. nrf_ppi_channel_endpoint_setup(channel, eep, tep);
  376. nrf_ppi_fork_endpoint_setup(channel, fork_tep);
  377. }
  378. #endif
  379. __STATIC_INLINE void nrf_ppi_channel_include_in_group(nrf_ppi_channel_t channel,
  380. nrf_ppi_channel_group_t channel_group)
  381. {
  382. NRF_PPI->CHG[(uint32_t) channel_group] =
  383. NRF_PPI->CHG[(uint32_t) channel_group] | (PPI_CHG_CH0_Included << ((uint32_t) channel));
  384. }
  385. __STATIC_INLINE void nrf_ppi_channels_include_in_group(uint32_t channel_mask,
  386. nrf_ppi_channel_group_t channel_group)
  387. {
  388. NRF_PPI->CHG[(uint32_t) channel_group] =
  389. NRF_PPI->CHG[(uint32_t) channel_group] | (channel_mask);
  390. }
  391. __STATIC_INLINE void nrf_ppi_channel_remove_from_group(nrf_ppi_channel_t channel,
  392. nrf_ppi_channel_group_t channel_group)
  393. {
  394. NRF_PPI->CHG[(uint32_t) channel_group] =
  395. NRF_PPI->CHG[(uint32_t) channel_group] & ~(PPI_CHG_CH0_Included << ((uint32_t) channel));
  396. }
  397. __STATIC_INLINE void nrf_ppi_channels_remove_from_group(uint32_t channel_mask,
  398. nrf_ppi_channel_group_t channel_group)
  399. {
  400. NRF_PPI->CHG[(uint32_t) channel_group] =
  401. NRF_PPI->CHG[(uint32_t) channel_group] & ~(channel_mask);
  402. }
  403. __STATIC_INLINE void nrf_ppi_channel_group_clear(nrf_ppi_channel_group_t group)
  404. {
  405. NRF_PPI->CHG[(uint32_t) group] = 0;
  406. }
  407. __STATIC_INLINE void nrf_ppi_group_enable(nrf_ppi_channel_group_t group)
  408. {
  409. NRF_PPI->TASKS_CHG[(uint32_t) group].EN = NRF_PPI_TASK_SET;
  410. }
  411. __STATIC_INLINE void nrf_ppi_group_disable(nrf_ppi_channel_group_t group)
  412. {
  413. NRF_PPI->TASKS_CHG[(uint32_t) group].DIS = NRF_PPI_TASK_SET;
  414. }
  415. __STATIC_INLINE void nrf_ppi_task_trigger(nrf_ppi_task_t ppi_task)
  416. {
  417. *((volatile uint32_t *) ((uint8_t *) NRF_PPI_BASE + (uint32_t) ppi_task)) = NRF_PPI_TASK_SET;
  418. }
  419. __STATIC_INLINE uint32_t * nrf_ppi_task_address_get(nrf_ppi_task_t ppi_task)
  420. {
  421. return (uint32_t *) ((uint8_t *) NRF_PPI_BASE + (uint32_t) ppi_task);
  422. }
  423. __STATIC_INLINE uint32_t * nrf_ppi_task_group_enable_address_get(nrf_ppi_channel_group_t group)
  424. {
  425. return (uint32_t *) &NRF_PPI->TASKS_CHG[(uint32_t) group].EN;
  426. }
  427. __STATIC_INLINE uint32_t * nrf_ppi_task_group_disable_address_get(nrf_ppi_channel_group_t group)
  428. {
  429. return (uint32_t *) &NRF_PPI->TASKS_CHG[(uint32_t) group].DIS;
  430. }
  431. #endif // SUPPRESS_INLINE_IMPLEMENTATION
  432. /** @} */
  433. #ifdef __cplusplus
  434. }
  435. #endif
  436. #endif // NRF_PPI_H__