8 #ifndef NRFCXX_NRF51_CORE_HPP 9 #define NRFCXX_NRF51_CORE_HPP 17 void POWER_CLOCK_IRQHandler ();
18 void RADIO_IRQHandler ();
19 void UART0_IRQHandler ();
20 void SPI0_TWI0_IRQHandler ();
21 void SPI1_TWI1_IRQHandler ();
22 void GPIOTE_IRQHandler ();
23 void ADC_IRQHandler ();
24 void TIMER0_IRQHandler ();
25 void TIMER1_IRQHandler ();
26 void TIMER2_IRQHandler ();
27 void RTC0_IRQHandler ();
28 void TEMP_IRQHandler ();
29 void RNG_IRQHandler ();
30 void ECB_IRQHandler ();
31 void CCM_AAR_IRQHandler ();
32 void WDT_IRQHandler ();
33 void RTC1_IRQHandler ();
34 void QDEC_IRQHandler ();
35 void LPCOMP_IRQHandler ();
36 void SWI0_IRQHandler ();
37 void SWI1_IRQHandler ();
38 void SWI2_IRQHandler ();
39 void SWI3_IRQHandler ();
40 void SWI4_IRQHandler ();
41 void SWI5_IRQHandler ();
73 static constexpr
POWER_Type POWER{NRF_POWER_BASE, POWER_CLOCK_IRQn};
75 using CLOCK_Type = peripheral<NRF_CLOCK_Type>;
76 static constexpr CLOCK_Type CLOCK{NRF_CLOCK_BASE, POWER_CLOCK_IRQn};
78 using MPU_Type = peripheral<NRF_MPU_Type>;
79 static constexpr MPU_Type MPU{NRF_MPU_BASE};
81 using RADIO_Type = peripheral<NRF_RADIO_Type>;
82 static constexpr RADIO_Type RADIO{NRF_RADIO_BASE, RADIO_IRQn};
84 using UART_Type = peripheral<NRF_UART_Type>;
85 static constexpr UART_Type UART0{NRF_UART0_BASE, UART0_IRQn, 0};
87 using SPI_Type = peripheral<NRF_SPI_Type>;
88 static constexpr SPI_Type SPI0{NRF_SPI0_BASE, SPI0_TWI0_IRQn, 0};
89 static constexpr SPI_Type SPI1{NRF_SPI1_BASE, SPI1_TWI1_IRQn, 1};
91 using TWI_Type = peripheral<NRF_TWI_Type>;
92 static constexpr TWI_Type TWI0{NRF_TWI0_BASE, SPI0_TWI0_IRQn, 0};
93 static constexpr TWI_Type TWI1{NRF_TWI1_BASE, SPI1_TWI1_IRQn, 1};
95 using SPIS_Type = peripheral<NRF_SPIS_Type>;
96 static constexpr SPI_Type SPIS1{NRF_SPIS1_BASE, SPI1_TWI1_IRQn, 1};
98 using GPIOTE_Type = peripheral<NRF_GPIOTE_Type>;
101 using ADC_Type = peripheral<NRF_ADC_Type>;
102 static constexpr ADC_Type ADC{NRF_ADC_BASE, ADC_IRQn};
103 static constexpr
auto& ADCVariant = ADC;
104 #define ADCSeriesVariant_IRQHandler ADC_IRQHandler 106 using TIMER_Type = peripheral<NRF_TIMER_Type>;
107 static constexpr TIMER_Type TIMER0{NRF_TIMER0_BASE, TIMER0_IRQn, 0, 4};
108 static constexpr TIMER_Type TIMER1{NRF_TIMER1_BASE, TIMER1_IRQn, 1, 4};
109 static constexpr TIMER_Type TIMER2{NRF_TIMER2_BASE, TIMER2_IRQn, 2, 4};
111 using RTC_Type = peripheral<NRF_RTC_Type>;
112 static constexpr RTC_Type RTC0{NRF_RTC0_BASE, RTC0_IRQn, 0, 3};
113 static constexpr RTC_Type RTC1{NRF_RTC1_BASE, RTC1_IRQn, 0, 4};
114 #define UPTIME_RTC_IRQHandler RTC1_IRQHandler 115 static constexpr
const RTC_Type& UPTIME_RTC{RTC1};
117 using TEMP_Type = peripheral<NRF_TEMP_Type>;
118 static constexpr TEMP_Type TEMP{NRF_TEMP_BASE, TEMP_IRQn};
120 using RNG_Type = peripheral<NRF_RNG_Type>;
121 static constexpr RNG_Type RNG{NRF_RNG_BASE, RNG_IRQn};
123 using ECB_Type = peripheral<NRF_ECB_Type>;
124 static constexpr ECB_Type ECB{NRF_ECB_BASE, ECB_IRQn};
126 using AAR_Type = peripheral<NRF_AAR_Type>;
127 static constexpr AAR_Type AAR{NRF_AAR_BASE, CCM_AAR_IRQn};
129 using CCM_Type = peripheral<NRF_CCM_Type>;
130 static constexpr CCM_Type CCM{NRF_CCM_BASE, CCM_AAR_IRQn};
132 using WDT_Type = peripheral<NRF_WDT_Type>;
133 static constexpr WDT_Type WDT{NRF_WDT_BASE, WDT_IRQn};
135 using QDEC_Type = peripheral<NRF_QDEC_Type>;
136 static constexpr QDEC_Type QDEC{NRF_QDEC_BASE, QDEC_IRQn};
138 using LPCOMP_Type = peripheral<NRF_LPCOMP_Type>;
139 static constexpr LPCOMP_Type LPCOMP{NRF_LPCOMP_BASE, LPCOMP_IRQn};
141 using SWI_Type = peripheral<NRF_SWI_Type>;
142 static constexpr SWI_Type SWI{NRF_SWI_BASE};
144 using NVMC_Type = peripheral<NRF_NVMC_Type>;
145 static constexpr NVMC_Type NVMC{NRF_NVMC_BASE};
166 static constexpr PPI_Type PPI{};
168 using FICR_Type = peripheral<NRF_FICR_Type>;
169 static constexpr FICR_Type FICR{NRF_FICR_BASE};
171 using UICR_Type = peripheral<NRF_UICR_Type>;
172 static constexpr UICR_Type UICR{NRF_UICR_BASE};
174 using GPIO_Type = peripheral<NRF_GPIO_Type>;
184 static constexpr
int begin_psel = 0;
185 static constexpr
int end_psel = begin_psel + GPIO.
AUX;