8 #ifndef NRFCXX_NRF52840_CORE_HPP 9 #define NRFCXX_NRF52840_CORE_HPP 17 void POWER_CLOCK_IRQHandler ();
18 void RADIO_IRQHandler ();
19 void UARTE0_UART0_IRQHandler ();
20 void SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler ();
21 void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler ();
22 void NFCT_IRQHandler ();
23 void GPIOTE_IRQHandler ();
24 void SAADC_IRQHandler ();
25 void TIMER0_IRQHandler ();
26 void TIMER1_IRQHandler ();
27 void TIMER2_IRQHandler ();
28 void RTC0_IRQHandler ();
29 void TEMP_IRQHandler ();
30 void RNG_IRQHandler ();
31 void ECB_IRQHandler ();
32 void CCM_AAR_IRQHandler ();
33 void WDT_IRQHandler ();
34 void RTC1_IRQHandler ();
35 void QDEC_IRQHandler ();
36 void COMP_LPCOMP_IRQHandler ();
37 void SWI0_EGU0_IRQHandler ();
38 void SWI1_EGU1_IRQHandler ();
39 void SWI2_EGU2_IRQHandler ();
40 void SWI3_EGU3_IRQHandler ();
41 void SWI4_EGU4_IRQHandler ();
42 void SWI5_EGU5_IRQHandler ();
43 void TIMER3_IRQHandler ();
44 void TIMER4_IRQHandler ();
45 void PWM0_IRQHandler ();
46 void PDM_IRQHandler ();
47 void MWU_IRQHandler ();
48 void PWM1_IRQHandler ();
49 void PWM2_IRQHandler ();
50 void SPIM2_SPIS2_SPI2_IRQHandler ();
51 void RTC2_IRQHandler ();
52 void I2S_IRQHandler ();
53 void FPU_IRQHandler ();
54 void USBD_IRQHandler ();
55 void UARTE1_IRQHandler ();
56 void QSPI_IRQHandler ();
57 void CRYPTOCELL_IRQHandler ();
58 void PWM3_IRQHandler ();
59 void SPIM3_IRQHandler ();
66 using FICR_Type = peripheral<NRF_FICR_Type>;
67 static constexpr FICR_Type FICR{NRF_FICR_BASE};
69 using UICR_Type = peripheral<NRF_UICR_Type>;
70 static constexpr UICR_Type UICR{NRF_UICR_BASE};
72 using CLOCK_Type = peripheral<NRF_CLOCK_Type>;
73 static constexpr CLOCK_Type CLOCK{NRF_CLOCK_BASE, POWER_CLOCK_IRQn};
75 using POWER_Type = peripheral<NRF_POWER_Type>;
76 static constexpr POWER_Type POWER{NRF_POWER_BASE, POWER_CLOCK_IRQn};
78 using RADIO_Type = peripheral<NRF_RADIO_Type>;
79 static constexpr RADIO_Type RADIO{NRF_RADIO_BASE, RADIO_IRQn};
81 using UARTE_Type = peripheral<NRF_UARTE_Type>;
82 static constexpr UARTE_Type UARTE0{NRF_UARTE0_BASE, UARTE0_UART0_IRQn, 0};
83 static constexpr UARTE_Type UARTE1{NRF_UARTE1_BASE, UARTE1_IRQn, 1};
85 using UART_Type = peripheral<NRF_UART_Type>;
86 static constexpr UART_Type UART0{NRF_UART0_BASE, UARTE0_UART0_IRQn};
88 using SPIM_Type = peripheral<NRF_SPIM_Type>;
89 static constexpr SPIM_Type SPIM0{NRF_SPIM0_BASE, SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0};
90 static constexpr SPIM_Type SPIM1{NRF_SPIM1_BASE, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, 1};
91 static constexpr SPIM_Type SPIM2{NRF_SPIM2_BASE, SPIM2_SPIS2_SPI2_IRQn, 2};
92 static constexpr SPIM_Type SPIM3{NRF_SPIM3_BASE, SPIM3_IRQn, 3};
94 using SPIS_Type = peripheral<NRF_SPIS_Type>;
95 static constexpr SPIS_Type SPIS0{NRF_SPIS0_BASE, SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0};
96 static constexpr SPIS_Type SPIS1{NRF_SPIS1_BASE, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, 1};
97 static constexpr SPIS_Type SPIS2{NRF_SPIS2_BASE, SPIM2_SPIS2_SPI2_IRQn, 2};
99 using SPI_Type = peripheral<NRF_SPI_Type>;
100 static constexpr SPI_Type SPI0{NRF_SPI0_BASE, SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0};
101 static constexpr SPI_Type SPI1{NRF_SPI1_BASE, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, 1};
102 static constexpr SPI_Type SPI2{NRF_SPI2_BASE, SPIM2_SPIS2_SPI2_IRQn, 2};
104 using TWIM_Type = peripheral<NRF_TWIM_Type>;
105 static constexpr TWIM_Type TWIM0{NRF_TWIM0_BASE, SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0};
106 static constexpr TWIM_Type TWIM1{NRF_TWIM1_BASE, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, 1};
108 using TWIS_Type = peripheral<NRF_TWIS_Type>;
109 static constexpr TWIS_Type TWIS0{NRF_TWIS0_BASE, SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0};
110 static constexpr TWIS_Type TWIS1{NRF_TWIS1_BASE, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, 1};
112 using TWI_Type = peripheral<NRF_TWI_Type>;
113 static constexpr TWI_Type TWI0{NRF_TWI0_BASE, SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, 0};
114 static constexpr TWI_Type TWI1{NRF_TWI1_BASE, SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn, 1};
116 using NFCT_Type = peripheral<NRF_NFCT_Type>;
117 static constexpr NFCT_Type NFCT{NRF_NFCT_BASE, NFCT_IRQn};
119 using GPIOTE_Type = peripheral<NRF_GPIOTE_Type>;
122 using SAADC_Type = peripheral<NRF_SAADC_Type>;
124 static constexpr
auto& ADCVariant = SAADC;
125 #define ADCSeriesVariant_IRQHandler SAADC_IRQHandler 127 using TIMER_Type = peripheral<NRF_TIMER_Type>;
128 static constexpr TIMER_Type TIMER0{NRF_TIMER0_BASE, TIMER0_IRQn, 0, 4};
129 static constexpr TIMER_Type TIMER1{NRF_TIMER1_BASE, TIMER1_IRQn, 1, 4};
130 static constexpr TIMER_Type TIMER2{NRF_TIMER2_BASE, TIMER2_IRQn, 2, 4};
131 static constexpr TIMER_Type TIMER3{NRF_TIMER3_BASE, TIMER3_IRQn, 3, 6};
132 static constexpr TIMER_Type TIMER4{NRF_TIMER4_BASE, TIMER4_IRQn, 4, 6};
134 using RTC_Type = peripheral<NRF_RTC_Type>;
135 static constexpr RTC_Type RTC0{NRF_RTC0_BASE, RTC0_IRQn, 0, 3};
136 static constexpr RTC_Type RTC1{NRF_RTC1_BASE, RTC1_IRQn, 1, 4};
137 static constexpr RTC_Type RTC2{NRF_RTC2_BASE, RTC2_IRQn, 2, 4};
138 #define UPTIME_RTC_IRQHandler RTC1_IRQHandler 139 static constexpr
const RTC_Type& UPTIME_RTC{RTC1};
141 using TEMP_Type = peripheral<NRF_TEMP_Type>;
142 static constexpr TEMP_Type TEMP{NRF_TEMP_BASE, TEMP_IRQn};
144 using RNG_Type = peripheral<NRF_RNG_Type>;
145 static constexpr RNG_Type RNG{NRF_RNG_BASE, RNG_IRQn};
147 using ECB_Type = peripheral<NRF_ECB_Type>;
148 static constexpr ECB_Type ECB{NRF_ECB_BASE, ECB_IRQn};
150 using CCM_Type = peripheral<NRF_CCM_Type>;
151 static constexpr CCM_Type CCM{NRF_CCM_BASE, CCM_AAR_IRQn};
153 using AAR_Type = peripheral<NRF_AAR_Type>;
154 static constexpr AAR_Type AAR{NRF_AAR_BASE, CCM_AAR_IRQn};
156 using WDT_Type = peripheral<NRF_WDT_Type>;
157 static constexpr WDT_Type WDT{NRF_WDT_BASE, WDT_IRQn};
159 using QDEC_Type = peripheral<NRF_QDEC_Type>;
160 static constexpr QDEC_Type QDEC{NRF_QDEC_BASE, QDEC_IRQn};
162 using COMP_Type = peripheral<NRF_COMP_Type>;
163 static constexpr COMP_Type COMP{NRF_COMP_BASE, COMP_LPCOMP_IRQn};
165 using LPCOMP_Type = peripheral<NRF_LPCOMP_Type>;
166 static constexpr LPCOMP_Type LPCOMP{NRF_LPCOMP_BASE, COMP_LPCOMP_IRQn};
168 using SWI_Type = peripheral<NRF_SWI_Type>;
169 static constexpr SWI_Type SWI0{NRF_SWI0_BASE, SWI0_EGU0_IRQn, 0};
170 static constexpr SWI_Type SWI1{NRF_SWI1_BASE, SWI1_EGU1_IRQn, 1};
171 static constexpr SWI_Type SWI2{NRF_SWI2_BASE, SWI2_EGU2_IRQn, 2};
172 static constexpr SWI_Type SWI3{NRF_SWI3_BASE, SWI3_EGU3_IRQn, 3};
173 static constexpr SWI_Type SWI4{NRF_SWI4_BASE, SWI4_EGU4_IRQn, 4};
174 static constexpr SWI_Type SWI5{NRF_SWI5_BASE, SWI5_EGU5_IRQn, 5};
176 using EGU_Type = peripheral<NRF_EGU_Type>;
177 static constexpr EGU_Type EGU0{NRF_EGU0_BASE, SWI0_EGU0_IRQn, 0};
178 static constexpr EGU_Type EGU1{NRF_EGU1_BASE, SWI1_EGU1_IRQn, 1};
179 static constexpr EGU_Type EGU2{NRF_EGU2_BASE, SWI2_EGU2_IRQn, 2};
180 static constexpr EGU_Type EGU3{NRF_EGU3_BASE, SWI3_EGU3_IRQn, 3};
181 static constexpr EGU_Type EGU4{NRF_EGU4_BASE, SWI4_EGU4_IRQn, 4};
182 static constexpr EGU_Type EGU5{NRF_EGU5_BASE, SWI5_EGU5_IRQn, 5};
184 using PWM_Type = peripheral<NRF_PWM_Type>;
185 static constexpr PWM_Type PWM0{NRF_PWM0_BASE, PWM0_IRQn, 0};
186 static constexpr PWM_Type PWM1{NRF_PWM1_BASE, PWM1_IRQn, 1};
187 static constexpr PWM_Type PWM2{NRF_PWM2_BASE, PWM2_IRQn, 2};
188 static constexpr PWM_Type PWM3{NRF_PWM3_BASE, PWM3_IRQn, 3};
190 using PDM_Type = peripheral<NRF_PDM_Type>;
191 static constexpr PDM_Type PDM0{NRF_PDM_BASE, PDM_IRQn};
193 using NVMC_Type = peripheral<NRF_NVMC_Type>;
194 static constexpr NVMC_Type NVMC{NRF_NVMC_BASE};
196 struct PPI_Type :
public peripheral<NRF_PPI_Type>
216 static constexpr PPI_Type PPI{};
218 using MWU_Type = peripheral<NRF_MWU_Type>;
219 static constexpr MWU_Type MWU{NRF_MWU_BASE, MWU_IRQn};
221 using I2S_Type = peripheral<NRF_I2S_Type>;
222 static constexpr I2S_Type I2S{NRF_I2S_BASE, I2S_IRQn};
224 using USBD_Type = peripheral<NRF_USBD_Type>;
225 static constexpr USBD_Type USBD{NRF_USBD_BASE, USBD_IRQn};
227 using QSPI_Type = peripheral<NRF_QSPI_Type>;
228 static constexpr QSPI_Type QSPI{NRF_QSPI_BASE, QSPI_IRQn};
230 using CC_HOST_RGF_Type = peripheral<NRF_CC_HOST_RGF_Type>;
231 static constexpr CC_HOST_RGF_Type CC_HOST_RGF{NRF_CC_HOST_RGF_BASE};
233 using CRYPTOCELL_Type = peripheral<NRF_CRYPTOCELL_Type>;
234 static constexpr CRYPTOCELL_Type CRYPTOCELL{NRF_CRYPTOCELL_BASE, CRYPTOCELL_IRQn};
238 using FPU_Type = peripheral<NRF_FPU_Type>;
239 static constexpr FPU_Type FPU{NRF_FPU_BASE, FPU_IRQn};
242 using GPIO_Type = peripheral<NRF_GPIO_Type>;
246 static constexpr
const GPIO_Type& GPIO{P0};
249 struct GPIO_Instance<0>
251 static constexpr
const GPIO_Type& peripheral{P0};
252 static constexpr
int begin_psel = 0;
253 static constexpr
int end_psel = begin_psel + P0.
AUX;
260 static constexpr
int end_psel = begin_psel + P1.
AUX;