nrf51.h 96 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312
  1. /*
  2. * Copyright (c) 2010 - 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. * @file nrf51.h
  40. * @brief CMSIS HeaderFile
  41. * @version 522
  42. * @date 08. February 2019
  43. * @note Generated by SVDConv V3.3.18 on Friday, 08.02.2019 16:48:11
  44. * from File 'nrf51.svd',
  45. * last modified on Friday, 08.02.2019 15:48:07
  46. */
  47. /** @addtogroup Nordic Semiconductor
  48. * @{
  49. */
  50. /** @addtogroup nrf51
  51. * @{
  52. */
  53. #ifndef NRF51_H
  54. #define NRF51_H
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. /** @addtogroup Configuration_of_CMSIS
  59. * @{
  60. */
  61. /* =========================================================================================================================== */
  62. /* ================ Interrupt Number Definition ================ */
  63. /* =========================================================================================================================== */
  64. typedef enum {
  65. /* ======================================= ARM Cortex-M0 Specific Interrupt Numbers ======================================== */
  66. Reset_IRQn = -15, /*!< -15 Reset Vector, invoked on Power up and warm reset */
  67. NonMaskableInt_IRQn = -14, /*!< -14 Non maskable Interrupt, cannot be stopped or preempted */
  68. HardFault_IRQn = -13, /*!< -13 Hard Fault, all classes of Fault */
  69. SVCall_IRQn = -5, /*!< -5 System Service Call via SVC instruction */
  70. PendSV_IRQn = -2, /*!< -2 Pendable request for system service */
  71. SysTick_IRQn = -1, /*!< -1 System Tick Timer */
  72. /* =========================================== nrf51 Specific Interrupt Numbers ============================================ */
  73. POWER_CLOCK_IRQn = 0, /*!< 0 POWER_CLOCK */
  74. RADIO_IRQn = 1, /*!< 1 RADIO */
  75. UART0_IRQn = 2, /*!< 2 UART0 */
  76. SPI0_TWI0_IRQn = 3, /*!< 3 SPI0_TWI0 */
  77. SPI1_TWI1_IRQn = 4, /*!< 4 SPI1_TWI1 */
  78. GPIOTE_IRQn = 6, /*!< 6 GPIOTE */
  79. ADC_IRQn = 7, /*!< 7 ADC */
  80. TIMER0_IRQn = 8, /*!< 8 TIMER0 */
  81. TIMER1_IRQn = 9, /*!< 9 TIMER1 */
  82. TIMER2_IRQn = 10, /*!< 10 TIMER2 */
  83. RTC0_IRQn = 11, /*!< 11 RTC0 */
  84. TEMP_IRQn = 12, /*!< 12 TEMP */
  85. RNG_IRQn = 13, /*!< 13 RNG */
  86. ECB_IRQn = 14, /*!< 14 ECB */
  87. CCM_AAR_IRQn = 15, /*!< 15 CCM_AAR */
  88. WDT_IRQn = 16, /*!< 16 WDT */
  89. RTC1_IRQn = 17, /*!< 17 RTC1 */
  90. QDEC_IRQn = 18, /*!< 18 QDEC */
  91. LPCOMP_IRQn = 19, /*!< 19 LPCOMP */
  92. SWI0_IRQn = 20, /*!< 20 SWI0 */
  93. SWI1_IRQn = 21, /*!< 21 SWI1 */
  94. SWI2_IRQn = 22, /*!< 22 SWI2 */
  95. SWI3_IRQn = 23, /*!< 23 SWI3 */
  96. SWI4_IRQn = 24, /*!< 24 SWI4 */
  97. SWI5_IRQn = 25 /*!< 25 SWI5 */
  98. } IRQn_Type;
  99. /* =========================================================================================================================== */
  100. /* ================ Processor and Core Peripheral Section ================ */
  101. /* =========================================================================================================================== */
  102. /* =========================== Configuration of the ARM Cortex-M0 Processor and Core Peripherals =========================== */
  103. #define __CM0_REV 0x0301U /*!< CM0 Core Revision */
  104. #define __DSP_PRESENT 0 /*!< DSP present or not */
  105. #define __MPU_PRESENT 0 /*!< MPU present or not */
  106. #define __VTOR_PRESENT 0 /*!< Set to 1 if CPU supports Vector Table Offset Register */
  107. #define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
  108. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  109. /** @} */ /* End of group Configuration_of_CMSIS */
  110. #include "core_cm0.h" /*!< ARM Cortex-M0 processor and core peripherals */
  111. #include "system_nrf51.h" /*!< nrf51 System */
  112. #ifndef __IM /*!< Fallback for older CMSIS versions */
  113. #define __IM __I
  114. #endif
  115. #ifndef __OM /*!< Fallback for older CMSIS versions */
  116. #define __OM __O
  117. #endif
  118. #ifndef __IOM /*!< Fallback for older CMSIS versions */
  119. #define __IOM __IO
  120. #endif
  121. /* ======================================== Start of section using anonymous unions ======================================== */
  122. #if defined (__CC_ARM)
  123. #pragma push
  124. #pragma anon_unions
  125. #elif defined (__ICCARM__)
  126. #pragma language=extended
  127. #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
  128. #pragma clang diagnostic push
  129. #pragma clang diagnostic ignored "-Wc11-extensions"
  130. #pragma clang diagnostic ignored "-Wreserved-id-macro"
  131. #pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
  132. #pragma clang diagnostic ignored "-Wnested-anon-types"
  133. #elif defined (__GNUC__)
  134. /* anonymous unions are enabled by default */
  135. #elif defined (__TMS470__)
  136. /* anonymous unions are enabled by default */
  137. #elif defined (__TASKING__)
  138. #pragma warning 586
  139. #elif defined (__CSMC__)
  140. /* anonymous unions are enabled by default */
  141. #else
  142. #warning Not supported compiler type
  143. #endif
  144. /* =========================================================================================================================== */
  145. /* ================ Device Specific Cluster Section ================ */
  146. /* =========================================================================================================================== */
  147. /** @addtogroup Device_Peripheral_clusters
  148. * @{
  149. */
  150. /**
  151. * @brief PPI_TASKS_CHG [TASKS_CHG] (Channel group tasks.)
  152. */
  153. typedef struct {
  154. __OM uint32_t EN; /*!< (@ 0x00000000) Enable channel group. */
  155. __OM uint32_t DIS; /*!< (@ 0x00000004) Disable channel group. */
  156. } PPI_TASKS_CHG_Type; /*!< Size = 8 (0x8) */
  157. /**
  158. * @brief PPI_CH [CH] (PPI Channel.)
  159. */
  160. typedef struct {
  161. __IOM uint32_t EEP; /*!< (@ 0x00000000) Channel event end-point. */
  162. __IOM uint32_t TEP; /*!< (@ 0x00000004) Channel task end-point. */
  163. } PPI_CH_Type; /*!< Size = 8 (0x8) */
  164. /** @} */ /* End of group Device_Peripheral_clusters */
  165. /* =========================================================================================================================== */
  166. /* ================ Device Specific Peripheral Section ================ */
  167. /* =========================================================================================================================== */
  168. /** @addtogroup Device_Peripheral_peripherals
  169. * @{
  170. */
  171. /* =========================================================================================================================== */
  172. /* ================ POWER ================ */
  173. /* =========================================================================================================================== */
  174. /**
  175. * @brief Power Control. (POWER)
  176. */
  177. typedef struct { /*!< (@ 0x40000000) POWER Structure */
  178. __IM uint32_t RESERVED[30];
  179. __OM uint32_t TASKS_CONSTLAT; /*!< (@ 0x00000078) Enable constant latency mode. */
  180. __OM uint32_t TASKS_LOWPWR; /*!< (@ 0x0000007C) Enable low power mode (variable latency). */
  181. __IM uint32_t RESERVED1[34];
  182. __IOM uint32_t EVENTS_POFWARN; /*!< (@ 0x00000108) Power failure warning. */
  183. __IM uint32_t RESERVED2[126];
  184. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  185. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  186. __IM uint32_t RESERVED3[61];
  187. __IOM uint32_t RESETREAS; /*!< (@ 0x00000400) Reset reason. */
  188. __IM uint32_t RESERVED4[9];
  189. __IM uint32_t RAMSTATUS; /*!< (@ 0x00000428) Ram status register. */
  190. __IM uint32_t RESERVED5[53];
  191. __OM uint32_t SYSTEMOFF; /*!< (@ 0x00000500) System off register. */
  192. __IM uint32_t RESERVED6[3];
  193. __IOM uint32_t POFCON; /*!< (@ 0x00000510) Power failure configuration. */
  194. __IM uint32_t RESERVED7[2];
  195. __IOM uint32_t GPREGRET; /*!< (@ 0x0000051C) General purpose retention register. This register
  196. is a retained register. */
  197. __IM uint32_t RESERVED8;
  198. __IOM uint32_t RAMON; /*!< (@ 0x00000524) Ram on/off. */
  199. __IM uint32_t RESERVED9[7];
  200. __IOM uint32_t RESET; /*!< (@ 0x00000544) Pin reset functionality configuration register.
  201. This register is a retained register. */
  202. __IM uint32_t RESERVED10[3];
  203. __IOM uint32_t RAMONB; /*!< (@ 0x00000554) Ram on/off. */
  204. __IM uint32_t RESERVED11[8];
  205. __IOM uint32_t DCDCEN; /*!< (@ 0x00000578) DCDC converter enable configuration register. */
  206. __IM uint32_t RESERVED12[291];
  207. __IOM uint32_t DCDCFORCE; /*!< (@ 0x00000A08) DCDC power-up force register. */
  208. } NRF_POWER_Type; /*!< Size = 2572 (0xa0c) */
  209. /* =========================================================================================================================== */
  210. /* ================ CLOCK ================ */
  211. /* =========================================================================================================================== */
  212. /**
  213. * @brief Clock control. (CLOCK)
  214. */
  215. typedef struct { /*!< (@ 0x40000000) CLOCK Structure */
  216. __OM uint32_t TASKS_HFCLKSTART; /*!< (@ 0x00000000) Start HFCLK clock source. */
  217. __OM uint32_t TASKS_HFCLKSTOP; /*!< (@ 0x00000004) Stop HFCLK clock source. */
  218. __OM uint32_t TASKS_LFCLKSTART; /*!< (@ 0x00000008) Start LFCLK clock source. */
  219. __OM uint32_t TASKS_LFCLKSTOP; /*!< (@ 0x0000000C) Stop LFCLK clock source. */
  220. __OM uint32_t TASKS_CAL; /*!< (@ 0x00000010) Start calibration of LFCLK RC oscillator. */
  221. __OM uint32_t TASKS_CTSTART; /*!< (@ 0x00000014) Start calibration timer. */
  222. __OM uint32_t TASKS_CTSTOP; /*!< (@ 0x00000018) Stop calibration timer. */
  223. __IM uint32_t RESERVED[57];
  224. __IOM uint32_t EVENTS_HFCLKSTARTED; /*!< (@ 0x00000100) HFCLK oscillator started. */
  225. __IOM uint32_t EVENTS_LFCLKSTARTED; /*!< (@ 0x00000104) LFCLK oscillator started. */
  226. __IM uint32_t RESERVED1;
  227. __IOM uint32_t EVENTS_DONE; /*!< (@ 0x0000010C) Calibration of LFCLK RC oscillator completed. */
  228. __IOM uint32_t EVENTS_CTTO; /*!< (@ 0x00000110) Calibration timer timeout. */
  229. __IM uint32_t RESERVED2[124];
  230. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  231. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  232. __IM uint32_t RESERVED3[63];
  233. __IM uint32_t HFCLKRUN; /*!< (@ 0x00000408) Task HFCLKSTART trigger status. */
  234. __IM uint32_t HFCLKSTAT; /*!< (@ 0x0000040C) High frequency clock status. */
  235. __IM uint32_t RESERVED4;
  236. __IM uint32_t LFCLKRUN; /*!< (@ 0x00000414) Task LFCLKSTART triggered status. */
  237. __IM uint32_t LFCLKSTAT; /*!< (@ 0x00000418) Low frequency clock status. */
  238. __IM uint32_t LFCLKSRCCOPY; /*!< (@ 0x0000041C) Clock source for the LFCLK clock, set when task
  239. LKCLKSTART is triggered. */
  240. __IM uint32_t RESERVED5[62];
  241. __IOM uint32_t LFCLKSRC; /*!< (@ 0x00000518) Clock source for the LFCLK clock. */
  242. __IM uint32_t RESERVED6[7];
  243. __IOM uint32_t CTIV; /*!< (@ 0x00000538) Calibration timer interval. */
  244. __IM uint32_t RESERVED7[5];
  245. __IOM uint32_t XTALFREQ; /*!< (@ 0x00000550) Crystal frequency. */
  246. } NRF_CLOCK_Type; /*!< Size = 1364 (0x554) */
  247. /* =========================================================================================================================== */
  248. /* ================ MPU ================ */
  249. /* =========================================================================================================================== */
  250. /**
  251. * @brief Memory Protection Unit. (MPU)
  252. */
  253. typedef struct { /*!< (@ 0x40000000) MPU Structure */
  254. __IM uint32_t RESERVED[330];
  255. __IOM uint32_t PERR0; /*!< (@ 0x00000528) Configuration of peripherals in mpu regions. */
  256. __IOM uint32_t RLENR0; /*!< (@ 0x0000052C) Length of RAM region 0. */
  257. __IM uint32_t RESERVED1[52];
  258. __IOM uint32_t PROTENSET0; /*!< (@ 0x00000600) Erase and write protection bit enable set register. */
  259. __IOM uint32_t PROTENSET1; /*!< (@ 0x00000604) Erase and write protection bit enable set register. */
  260. __IOM uint32_t DISABLEINDEBUG; /*!< (@ 0x00000608) Disable erase and write protection mechanism
  261. in debug mode. */
  262. __IOM uint32_t PROTBLOCKSIZE; /*!< (@ 0x0000060C) Erase and write protection block size. */
  263. } NRF_MPU_Type; /*!< Size = 1552 (0x610) */
  264. /* =========================================================================================================================== */
  265. /* ================ RADIO ================ */
  266. /* =========================================================================================================================== */
  267. /**
  268. * @brief The radio. (RADIO)
  269. */
  270. typedef struct { /*!< (@ 0x40001000) RADIO Structure */
  271. __OM uint32_t TASKS_TXEN; /*!< (@ 0x00000000) Enable radio in TX mode. */
  272. __OM uint32_t TASKS_RXEN; /*!< (@ 0x00000004) Enable radio in RX mode. */
  273. __OM uint32_t TASKS_START; /*!< (@ 0x00000008) Start radio. */
  274. __OM uint32_t TASKS_STOP; /*!< (@ 0x0000000C) Stop radio. */
  275. __OM uint32_t TASKS_DISABLE; /*!< (@ 0x00000010) Disable radio. */
  276. __OM uint32_t TASKS_RSSISTART; /*!< (@ 0x00000014) Start the RSSI and take one sample of the receive
  277. signal strength. */
  278. __OM uint32_t TASKS_RSSISTOP; /*!< (@ 0x00000018) Stop the RSSI measurement. */
  279. __OM uint32_t TASKS_BCSTART; /*!< (@ 0x0000001C) Start the bit counter. */
  280. __OM uint32_t TASKS_BCSTOP; /*!< (@ 0x00000020) Stop the bit counter. */
  281. __IM uint32_t RESERVED[55];
  282. __IOM uint32_t EVENTS_READY; /*!< (@ 0x00000100) Ready event. */
  283. __IOM uint32_t EVENTS_ADDRESS; /*!< (@ 0x00000104) Address event. */
  284. __IOM uint32_t EVENTS_PAYLOAD; /*!< (@ 0x00000108) Payload event. */
  285. __IOM uint32_t EVENTS_END; /*!< (@ 0x0000010C) End event. */
  286. __IOM uint32_t EVENTS_DISABLED; /*!< (@ 0x00000110) Disable event. */
  287. __IOM uint32_t EVENTS_DEVMATCH; /*!< (@ 0x00000114) A device address match occurred on the last received
  288. packet. */
  289. __IOM uint32_t EVENTS_DEVMISS; /*!< (@ 0x00000118) No device address match occurred on the last
  290. received packet. */
  291. __IOM uint32_t EVENTS_RSSIEND; /*!< (@ 0x0000011C) Sampling of the receive signal strength complete.
  292. A new RSSI sample is ready for readout at
  293. the RSSISAMPLE register. */
  294. __IM uint32_t RESERVED1[2];
  295. __IOM uint32_t EVENTS_BCMATCH; /*!< (@ 0x00000128) Bit counter reached bit count value specified
  296. in BCC register. */
  297. __IM uint32_t RESERVED2[53];
  298. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for the radio. */
  299. __IM uint32_t RESERVED3[64];
  300. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  301. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  302. __IM uint32_t RESERVED4[61];
  303. __IM uint32_t CRCSTATUS; /*!< (@ 0x00000400) CRC status of received packet. */
  304. __IM uint32_t RESERVED5;
  305. __IM uint32_t RXMATCH; /*!< (@ 0x00000408) Received address. */
  306. __IM uint32_t RXCRC; /*!< (@ 0x0000040C) Received CRC. */
  307. __IM uint32_t DAI; /*!< (@ 0x00000410) Device address match index. */
  308. __IM uint32_t RESERVED6[60];
  309. __IOM uint32_t PACKETPTR; /*!< (@ 0x00000504) Packet pointer. Decision point: START task. */
  310. __IOM uint32_t FREQUENCY; /*!< (@ 0x00000508) Frequency. */
  311. __IOM uint32_t TXPOWER; /*!< (@ 0x0000050C) Output power. */
  312. __IOM uint32_t MODE; /*!< (@ 0x00000510) Data rate and modulation. */
  313. __IOM uint32_t PCNF0; /*!< (@ 0x00000514) Packet configuration 0. */
  314. __IOM uint32_t PCNF1; /*!< (@ 0x00000518) Packet configuration 1. */
  315. __IOM uint32_t BASE0; /*!< (@ 0x0000051C) Radio base address 0. Decision point: START task. */
  316. __IOM uint32_t BASE1; /*!< (@ 0x00000520) Radio base address 1. Decision point: START task. */
  317. __IOM uint32_t PREFIX0; /*!< (@ 0x00000524) Prefixes bytes for logical addresses 0 to 3. */
  318. __IOM uint32_t PREFIX1; /*!< (@ 0x00000528) Prefixes bytes for logical addresses 4 to 7. */
  319. __IOM uint32_t TXADDRESS; /*!< (@ 0x0000052C) Transmit address select. */
  320. __IOM uint32_t RXADDRESSES; /*!< (@ 0x00000530) Receive address select. */
  321. __IOM uint32_t CRCCNF; /*!< (@ 0x00000534) CRC configuration. */
  322. __IOM uint32_t CRCPOLY; /*!< (@ 0x00000538) CRC polynomial. */
  323. __IOM uint32_t CRCINIT; /*!< (@ 0x0000053C) CRC initial value. */
  324. __IOM uint32_t TEST; /*!< (@ 0x00000540) Test features enable register. */
  325. __IOM uint32_t TIFS; /*!< (@ 0x00000544) Inter Frame Spacing in microseconds. */
  326. __IM uint32_t RSSISAMPLE; /*!< (@ 0x00000548) RSSI sample. */
  327. __IM uint32_t RESERVED7;
  328. __IM uint32_t STATE; /*!< (@ 0x00000550) Current radio state. */
  329. __IOM uint32_t DATAWHITEIV; /*!< (@ 0x00000554) Data whitening initial value. */
  330. __IM uint32_t RESERVED8[2];
  331. __IOM uint32_t BCC; /*!< (@ 0x00000560) Bit counter compare. */
  332. __IM uint32_t RESERVED9[39];
  333. __IOM uint32_t DAB[8]; /*!< (@ 0x00000600) Device address base segment. */
  334. __IOM uint32_t DAP[8]; /*!< (@ 0x00000620) Device address prefix. */
  335. __IOM uint32_t DACNF; /*!< (@ 0x00000640) Device address match configuration. */
  336. __IM uint32_t RESERVED10[56];
  337. __IOM uint32_t OVERRIDE0; /*!< (@ 0x00000724) Trim value override register 0. */
  338. __IOM uint32_t OVERRIDE1; /*!< (@ 0x00000728) Trim value override register 1. */
  339. __IOM uint32_t OVERRIDE2; /*!< (@ 0x0000072C) Trim value override register 2. */
  340. __IOM uint32_t OVERRIDE3; /*!< (@ 0x00000730) Trim value override register 3. */
  341. __IOM uint32_t OVERRIDE4; /*!< (@ 0x00000734) Trim value override register 4. */
  342. __IM uint32_t RESERVED11[561];
  343. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  344. } NRF_RADIO_Type; /*!< Size = 4096 (0x1000) */
  345. /* =========================================================================================================================== */
  346. /* ================ UART0 ================ */
  347. /* =========================================================================================================================== */
  348. /**
  349. * @brief Universal Asynchronous Receiver/Transmitter. (UART0)
  350. */
  351. typedef struct { /*!< (@ 0x40002000) UART0 Structure */
  352. __OM uint32_t TASKS_STARTRX; /*!< (@ 0x00000000) Start UART receiver. */
  353. __OM uint32_t TASKS_STOPRX; /*!< (@ 0x00000004) Stop UART receiver. */
  354. __OM uint32_t TASKS_STARTTX; /*!< (@ 0x00000008) Start UART transmitter. */
  355. __OM uint32_t TASKS_STOPTX; /*!< (@ 0x0000000C) Stop UART transmitter. */
  356. __IM uint32_t RESERVED[3];
  357. __OM uint32_t TASKS_SUSPEND; /*!< (@ 0x0000001C) Suspend UART. */
  358. __IM uint32_t RESERVED1[56];
  359. __IOM uint32_t EVENTS_CTS; /*!< (@ 0x00000100) CTS activated. */
  360. __IOM uint32_t EVENTS_NCTS; /*!< (@ 0x00000104) CTS deactivated. */
  361. __IOM uint32_t EVENTS_RXDRDY; /*!< (@ 0x00000108) Data received in RXD. */
  362. __IM uint32_t RESERVED2[4];
  363. __IOM uint32_t EVENTS_TXDRDY; /*!< (@ 0x0000011C) Data sent from TXD. */
  364. __IM uint32_t RESERVED3;
  365. __IOM uint32_t EVENTS_ERROR; /*!< (@ 0x00000124) Error detected. */
  366. __IM uint32_t RESERVED4[7];
  367. __IOM uint32_t EVENTS_RXTO; /*!< (@ 0x00000144) Receiver timeout. */
  368. __IM uint32_t RESERVED5[46];
  369. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for UART. */
  370. __IM uint32_t RESERVED6[64];
  371. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  372. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  373. __IM uint32_t RESERVED7[93];
  374. __IOM uint32_t ERRORSRC; /*!< (@ 0x00000480) Error source. Write error field to 1 to clear
  375. error. */
  376. __IM uint32_t RESERVED8[31];
  377. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable UART and acquire IOs. */
  378. __IM uint32_t RESERVED9;
  379. __IOM uint32_t PSELRTS; /*!< (@ 0x00000508) Pin select for RTS. */
  380. __IOM uint32_t PSELTXD; /*!< (@ 0x0000050C) Pin select for TXD. */
  381. __IOM uint32_t PSELCTS; /*!< (@ 0x00000510) Pin select for CTS. */
  382. __IOM uint32_t PSELRXD; /*!< (@ 0x00000514) Pin select for RXD. */
  383. __IM uint32_t RXD; /*!< (@ 0x00000518) RXD register. On read action the buffer pointer
  384. is displaced. Once read the character is
  385. consumed. If read when no character available,
  386. the UART will stop working. */
  387. __OM uint32_t TXD; /*!< (@ 0x0000051C) TXD register. */
  388. __IM uint32_t RESERVED10;
  389. __IOM uint32_t BAUDRATE; /*!< (@ 0x00000524) UART Baudrate. */
  390. __IM uint32_t RESERVED11[17];
  391. __IOM uint32_t CONFIG; /*!< (@ 0x0000056C) Configuration of parity and hardware flow control
  392. register. */
  393. __IM uint32_t RESERVED12[675];
  394. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  395. } NRF_UART_Type; /*!< Size = 4096 (0x1000) */
  396. /* =========================================================================================================================== */
  397. /* ================ SPI0 ================ */
  398. /* =========================================================================================================================== */
  399. /**
  400. * @brief SPI master 0. (SPI0)
  401. */
  402. typedef struct { /*!< (@ 0x40003000) SPI0 Structure */
  403. __IM uint32_t RESERVED[66];
  404. __IOM uint32_t EVENTS_READY; /*!< (@ 0x00000108) TXD byte sent and RXD byte received. */
  405. __IM uint32_t RESERVED1[126];
  406. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  407. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  408. __IM uint32_t RESERVED2[125];
  409. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable SPI. */
  410. __IM uint32_t RESERVED3;
  411. __IOM uint32_t PSELSCK; /*!< (@ 0x00000508) Pin select for SCK. */
  412. __IOM uint32_t PSELMOSI; /*!< (@ 0x0000050C) Pin select for MOSI. */
  413. __IOM uint32_t PSELMISO; /*!< (@ 0x00000510) Pin select for MISO. */
  414. __IM uint32_t RESERVED4;
  415. __IM uint32_t RXD; /*!< (@ 0x00000518) RX data. */
  416. __IOM uint32_t TXD; /*!< (@ 0x0000051C) TX data. */
  417. __IM uint32_t RESERVED5;
  418. __IOM uint32_t FREQUENCY; /*!< (@ 0x00000524) SPI frequency */
  419. __IM uint32_t RESERVED6[11];
  420. __IOM uint32_t CONFIG; /*!< (@ 0x00000554) Configuration register. */
  421. __IM uint32_t RESERVED7[681];
  422. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  423. } NRF_SPI_Type; /*!< Size = 4096 (0x1000) */
  424. /* =========================================================================================================================== */
  425. /* ================ TWI0 ================ */
  426. /* =========================================================================================================================== */
  427. /**
  428. * @brief Two-wire interface master 0. (TWI0)
  429. */
  430. typedef struct { /*!< (@ 0x40003000) TWI0 Structure */
  431. __OM uint32_t TASKS_STARTRX; /*!< (@ 0x00000000) Start 2-Wire master receive sequence. */
  432. __IM uint32_t RESERVED;
  433. __OM uint32_t TASKS_STARTTX; /*!< (@ 0x00000008) Start 2-Wire master transmit sequence. */
  434. __IM uint32_t RESERVED1[2];
  435. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000014) Stop 2-Wire transaction. */
  436. __IM uint32_t RESERVED2;
  437. __OM uint32_t TASKS_SUSPEND; /*!< (@ 0x0000001C) Suspend 2-Wire transaction. */
  438. __OM uint32_t TASKS_RESUME; /*!< (@ 0x00000020) Resume 2-Wire transaction. */
  439. __IM uint32_t RESERVED3[56];
  440. __IOM uint32_t EVENTS_STOPPED; /*!< (@ 0x00000104) Two-wire stopped. */
  441. __IOM uint32_t EVENTS_RXDREADY; /*!< (@ 0x00000108) Two-wire ready to deliver new RXD byte received. */
  442. __IM uint32_t RESERVED4[4];
  443. __IOM uint32_t EVENTS_TXDSENT; /*!< (@ 0x0000011C) Two-wire finished sending last TXD byte. */
  444. __IM uint32_t RESERVED5;
  445. __IOM uint32_t EVENTS_ERROR; /*!< (@ 0x00000124) Two-wire error detected. */
  446. __IM uint32_t RESERVED6[4];
  447. __IOM uint32_t EVENTS_BB; /*!< (@ 0x00000138) Two-wire byte boundary. */
  448. __IM uint32_t RESERVED7[3];
  449. __IOM uint32_t EVENTS_SUSPENDED; /*!< (@ 0x00000148) Two-wire suspended. */
  450. __IM uint32_t RESERVED8[45];
  451. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for TWI. */
  452. __IM uint32_t RESERVED9[64];
  453. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  454. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  455. __IM uint32_t RESERVED10[110];
  456. __IOM uint32_t ERRORSRC; /*!< (@ 0x000004C4) Two-wire error source. Write error field to 1
  457. to clear error. */
  458. __IM uint32_t RESERVED11[14];
  459. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable two-wire master. */
  460. __IM uint32_t RESERVED12;
  461. __IOM uint32_t PSELSCL; /*!< (@ 0x00000508) Pin select for SCL. */
  462. __IOM uint32_t PSELSDA; /*!< (@ 0x0000050C) Pin select for SDA. */
  463. __IM uint32_t RESERVED13[2];
  464. __IM uint32_t RXD; /*!< (@ 0x00000518) RX data register. */
  465. __IOM uint32_t TXD; /*!< (@ 0x0000051C) TX data register. */
  466. __IM uint32_t RESERVED14;
  467. __IOM uint32_t FREQUENCY; /*!< (@ 0x00000524) Two-wire frequency. */
  468. __IM uint32_t RESERVED15[24];
  469. __IOM uint32_t ADDRESS; /*!< (@ 0x00000588) Address used in the two-wire transfer. */
  470. __IM uint32_t RESERVED16[668];
  471. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  472. } NRF_TWI_Type; /*!< Size = 4096 (0x1000) */
  473. /* =========================================================================================================================== */
  474. /* ================ SPIS1 ================ */
  475. /* =========================================================================================================================== */
  476. /**
  477. * @brief SPI slave 1. (SPIS1)
  478. */
  479. typedef struct { /*!< (@ 0x40004000) SPIS1 Structure */
  480. __IM uint32_t RESERVED[9];
  481. __OM uint32_t TASKS_ACQUIRE; /*!< (@ 0x00000024) Acquire SPI semaphore. */
  482. __OM uint32_t TASKS_RELEASE; /*!< (@ 0x00000028) Release SPI semaphore. */
  483. __IM uint32_t RESERVED1[54];
  484. __IOM uint32_t EVENTS_END; /*!< (@ 0x00000104) Granted transaction completed. */
  485. __IM uint32_t RESERVED2[2];
  486. __IOM uint32_t EVENTS_ENDRX; /*!< (@ 0x00000110) End of RXD buffer reached */
  487. __IM uint32_t RESERVED3[5];
  488. __IOM uint32_t EVENTS_ACQUIRED; /*!< (@ 0x00000128) Semaphore acquired. */
  489. __IM uint32_t RESERVED4[53];
  490. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for SPIS. */
  491. __IM uint32_t RESERVED5[64];
  492. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  493. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  494. __IM uint32_t RESERVED6[61];
  495. __IM uint32_t SEMSTAT; /*!< (@ 0x00000400) Semaphore status. */
  496. __IM uint32_t RESERVED7[15];
  497. __IOM uint32_t STATUS; /*!< (@ 0x00000440) Status from last transaction. */
  498. __IM uint32_t RESERVED8[47];
  499. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable SPIS. */
  500. __IM uint32_t RESERVED9;
  501. __IOM uint32_t PSELSCK; /*!< (@ 0x00000508) Pin select for SCK. */
  502. __IOM uint32_t PSELMISO; /*!< (@ 0x0000050C) Pin select for MISO. */
  503. __IOM uint32_t PSELMOSI; /*!< (@ 0x00000510) Pin select for MOSI. */
  504. __IOM uint32_t PSELCSN; /*!< (@ 0x00000514) Pin select for CSN. */
  505. __IM uint32_t RESERVED10[7];
  506. __IOM uint32_t RXDPTR; /*!< (@ 0x00000534) RX data pointer. */
  507. __IOM uint32_t MAXRX; /*!< (@ 0x00000538) Maximum number of bytes in the receive buffer. */
  508. __IM uint32_t AMOUNTRX; /*!< (@ 0x0000053C) Number of bytes received in last granted transaction. */
  509. __IM uint32_t RESERVED11;
  510. __IOM uint32_t TXDPTR; /*!< (@ 0x00000544) TX data pointer. */
  511. __IOM uint32_t MAXTX; /*!< (@ 0x00000548) Maximum number of bytes in the transmit buffer. */
  512. __IM uint32_t AMOUNTTX; /*!< (@ 0x0000054C) Number of bytes transmitted in last granted transaction. */
  513. __IM uint32_t RESERVED12;
  514. __IOM uint32_t CONFIG; /*!< (@ 0x00000554) Configuration register. */
  515. __IM uint32_t RESERVED13;
  516. __IOM uint32_t DEF; /*!< (@ 0x0000055C) Default character. */
  517. __IM uint32_t RESERVED14[24];
  518. __IOM uint32_t ORC; /*!< (@ 0x000005C0) Over-read character. */
  519. __IM uint32_t RESERVED15[654];
  520. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  521. } NRF_SPIS_Type; /*!< Size = 4096 (0x1000) */
  522. /* =========================================================================================================================== */
  523. /* ================ GPIOTE ================ */
  524. /* =========================================================================================================================== */
  525. /**
  526. * @brief GPIO tasks and events. (GPIOTE)
  527. */
  528. typedef struct { /*!< (@ 0x40006000) GPIOTE Structure */
  529. __OM uint32_t TASKS_OUT[4]; /*!< (@ 0x00000000) Tasks asssociated with GPIOTE channels. */
  530. __IM uint32_t RESERVED[60];
  531. __IOM uint32_t EVENTS_IN[4]; /*!< (@ 0x00000100) Tasks asssociated with GPIOTE channels. */
  532. __IM uint32_t RESERVED1[27];
  533. __IOM uint32_t EVENTS_PORT; /*!< (@ 0x0000017C) Event generated from multiple pins. */
  534. __IM uint32_t RESERVED2[97];
  535. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  536. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  537. __IM uint32_t RESERVED3[129];
  538. __IOM uint32_t CONFIG[4]; /*!< (@ 0x00000510) Channel configuration registers. */
  539. __IM uint32_t RESERVED4[695];
  540. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  541. } NRF_GPIOTE_Type; /*!< Size = 4096 (0x1000) */
  542. /* =========================================================================================================================== */
  543. /* ================ ADC ================ */
  544. /* =========================================================================================================================== */
  545. /**
  546. * @brief Analog to digital converter. (ADC)
  547. */
  548. typedef struct { /*!< (@ 0x40007000) ADC Structure */
  549. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start an ADC conversion. */
  550. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop ADC. */
  551. __IM uint32_t RESERVED[62];
  552. __IOM uint32_t EVENTS_END; /*!< (@ 0x00000100) ADC conversion complete. */
  553. __IM uint32_t RESERVED1[128];
  554. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  555. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  556. __IM uint32_t RESERVED2[61];
  557. __IM uint32_t BUSY; /*!< (@ 0x00000400) ADC busy register. */
  558. __IM uint32_t RESERVED3[63];
  559. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) ADC enable. */
  560. __IOM uint32_t CONFIG; /*!< (@ 0x00000504) ADC configuration register. */
  561. __IM uint32_t RESULT; /*!< (@ 0x00000508) Result of ADC conversion. */
  562. __IM uint32_t RESERVED4[700];
  563. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  564. } NRF_ADC_Type; /*!< Size = 4096 (0x1000) */
  565. /* =========================================================================================================================== */
  566. /* ================ TIMER0 ================ */
  567. /* =========================================================================================================================== */
  568. /**
  569. * @brief Timer 0. (TIMER0)
  570. */
  571. typedef struct { /*!< (@ 0x40008000) TIMER0 Structure */
  572. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start Timer. */
  573. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop Timer. */
  574. __OM uint32_t TASKS_COUNT; /*!< (@ 0x00000008) Increment Timer (In counter mode). */
  575. __OM uint32_t TASKS_CLEAR; /*!< (@ 0x0000000C) Clear timer. */
  576. __OM uint32_t TASKS_SHUTDOWN; /*!< (@ 0x00000010) Shutdown timer. */
  577. __IM uint32_t RESERVED[11];
  578. __OM uint32_t TASKS_CAPTURE[4]; /*!< (@ 0x00000040) Capture Timer value to CC[n] registers. */
  579. __IM uint32_t RESERVED1[60];
  580. __IOM uint32_t EVENTS_COMPARE[4]; /*!< (@ 0x00000140) Compare event on CC[n] match. */
  581. __IM uint32_t RESERVED2[44];
  582. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for Timer. */
  583. __IM uint32_t RESERVED3[64];
  584. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  585. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  586. __IM uint32_t RESERVED4[126];
  587. __IOM uint32_t MODE; /*!< (@ 0x00000504) Timer Mode selection. */
  588. __IOM uint32_t BITMODE; /*!< (@ 0x00000508) Sets timer behaviour. */
  589. __IM uint32_t RESERVED5;
  590. __IOM uint32_t PRESCALER; /*!< (@ 0x00000510) 4-bit prescaler to source clock frequency (max
  591. value 9). Source clock frequency is divided
  592. by 2^SCALE. */
  593. __IM uint32_t RESERVED6[11];
  594. __IOM uint32_t CC[4]; /*!< (@ 0x00000540) Capture/compare registers. */
  595. __IM uint32_t RESERVED7[683];
  596. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  597. } NRF_TIMER_Type; /*!< Size = 4096 (0x1000) */
  598. /* =========================================================================================================================== */
  599. /* ================ RTC0 ================ */
  600. /* =========================================================================================================================== */
  601. /**
  602. * @brief Real time counter 0. (RTC0)
  603. */
  604. typedef struct { /*!< (@ 0x4000B000) RTC0 Structure */
  605. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start RTC Counter. */
  606. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop RTC Counter. */
  607. __OM uint32_t TASKS_CLEAR; /*!< (@ 0x00000008) Clear RTC Counter. */
  608. __OM uint32_t TASKS_TRIGOVRFLW; /*!< (@ 0x0000000C) Set COUNTER to 0xFFFFFFF0. */
  609. __IM uint32_t RESERVED[60];
  610. __IOM uint32_t EVENTS_TICK; /*!< (@ 0x00000100) Event on COUNTER increment. */
  611. __IOM uint32_t EVENTS_OVRFLW; /*!< (@ 0x00000104) Event on COUNTER overflow. */
  612. __IM uint32_t RESERVED1[14];
  613. __IOM uint32_t EVENTS_COMPARE[4]; /*!< (@ 0x00000140) Compare event on CC[n] match. */
  614. __IM uint32_t RESERVED2[109];
  615. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  616. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  617. __IM uint32_t RESERVED3[13];
  618. __IOM uint32_t EVTEN; /*!< (@ 0x00000340) Configures event enable routing to PPI for each
  619. RTC event. */
  620. __IOM uint32_t EVTENSET; /*!< (@ 0x00000344) Enable events routing to PPI. The reading of
  621. this register gives the value of EVTEN. */
  622. __IOM uint32_t EVTENCLR; /*!< (@ 0x00000348) Disable events routing to PPI. The reading of
  623. this register gives the value of EVTEN. */
  624. __IM uint32_t RESERVED4[110];
  625. __IM uint32_t COUNTER; /*!< (@ 0x00000504) Current COUNTER value. */
  626. __IOM uint32_t PRESCALER; /*!< (@ 0x00000508) 12-bit prescaler for COUNTER frequency (32768/(PRESCALER+1)).
  627. Must be written when RTC is STOPed. */
  628. __IM uint32_t RESERVED5[13];
  629. __IOM uint32_t CC[4]; /*!< (@ 0x00000540) Capture/compare registers. */
  630. __IM uint32_t RESERVED6[683];
  631. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  632. } NRF_RTC_Type; /*!< Size = 4096 (0x1000) */
  633. /* =========================================================================================================================== */
  634. /* ================ TEMP ================ */
  635. /* =========================================================================================================================== */
  636. /**
  637. * @brief Temperature Sensor. (TEMP)
  638. */
  639. typedef struct { /*!< (@ 0x4000C000) TEMP Structure */
  640. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start temperature measurement. */
  641. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop temperature measurement. */
  642. __IM uint32_t RESERVED[62];
  643. __IOM uint32_t EVENTS_DATARDY; /*!< (@ 0x00000100) Temperature measurement complete, data ready
  644. event. */
  645. __IM uint32_t RESERVED1[128];
  646. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  647. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  648. __IM uint32_t RESERVED2[127];
  649. __IM int32_t TEMP; /*!< (@ 0x00000508) Die temperature in degC, 2's complement format,
  650. 0.25 degC pecision. */
  651. __IM uint32_t RESERVED3[700];
  652. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  653. } NRF_TEMP_Type; /*!< Size = 4096 (0x1000) */
  654. /* =========================================================================================================================== */
  655. /* ================ RNG ================ */
  656. /* =========================================================================================================================== */
  657. /**
  658. * @brief Random Number Generator. (RNG)
  659. */
  660. typedef struct { /*!< (@ 0x4000D000) RNG Structure */
  661. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start the random number generator. */
  662. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop the random number generator. */
  663. __IM uint32_t RESERVED[62];
  664. __IOM uint32_t EVENTS_VALRDY; /*!< (@ 0x00000100) New random number generated and written to VALUE
  665. register. */
  666. __IM uint32_t RESERVED1[63];
  667. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for the RNG. */
  668. __IM uint32_t RESERVED2[64];
  669. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register */
  670. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register */
  671. __IM uint32_t RESERVED3[126];
  672. __IOM uint32_t CONFIG; /*!< (@ 0x00000504) Configuration register. */
  673. __IM uint32_t VALUE; /*!< (@ 0x00000508) RNG random number. */
  674. __IM uint32_t RESERVED4[700];
  675. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  676. } NRF_RNG_Type; /*!< Size = 4096 (0x1000) */
  677. /* =========================================================================================================================== */
  678. /* ================ ECB ================ */
  679. /* =========================================================================================================================== */
  680. /**
  681. * @brief AES ECB Mode Encryption. (ECB)
  682. */
  683. typedef struct { /*!< (@ 0x4000E000) ECB Structure */
  684. __OM uint32_t TASKS_STARTECB; /*!< (@ 0x00000000) Start ECB block encrypt. If a crypto operation
  685. is running, this will not initiate a new
  686. encryption and the ERRORECB event will be
  687. triggered. */
  688. __OM uint32_t TASKS_STOPECB; /*!< (@ 0x00000004) Stop current ECB encryption. If a crypto operation
  689. is running, this will will trigger the ERRORECB
  690. event. */
  691. __IM uint32_t RESERVED[62];
  692. __IOM uint32_t EVENTS_ENDECB; /*!< (@ 0x00000100) ECB block encrypt complete. */
  693. __IOM uint32_t EVENTS_ERRORECB; /*!< (@ 0x00000104) ECB block encrypt aborted due to a STOPECB task
  694. or due to an error. */
  695. __IM uint32_t RESERVED1[127];
  696. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  697. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  698. __IM uint32_t RESERVED2[126];
  699. __IOM uint32_t ECBDATAPTR; /*!< (@ 0x00000504) ECB block encrypt memory pointer. */
  700. __IM uint32_t RESERVED3[701];
  701. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  702. } NRF_ECB_Type; /*!< Size = 4096 (0x1000) */
  703. /* =========================================================================================================================== */
  704. /* ================ AAR ================ */
  705. /* =========================================================================================================================== */
  706. /**
  707. * @brief Accelerated Address Resolver. (AAR)
  708. */
  709. typedef struct { /*!< (@ 0x4000F000) AAR Structure */
  710. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start resolving addresses based on IRKs specified
  711. in the IRK data structure. */
  712. __IM uint32_t RESERVED;
  713. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000008) Stop resolving addresses. */
  714. __IM uint32_t RESERVED1[61];
  715. __IOM uint32_t EVENTS_END; /*!< (@ 0x00000100) Address resolution procedure completed. */
  716. __IOM uint32_t EVENTS_RESOLVED; /*!< (@ 0x00000104) Address resolved. */
  717. __IOM uint32_t EVENTS_NOTRESOLVED; /*!< (@ 0x00000108) Address not resolved. */
  718. __IM uint32_t RESERVED2[126];
  719. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  720. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  721. __IM uint32_t RESERVED3[61];
  722. __IM uint32_t STATUS; /*!< (@ 0x00000400) Resolution status. */
  723. __IM uint32_t RESERVED4[63];
  724. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable AAR. */
  725. __IOM uint32_t NIRK; /*!< (@ 0x00000504) Number of Identity root Keys in the IRK data
  726. structure. */
  727. __IOM uint32_t IRKPTR; /*!< (@ 0x00000508) Pointer to the IRK data structure. */
  728. __IM uint32_t RESERVED5;
  729. __IOM uint32_t ADDRPTR; /*!< (@ 0x00000510) Pointer to the resolvable address (6 bytes). */
  730. __IOM uint32_t SCRATCHPTR; /*!< (@ 0x00000514) Pointer to a scratch data area used for temporary
  731. storage during resolution. A minimum of
  732. 3 bytes must be reserved. */
  733. __IM uint32_t RESERVED6[697];
  734. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  735. } NRF_AAR_Type; /*!< Size = 4096 (0x1000) */
  736. /* =========================================================================================================================== */
  737. /* ================ CCM ================ */
  738. /* =========================================================================================================================== */
  739. /**
  740. * @brief AES CCM Mode Encryption. (CCM)
  741. */
  742. typedef struct { /*!< (@ 0x4000F000) CCM Structure */
  743. __OM uint32_t TASKS_KSGEN; /*!< (@ 0x00000000) Start generation of key-stream. This operation
  744. will stop by itself when completed. */
  745. __OM uint32_t TASKS_CRYPT; /*!< (@ 0x00000004) Start encrypt/decrypt. This operation will stop
  746. by itself when completed. */
  747. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000008) Stop encrypt/decrypt. */
  748. __IM uint32_t RESERVED[61];
  749. __IOM uint32_t EVENTS_ENDKSGEN; /*!< (@ 0x00000100) Keystream generation completed. */
  750. __IOM uint32_t EVENTS_ENDCRYPT; /*!< (@ 0x00000104) Encrypt/decrypt completed. */
  751. __IOM uint32_t EVENTS_ERROR; /*!< (@ 0x00000108) Error happened. */
  752. __IM uint32_t RESERVED1[61];
  753. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for the CCM. */
  754. __IM uint32_t RESERVED2[64];
  755. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  756. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  757. __IM uint32_t RESERVED3[61];
  758. __IM uint32_t MICSTATUS; /*!< (@ 0x00000400) CCM RX MIC check result. */
  759. __IM uint32_t RESERVED4[63];
  760. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) CCM enable. */
  761. __IOM uint32_t MODE; /*!< (@ 0x00000504) Operation mode. */
  762. __IOM uint32_t CNFPTR; /*!< (@ 0x00000508) Pointer to a data structure holding AES key and
  763. NONCE vector. */
  764. __IOM uint32_t INPTR; /*!< (@ 0x0000050C) Pointer to the input packet. */
  765. __IOM uint32_t OUTPTR; /*!< (@ 0x00000510) Pointer to the output packet. */
  766. __IOM uint32_t SCRATCHPTR; /*!< (@ 0x00000514) Pointer to a scratch data area used for temporary
  767. storage during resolution. A minimum of
  768. 43 bytes must be reserved. */
  769. __IM uint32_t RESERVED5[697];
  770. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  771. } NRF_CCM_Type; /*!< Size = 4096 (0x1000) */
  772. /* =========================================================================================================================== */
  773. /* ================ WDT ================ */
  774. /* =========================================================================================================================== */
  775. /**
  776. * @brief Watchdog Timer. (WDT)
  777. */
  778. typedef struct { /*!< (@ 0x40010000) WDT Structure */
  779. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start the watchdog. */
  780. __IM uint32_t RESERVED[63];
  781. __IOM uint32_t EVENTS_TIMEOUT; /*!< (@ 0x00000100) Watchdog timeout. */
  782. __IM uint32_t RESERVED1[128];
  783. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  784. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  785. __IM uint32_t RESERVED2[61];
  786. __IM uint32_t RUNSTATUS; /*!< (@ 0x00000400) Watchdog running status. */
  787. __IM uint32_t REQSTATUS; /*!< (@ 0x00000404) Request status. */
  788. __IM uint32_t RESERVED3[63];
  789. __IOM uint32_t CRV; /*!< (@ 0x00000504) Counter reload value in number of 32kiHz clock
  790. cycles. */
  791. __IOM uint32_t RREN; /*!< (@ 0x00000508) Reload request enable. */
  792. __IOM uint32_t CONFIG; /*!< (@ 0x0000050C) Configuration register. */
  793. __IM uint32_t RESERVED4[60];
  794. __OM uint32_t RR[8]; /*!< (@ 0x00000600) Reload requests registers. */
  795. __IM uint32_t RESERVED5[631];
  796. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  797. } NRF_WDT_Type; /*!< Size = 4096 (0x1000) */
  798. /* =========================================================================================================================== */
  799. /* ================ QDEC ================ */
  800. /* =========================================================================================================================== */
  801. /**
  802. * @brief Rotary decoder. (QDEC)
  803. */
  804. typedef struct { /*!< (@ 0x40012000) QDEC Structure */
  805. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start the quadrature decoder. */
  806. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop the quadrature decoder. */
  807. __OM uint32_t TASKS_READCLRACC; /*!< (@ 0x00000008) Transfers the content from ACC registers to ACCREAD
  808. registers, and clears the ACC registers. */
  809. __IM uint32_t RESERVED[61];
  810. __IOM uint32_t EVENTS_SAMPLERDY; /*!< (@ 0x00000100) A new sample is written to the sample register. */
  811. __IOM uint32_t EVENTS_REPORTRDY; /*!< (@ 0x00000104) REPORTPER number of samples accumulated in ACC
  812. register, and ACC register different than
  813. zero. */
  814. __IOM uint32_t EVENTS_ACCOF; /*!< (@ 0x00000108) ACC or ACCDBL register overflow. */
  815. __IM uint32_t RESERVED1[61];
  816. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for the QDEC. */
  817. __IM uint32_t RESERVED2[64];
  818. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  819. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  820. __IM uint32_t RESERVED3[125];
  821. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable the QDEC. */
  822. __IOM uint32_t LEDPOL; /*!< (@ 0x00000504) LED output pin polarity. */
  823. __IOM uint32_t SAMPLEPER; /*!< (@ 0x00000508) Sample period. */
  824. __IM int32_t SAMPLE; /*!< (@ 0x0000050C) Motion sample value. */
  825. __IOM uint32_t REPORTPER; /*!< (@ 0x00000510) Number of samples to generate an EVENT_REPORTRDY. */
  826. __IM int32_t ACC; /*!< (@ 0x00000514) Accumulated valid transitions register. */
  827. __IM int32_t ACCREAD; /*!< (@ 0x00000518) Snapshot of ACC register. Value generated by
  828. the TASKS_READCLEACC task. */
  829. __IOM uint32_t PSELLED; /*!< (@ 0x0000051C) Pin select for LED output. */
  830. __IOM uint32_t PSELA; /*!< (@ 0x00000520) Pin select for phase A input. */
  831. __IOM uint32_t PSELB; /*!< (@ 0x00000524) Pin select for phase B input. */
  832. __IOM uint32_t DBFEN; /*!< (@ 0x00000528) Enable debouncer input filters. */
  833. __IM uint32_t RESERVED4[5];
  834. __IOM uint32_t LEDPRE; /*!< (@ 0x00000540) Time LED is switched ON before the sample. */
  835. __IM uint32_t ACCDBL; /*!< (@ 0x00000544) Accumulated double (error) transitions register. */
  836. __IM uint32_t ACCDBLREAD; /*!< (@ 0x00000548) Snapshot of ACCDBL register. Value generated
  837. by the TASKS_READCLEACC task. */
  838. __IM uint32_t RESERVED5[684];
  839. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  840. } NRF_QDEC_Type; /*!< Size = 4096 (0x1000) */
  841. /* =========================================================================================================================== */
  842. /* ================ LPCOMP ================ */
  843. /* =========================================================================================================================== */
  844. /**
  845. * @brief Low power comparator. (LPCOMP)
  846. */
  847. typedef struct { /*!< (@ 0x40013000) LPCOMP Structure */
  848. __OM uint32_t TASKS_START; /*!< (@ 0x00000000) Start the comparator. */
  849. __OM uint32_t TASKS_STOP; /*!< (@ 0x00000004) Stop the comparator. */
  850. __OM uint32_t TASKS_SAMPLE; /*!< (@ 0x00000008) Sample comparator value. */
  851. __IM uint32_t RESERVED[61];
  852. __IOM uint32_t EVENTS_READY; /*!< (@ 0x00000100) LPCOMP is ready and output is valid. */
  853. __IOM uint32_t EVENTS_DOWN; /*!< (@ 0x00000104) Input voltage crossed the threshold going down. */
  854. __IOM uint32_t EVENTS_UP; /*!< (@ 0x00000108) Input voltage crossed the threshold going up. */
  855. __IOM uint32_t EVENTS_CROSS; /*!< (@ 0x0000010C) Input voltage crossed the threshold in any direction. */
  856. __IM uint32_t RESERVED1[60];
  857. __IOM uint32_t SHORTS; /*!< (@ 0x00000200) Shortcuts for the LPCOMP. */
  858. __IM uint32_t RESERVED2[64];
  859. __IOM uint32_t INTENSET; /*!< (@ 0x00000304) Interrupt enable set register. */
  860. __IOM uint32_t INTENCLR; /*!< (@ 0x00000308) Interrupt enable clear register. */
  861. __IM uint32_t RESERVED3[61];
  862. __IM uint32_t RESULT; /*!< (@ 0x00000400) Result of last compare. */
  863. __IM uint32_t RESERVED4[63];
  864. __IOM uint32_t ENABLE; /*!< (@ 0x00000500) Enable the LPCOMP. */
  865. __IOM uint32_t PSEL; /*!< (@ 0x00000504) Input pin select. */
  866. __IOM uint32_t REFSEL; /*!< (@ 0x00000508) Reference select. */
  867. __IOM uint32_t EXTREFSEL; /*!< (@ 0x0000050C) External reference select. */
  868. __IM uint32_t RESERVED5[4];
  869. __IOM uint32_t ANADETECT; /*!< (@ 0x00000520) Analog detect configuration. */
  870. __IM uint32_t RESERVED6[694];
  871. __IOM uint32_t POWER; /*!< (@ 0x00000FFC) Peripheral power control. */
  872. } NRF_LPCOMP_Type; /*!< Size = 4096 (0x1000) */
  873. /* =========================================================================================================================== */
  874. /* ================ SWI ================ */
  875. /* =========================================================================================================================== */
  876. /**
  877. * @brief SW Interrupts. (SWI)
  878. */
  879. typedef struct { /*!< (@ 0x40014000) SWI Structure */
  880. __IM uint32_t UNUSED; /*!< (@ 0x00000000) Unused. */
  881. } NRF_SWI_Type; /*!< Size = 4 (0x4) */
  882. /* =========================================================================================================================== */
  883. /* ================ NVMC ================ */
  884. /* =========================================================================================================================== */
  885. /**
  886. * @brief Non Volatile Memory Controller. (NVMC)
  887. */
  888. typedef struct { /*!< (@ 0x4001E000) NVMC Structure */
  889. __IM uint32_t RESERVED[256];
  890. __IM uint32_t READY; /*!< (@ 0x00000400) Ready flag. */
  891. __IM uint32_t RESERVED1[64];
  892. __IOM uint32_t CONFIG; /*!< (@ 0x00000504) Configuration register. */
  893. union {
  894. __IOM uint32_t ERASEPAGE; /*!< (@ 0x00000508) Register for erasing a non-protected non-volatile
  895. memory page. */
  896. __IOM uint32_t ERASEPCR1; /*!< (@ 0x00000508) Register for erasing a non-protected non-volatile
  897. memory page. */
  898. };
  899. __IOM uint32_t ERASEALL; /*!< (@ 0x0000050C) Register for erasing all non-volatile user memory. */
  900. __IOM uint32_t ERASEPCR0; /*!< (@ 0x00000510) Register for erasing a protected non-volatile
  901. memory page. */
  902. __IOM uint32_t ERASEUICR; /*!< (@ 0x00000514) Register for start erasing User Information Congfiguration
  903. Registers. */
  904. } NRF_NVMC_Type; /*!< Size = 1304 (0x518) */
  905. /* =========================================================================================================================== */
  906. /* ================ PPI ================ */
  907. /* =========================================================================================================================== */
  908. /**
  909. * @brief PPI controller. (PPI)
  910. */
  911. typedef struct { /*!< (@ 0x4001F000) PPI Structure */
  912. __IOM PPI_TASKS_CHG_Type TASKS_CHG[4]; /*!< (@ 0x00000000) Channel group tasks. */
  913. __IM uint32_t RESERVED[312];
  914. __IOM uint32_t CHEN; /*!< (@ 0x00000500) Channel enable. */
  915. __IOM uint32_t CHENSET; /*!< (@ 0x00000504) Channel enable set. */
  916. __IOM uint32_t CHENCLR; /*!< (@ 0x00000508) Channel enable clear. */
  917. __IM uint32_t RESERVED1;
  918. __IOM PPI_CH_Type CH[16]; /*!< (@ 0x00000510) PPI Channel. */
  919. __IM uint32_t RESERVED2[156];
  920. __IOM uint32_t CHG[4]; /*!< (@ 0x00000800) Channel group configuration. */
  921. } NRF_PPI_Type; /*!< Size = 2064 (0x810) */
  922. /* =========================================================================================================================== */
  923. /* ================ FICR ================ */
  924. /* =========================================================================================================================== */
  925. /**
  926. * @brief Factory Information Configuration. (FICR)
  927. */
  928. typedef struct { /*!< (@ 0x10000000) FICR Structure */
  929. __IM uint32_t RESERVED[4];
  930. __IM uint32_t CODEPAGESIZE; /*!< (@ 0x00000010) Code memory page size in bytes. */
  931. __IM uint32_t CODESIZE; /*!< (@ 0x00000014) Code memory size in pages. */
  932. __IM uint32_t RESERVED1[4];
  933. __IM uint32_t CLENR0; /*!< (@ 0x00000028) Length of code region 0 in bytes. */
  934. __IM uint32_t PPFC; /*!< (@ 0x0000002C) Pre-programmed factory code present. */
  935. __IM uint32_t RESERVED2;
  936. __IM uint32_t NUMRAMBLOCK; /*!< (@ 0x00000034) Number of individualy controllable RAM blocks. */
  937. union {
  938. __IM uint32_t SIZERAMBLOCKS; /*!< (@ 0x00000038) Size of RAM blocks in bytes. */
  939. __IM uint32_t SIZERAMBLOCK[4]; /*!< (@ 0x00000038) Deprecated array of size of RAM block in bytes.
  940. This name is kept for backward compatinility
  941. purposes. Use SIZERAMBLOCKS instead. */
  942. };
  943. __IM uint32_t RESERVED3[5];
  944. __IM uint32_t CONFIGID; /*!< (@ 0x0000005C) Configuration identifier. */
  945. __IM uint32_t DEVICEID[2]; /*!< (@ 0x00000060) Device identifier. */
  946. __IM uint32_t RESERVED4[6];
  947. __IM uint32_t ER[4]; /*!< (@ 0x00000080) Encryption root. */
  948. __IM uint32_t IR[4]; /*!< (@ 0x00000090) Identity root. */
  949. __IM uint32_t DEVICEADDRTYPE; /*!< (@ 0x000000A0) Device address type. */
  950. __IM uint32_t DEVICEADDR[2]; /*!< (@ 0x000000A4) Device address. */
  951. __IM uint32_t OVERRIDEEN; /*!< (@ 0x000000AC) Radio calibration override enable. */
  952. __IM uint32_t NRF_1MBIT[5]; /*!< (@ 0x000000B0) Override values for the OVERRIDEn registers in
  953. RADIO for NRF_1Mbit mode. */
  954. __IM uint32_t RESERVED5[10];
  955. __IM uint32_t BLE_1MBIT[5]; /*!< (@ 0x000000EC) Override values for the OVERRIDEn registers in
  956. RADIO for BLE_1Mbit mode. */
  957. } NRF_FICR_Type; /*!< Size = 256 (0x100) */
  958. /* =========================================================================================================================== */
  959. /* ================ UICR ================ */
  960. /* =========================================================================================================================== */
  961. /**
  962. * @brief User Information Configuration. (UICR)
  963. */
  964. typedef struct { /*!< (@ 0x10001000) UICR Structure */
  965. __IOM uint32_t CLENR0; /*!< (@ 0x00000000) Length of code region 0. */
  966. __IOM uint32_t RBPCONF; /*!< (@ 0x00000004) Readback protection configuration. */
  967. __IOM uint32_t XTALFREQ; /*!< (@ 0x00000008) Reset value for CLOCK XTALFREQ register. */
  968. __IM uint32_t RESERVED;
  969. __IM uint32_t FWID; /*!< (@ 0x00000010) Firmware ID. */
  970. union {
  971. __IOM uint32_t BOOTLOADERADDR; /*!< (@ 0x00000014) Bootloader start address. */
  972. __IOM uint32_t NRFFW[15]; /*!< (@ 0x00000014) Reserved for Nordic firmware design. */
  973. };
  974. __IOM uint32_t NRFHW[12]; /*!< (@ 0x00000050) Reserved for Nordic hardware design. */
  975. __IOM uint32_t CUSTOMER[32]; /*!< (@ 0x00000080) Reserved for customer. */
  976. } NRF_UICR_Type; /*!< Size = 256 (0x100) */
  977. /* =========================================================================================================================== */
  978. /* ================ GPIO ================ */
  979. /* =========================================================================================================================== */
  980. /**
  981. * @brief General purpose input and output. (GPIO)
  982. */
  983. typedef struct { /*!< (@ 0x50000000) GPIO Structure */
  984. __IM uint32_t RESERVED[321];
  985. __IOM uint32_t OUT; /*!< (@ 0x00000504) Write GPIO port. */
  986. __IOM uint32_t OUTSET; /*!< (@ 0x00000508) Set individual bits in GPIO port. */
  987. __IOM uint32_t OUTCLR; /*!< (@ 0x0000050C) Clear individual bits in GPIO port. */
  988. __IM uint32_t IN; /*!< (@ 0x00000510) Read GPIO port. */
  989. __IOM uint32_t DIR; /*!< (@ 0x00000514) Direction of GPIO pins. */
  990. __IOM uint32_t DIRSET; /*!< (@ 0x00000518) DIR set register. */
  991. __IOM uint32_t DIRCLR; /*!< (@ 0x0000051C) DIR clear register. */
  992. __IM uint32_t RESERVED1[120];
  993. __IOM uint32_t PIN_CNF[32]; /*!< (@ 0x00000700) Configuration of GPIO pins. */
  994. } NRF_GPIO_Type; /*!< Size = 1920 (0x780) */
  995. /** @} */ /* End of group Device_Peripheral_peripherals */
  996. /* =========================================================================================================================== */
  997. /* ================ Device Specific Peripheral Address Map ================ */
  998. /* =========================================================================================================================== */
  999. /** @addtogroup Device_Peripheral_peripheralAddr
  1000. * @{
  1001. */
  1002. #define NRF_POWER_BASE 0x40000000UL
  1003. #define NRF_CLOCK_BASE 0x40000000UL
  1004. #define NRF_MPU_BASE 0x40000000UL
  1005. #define NRF_RADIO_BASE 0x40001000UL
  1006. #define NRF_UART0_BASE 0x40002000UL
  1007. #define NRF_SPI0_BASE 0x40003000UL
  1008. #define NRF_TWI0_BASE 0x40003000UL
  1009. #define NRF_SPI1_BASE 0x40004000UL
  1010. #define NRF_TWI1_BASE 0x40004000UL
  1011. #define NRF_SPIS1_BASE 0x40004000UL
  1012. #define NRF_GPIOTE_BASE 0x40006000UL
  1013. #define NRF_ADC_BASE 0x40007000UL
  1014. #define NRF_TIMER0_BASE 0x40008000UL
  1015. #define NRF_TIMER1_BASE 0x40009000UL
  1016. #define NRF_TIMER2_BASE 0x4000A000UL
  1017. #define NRF_RTC0_BASE 0x4000B000UL
  1018. #define NRF_TEMP_BASE 0x4000C000UL
  1019. #define NRF_RNG_BASE 0x4000D000UL
  1020. #define NRF_ECB_BASE 0x4000E000UL
  1021. #define NRF_AAR_BASE 0x4000F000UL
  1022. #define NRF_CCM_BASE 0x4000F000UL
  1023. #define NRF_WDT_BASE 0x40010000UL
  1024. #define NRF_RTC1_BASE 0x40011000UL
  1025. #define NRF_QDEC_BASE 0x40012000UL
  1026. #define NRF_LPCOMP_BASE 0x40013000UL
  1027. #define NRF_SWI_BASE 0x40014000UL
  1028. #define NRF_NVMC_BASE 0x4001E000UL
  1029. #define NRF_PPI_BASE 0x4001F000UL
  1030. #define NRF_FICR_BASE 0x10000000UL
  1031. #define NRF_UICR_BASE 0x10001000UL
  1032. #define NRF_GPIO_BASE 0x50000000UL
  1033. /** @} */ /* End of group Device_Peripheral_peripheralAddr */
  1034. /* =========================================================================================================================== */
  1035. /* ================ Peripheral declaration ================ */
  1036. /* =========================================================================================================================== */
  1037. /** @addtogroup Device_Peripheral_declaration
  1038. * @{
  1039. */
  1040. #define NRF_POWER ((NRF_POWER_Type*) NRF_POWER_BASE)
  1041. #define NRF_CLOCK ((NRF_CLOCK_Type*) NRF_CLOCK_BASE)
  1042. #define NRF_MPU ((NRF_MPU_Type*) NRF_MPU_BASE)
  1043. #define NRF_RADIO ((NRF_RADIO_Type*) NRF_RADIO_BASE)
  1044. #define NRF_UART0 ((NRF_UART_Type*) NRF_UART0_BASE)
  1045. #define NRF_SPI0 ((NRF_SPI_Type*) NRF_SPI0_BASE)
  1046. #define NRF_TWI0 ((NRF_TWI_Type*) NRF_TWI0_BASE)
  1047. #define NRF_SPI1 ((NRF_SPI_Type*) NRF_SPI1_BASE)
  1048. #define NRF_TWI1 ((NRF_TWI_Type*) NRF_TWI1_BASE)
  1049. #define NRF_SPIS1 ((NRF_SPIS_Type*) NRF_SPIS1_BASE)
  1050. #define NRF_GPIOTE ((NRF_GPIOTE_Type*) NRF_GPIOTE_BASE)
  1051. #define NRF_ADC ((NRF_ADC_Type*) NRF_ADC_BASE)
  1052. #define NRF_TIMER0 ((NRF_TIMER_Type*) NRF_TIMER0_BASE)
  1053. #define NRF_TIMER1 ((NRF_TIMER_Type*) NRF_TIMER1_BASE)
  1054. #define NRF_TIMER2 ((NRF_TIMER_Type*) NRF_TIMER2_BASE)
  1055. #define NRF_RTC0 ((NRF_RTC_Type*) NRF_RTC0_BASE)
  1056. #define NRF_TEMP ((NRF_TEMP_Type*) NRF_TEMP_BASE)
  1057. #define NRF_RNG ((NRF_RNG_Type*) NRF_RNG_BASE)
  1058. #define NRF_ECB ((NRF_ECB_Type*) NRF_ECB_BASE)
  1059. #define NRF_AAR ((NRF_AAR_Type*) NRF_AAR_BASE)
  1060. #define NRF_CCM ((NRF_CCM_Type*) NRF_CCM_BASE)
  1061. #define NRF_WDT ((NRF_WDT_Type*) NRF_WDT_BASE)
  1062. #define NRF_RTC1 ((NRF_RTC_Type*) NRF_RTC1_BASE)
  1063. #define NRF_QDEC ((NRF_QDEC_Type*) NRF_QDEC_BASE)
  1064. #define NRF_LPCOMP ((NRF_LPCOMP_Type*) NRF_LPCOMP_BASE)
  1065. #define NRF_SWI ((NRF_SWI_Type*) NRF_SWI_BASE)
  1066. #define NRF_NVMC ((NRF_NVMC_Type*) NRF_NVMC_BASE)
  1067. #define NRF_PPI ((NRF_PPI_Type*) NRF_PPI_BASE)
  1068. #define NRF_FICR ((NRF_FICR_Type*) NRF_FICR_BASE)
  1069. #define NRF_UICR ((NRF_UICR_Type*) NRF_UICR_BASE)
  1070. #define NRF_GPIO ((NRF_GPIO_Type*) NRF_GPIO_BASE)
  1071. /** @} */ /* End of group Device_Peripheral_declaration */
  1072. /* ========================================= End of section using anonymous unions ========================================= */
  1073. #if defined (__CC_ARM)
  1074. #pragma pop
  1075. #elif defined (__ICCARM__)
  1076. /* leave anonymous unions enabled */
  1077. #elif (__ARMCC_VERSION >= 6010050)
  1078. #pragma clang diagnostic pop
  1079. #elif defined (__GNUC__)
  1080. /* anonymous unions are enabled by default */
  1081. #elif defined (__TMS470__)
  1082. /* anonymous unions are enabled by default */
  1083. #elif defined (__TASKING__)
  1084. #pragma warning restore
  1085. #elif defined (__CSMC__)
  1086. /* anonymous unions are enabled by default */
  1087. #endif
  1088. #ifdef __cplusplus
  1089. }
  1090. #endif
  1091. #endif /* NRF51_H */
  1092. /** @} */ /* End of group nrf51 */
  1093. /** @} */ /* End of group Nordic Semiconductor */