nrfx_config.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. /*
  2. * Copyright (c) 2019 - 2020, Nordic Semiconductor ASA
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef NRFX_CONFIG_H__
  7. #define NRFX_CONFIG_H__
  8. // TODO - temporary redirection
  9. #include <sdk_config.h>
  10. /*
  11. * These are mappings of Kconfig options enabling nrfx drivers and particular
  12. * peripheral instances to the corresponding symbols used inside of nrfx.
  13. * Please note that only subsets of these entries are used for particular SoCs
  14. * supported by nrfx (see the corresponding nrfx_config_*.h files).
  15. */
  16. #ifdef CONFIG_NRFX_ADC
  17. #define NRFX_ADC_ENABLED 1
  18. #endif
  19. #ifdef CONFIG_NRFX_CLOCK
  20. #define NRFX_CLOCK_ENABLED 1
  21. #endif
  22. #ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC
  23. #if defined(CONFIG_SOC_SERIES_NRF91X) || defined(CONFIG_SOC_SERIES_NRF53X)
  24. #define NRFX_CLOCK_CONFIG_LF_SRC 1
  25. #else
  26. #define NRFX_CLOCK_CONFIG_LF_SRC 0
  27. #endif
  28. #endif // CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC
  29. #ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL
  30. #if defined(CONFIG_SOC_SERIES_NRF91X) || defined(CONFIG_SOC_SERIES_NRF53X)
  31. #define NRFX_CLOCK_CONFIG_LF_SRC 2
  32. #else
  33. #define NRFX_CLOCK_CONFIG_LF_SRC 1
  34. #endif
  35. #endif // CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL
  36. #ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH
  37. #ifdef CONFIG_SOC_SERIES_NRF53X
  38. #define NRFX_CLOCK_CONFIG_LF_SRC 3
  39. #else
  40. #define NRFX_CLOCK_CONFIG_LF_SRC 2
  41. #endif
  42. #endif // CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH
  43. #ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING
  44. #define NRFX_CLOCK_CONFIG_LF_SRC 131073
  45. #endif
  46. #ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING
  47. #define NRFX_CLOCK_CONFIG_LF_SRC 196609
  48. #endif
  49. #ifdef CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION
  50. #define NRFX_CLOCK_CONFIG_LF_CAL_ENABLED 1
  51. #endif
  52. #ifdef CONFIG_NRFX_CLOCK_LFXO_TWO_STAGE_ENABLED
  53. #define NRFX_CLOCK_CONFIG_LFXO_TWO_STAGE_ENABLED 1
  54. #endif
  55. #ifdef CONFIG_NRFX_COMP
  56. #define NRFX_COMP_ENABLED 1
  57. #endif
  58. #ifdef CONFIG_NRFX_DPPI
  59. #define NRFX_DPPI_ENABLED 1
  60. #endif
  61. #ifdef CONFIG_NRFX_EGU
  62. #define NRFX_EGU_ENABLED 1
  63. #endif
  64. #ifdef CONFIG_NRFX_EGU0
  65. #define NRFX_EGU0_ENABLED 1
  66. #endif
  67. #ifdef CONFIG_NRFX_EGU1
  68. #define NRFX_EGU1_ENABLED 1
  69. #endif
  70. #ifdef CONFIG_NRFX_EGU2
  71. #define NRFX_EGU2_ENABLED 1
  72. #endif
  73. #ifdef CONFIG_NRFX_EGU3
  74. #define NRFX_EGU3_ENABLED 1
  75. #endif
  76. #ifdef CONFIG_NRFX_EGU4
  77. #define NRFX_EGU4_ENABLED 1
  78. #endif
  79. #ifdef CONFIG_NRFX_EGU5
  80. #define NRFX_EGU5_ENABLED 1
  81. #endif
  82. #ifdef CONFIG_NRFX_GPIOTE
  83. #define NRFX_GPIOTE_ENABLED 1
  84. #endif
  85. #ifdef CONFIG_NRFX_I2S
  86. #define NRFX_I2S_ENABLED 1
  87. #endif
  88. #ifdef CONFIG_NRFX_IPC
  89. #define NRFX_IPC_ENABLED 1
  90. #endif
  91. #ifdef CONFIG_NRFX_LPCOMP
  92. #define NRFX_LPCOMP_ENABLED 1
  93. #endif
  94. #ifdef CONFIG_NRFX_NFCT
  95. #define NRFX_NFCT_ENABLED 1
  96. #endif
  97. #ifdef CONFIG_NRFX_NVMC
  98. #define NRFX_NVMC_ENABLED 1
  99. #endif
  100. #ifdef CONFIG_NRFX_PDM
  101. #define NRFX_PDM_ENABLED 1
  102. #endif
  103. #ifdef CONFIG_NRFX_POWER
  104. #define NRFX_POWER_ENABLED 1
  105. #endif
  106. #ifdef CONFIG_NRFX_PPI
  107. #define NRFX_PPI_ENABLED 1
  108. #endif
  109. #ifdef CONFIG_NRFX_PRS
  110. #define NRFX_PRS_ENABLED 1
  111. #endif
  112. #ifdef CONFIG_NRFX_PRS_BOX_0
  113. #define NRFX_PRS_BOX_0_ENABLED 1
  114. #endif
  115. #ifdef CONFIG_NRFX_PRS_BOX_1
  116. #define NRFX_PRS_BOX_1_ENABLED 1
  117. #endif
  118. #ifdef CONFIG_NRFX_PRS_BOX_2
  119. #define NRFX_PRS_BOX_2_ENABLED 1
  120. #endif
  121. #ifdef CONFIG_NRFX_PRS_BOX_3
  122. #define NRFX_PRS_BOX_3_ENABLED 1
  123. #endif
  124. #ifdef CONFIG_NRFX_PRS_BOX_4
  125. #define NRFX_PRS_BOX_4_ENABLED 1
  126. #endif
  127. #ifdef CONFIG_NRFX_PWM
  128. #define NRFX_PWM_ENABLED 1
  129. #endif
  130. #ifdef CONFIG_NRFX_PWM0
  131. #define NRFX_PWM0_ENABLED 1
  132. #endif
  133. #ifdef CONFIG_NRFX_PWM1
  134. #define NRFX_PWM1_ENABLED 1
  135. #endif
  136. #ifdef CONFIG_NRFX_PWM2
  137. #define NRFX_PWM2_ENABLED 1
  138. #endif
  139. #ifdef CONFIG_NRFX_PWM3
  140. #define NRFX_PWM3_ENABLED 1
  141. #endif
  142. #ifdef CONFIG_NRFX_QDEC
  143. #define NRFX_QDEC_ENABLED 1
  144. #endif
  145. #ifdef CONFIG_NRFX_QSPI
  146. #define NRFX_QSPI_ENABLED 1
  147. #endif
  148. #ifdef CONFIG_NRFX_RNG
  149. #define NRFX_RNG_ENABLED 1
  150. #endif
  151. #ifdef CONFIG_NRFX_RTC
  152. #define NRFX_RTC_ENABLED 1
  153. #endif
  154. #ifdef CONFIG_NRFX_RTC0
  155. #define NRFX_RTC0_ENABLED 1
  156. #endif
  157. #ifdef CONFIG_NRFX_RTC1
  158. #define NRFX_RTC1_ENABLED 1
  159. #endif
  160. #ifdef CONFIG_NRFX_RTC2
  161. #define NRFX_RTC2_ENABLED 1
  162. #endif
  163. #ifdef CONFIG_NRFX_SAADC
  164. #define NRFX_SAADC_ENABLED 1
  165. #endif
  166. #ifdef CONFIG_NRFX_SPI
  167. #define NRFX_SPI_ENABLED 1
  168. #endif
  169. #ifdef CONFIG_NRFX_SPI0
  170. #define NRFX_SPI0_ENABLED 1
  171. #endif
  172. #ifdef CONFIG_NRFX_SPI1
  173. #define NRFX_SPI1_ENABLED 1
  174. #endif
  175. #ifdef CONFIG_NRFX_SPI2
  176. #define NRFX_SPI2_ENABLED 1
  177. #endif
  178. #ifdef CONFIG_NRFX_SPIM
  179. #define NRFX_SPIM_ENABLED 1
  180. #endif
  181. #ifdef CONFIG_NRFX_SPIM0
  182. #define NRFX_SPIM0_ENABLED 1
  183. #endif
  184. #ifdef CONFIG_NRFX_SPIM1
  185. #define NRFX_SPIM1_ENABLED 1
  186. #endif
  187. #ifdef CONFIG_NRFX_SPIM2
  188. #define NRFX_SPIM2_ENABLED 1
  189. #endif
  190. #ifdef CONFIG_NRFX_SPIM3
  191. #define NRFX_SPIM3_ENABLED 1
  192. #endif
  193. #ifdef CONFIG_NRFX_SPIM4
  194. #define NRFX_SPIM4_ENABLED 1
  195. #endif
  196. #if defined(CONFIG_SPI_3_NRF_RX_DELAY) || defined(CONFIG_SPI_4_NRF_RX_DELAY)
  197. #define NRFX_SPIM_EXTENDED_ENABLED 1
  198. #endif
  199. #ifdef CONFIG_NRFX_SPIS
  200. #define NRFX_SPIS_ENABLED 1
  201. #endif
  202. #ifdef CONFIG_NRFX_SPIS0
  203. #define NRFX_SPIS0_ENABLED 1
  204. #endif
  205. #ifdef CONFIG_NRFX_SPIS1
  206. #define NRFX_SPIS1_ENABLED 1
  207. #endif
  208. #ifdef CONFIG_NRFX_SPIS2
  209. #define NRFX_SPIS2_ENABLED 1
  210. #endif
  211. #ifdef CONFIG_NRFX_SPIS3
  212. #define NRFX_SPIS3_ENABLED 1
  213. #endif
  214. #ifdef CONFIG_NRFX_SYSTICK
  215. #define NRFX_SYSTICK_ENABLED 1
  216. #endif
  217. #ifdef CONFIG_NRFX_TEMP
  218. #define NRFX_TEMP_ENABLED 1
  219. #endif
  220. #ifdef CONFIG_NRFX_TIMER
  221. #define NRFX_TIMER_ENABLED 1
  222. #endif
  223. #ifdef CONFIG_NRFX_TIMER0
  224. #define NRFX_TIMER0_ENABLED 1
  225. #endif
  226. #ifdef CONFIG_NRFX_TIMER1
  227. #define NRFX_TIMER1_ENABLED 1
  228. #endif
  229. #ifdef CONFIG_NRFX_TIMER2
  230. #define NRFX_TIMER2_ENABLED 1
  231. #endif
  232. #ifdef CONFIG_NRFX_TIMER3
  233. #define NRFX_TIMER3_ENABLED 1
  234. #endif
  235. #ifdef CONFIG_NRFX_TIMER4
  236. #define NRFX_TIMER4_ENABLED 1
  237. #endif
  238. #ifdef CONFIG_NRFX_TWI
  239. #define NRFX_TWI_ENABLED 1
  240. #endif
  241. #ifdef CONFIG_NRFX_TWI0
  242. #define NRFX_TWI0_ENABLED 1
  243. #endif
  244. #ifdef CONFIG_NRFX_TWI1
  245. #define NRFX_TWI1_ENABLED 1
  246. #endif
  247. #ifdef CONFIG_NRFX_TWIM
  248. #define NRFX_TWIM_ENABLED 1
  249. #endif
  250. #ifdef CONFIG_NRFX_TWIM0
  251. #define NRFX_TWIM0_ENABLED 1
  252. #endif
  253. #ifdef CONFIG_NRFX_TWIM1
  254. #define NRFX_TWIM1_ENABLED 1
  255. #endif
  256. #ifdef CONFIG_NRFX_TWIM2
  257. #define NRFX_TWIM2_ENABLED 1
  258. #endif
  259. #ifdef CONFIG_NRFX_TWIM3
  260. #define NRFX_TWIM3_ENABLED 1
  261. #endif
  262. #ifdef CONFIG_NRFX_TWIS
  263. #define NRFX_TWIS_ENABLED 1
  264. #endif
  265. #ifdef CONFIG_NRFX_TWIS0
  266. #define NRFX_TWIS0_ENABLED 1
  267. #endif
  268. #ifdef CONFIG_NRFX_TWIS1
  269. #define NRFX_TWIS1_ENABLED 1
  270. #endif
  271. #ifdef CONFIG_NRFX_TWIS2
  272. #define NRFX_TWIS2_ENABLED 1
  273. #endif
  274. #ifdef CONFIG_NRFX_TWIS3
  275. #define NRFX_TWIS3_ENABLED 1
  276. #endif
  277. #ifdef CONFIG_NRFX_UART
  278. #define NRFX_UART_ENABLED 1
  279. #endif
  280. #ifdef CONFIG_NRFX_UART0
  281. #define NRFX_UART0_ENABLED 1
  282. #endif
  283. #ifdef CONFIG_NRFX_UARTE
  284. #define NRFX_UARTE_ENABLED 1
  285. #endif
  286. #ifdef CONFIG_NRFX_UARTE0
  287. #define NRFX_UARTE0_ENABLED 1
  288. #endif
  289. #ifdef CONFIG_NRFX_UARTE1
  290. #define NRFX_UARTE1_ENABLED 1
  291. #endif
  292. #ifdef CONFIG_NRFX_UARTE2
  293. #define NRFX_UARTE2_ENABLED 1
  294. #endif
  295. #ifdef CONFIG_NRFX_UARTE3
  296. #define NRFX_UARTE3_ENABLED 1
  297. #endif
  298. #ifdef CONFIG_NRFX_USBD
  299. #define NRFX_USBD_ENABLED 1
  300. #endif
  301. #ifdef CONFIG_NRFX_USBREG
  302. #define NRFX_USBREG_ENABLED 1
  303. #endif
  304. #ifdef CONFIG_NRFX_WDT
  305. #define NRFX_WDT_ENABLED 1
  306. #endif
  307. #ifdef CONFIG_NRFX_WDT0
  308. #define NRFX_WDT0_ENABLED 1
  309. #endif
  310. #ifdef CONFIG_NRFX_WDT1
  311. #define NRFX_WDT1_ENABLED 1
  312. #endif
  313. #if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
  314. #include "nrfx_config_bsim.h"
  315. #endif
  316. /*
  317. * For chips with TrustZone support, MDK provides CMSIS-Core peripheral
  318. * accessing symbols in two flavors, with secure and non-secure base address
  319. * mappings. Their names contain the suffix _S or _NS, respectively.
  320. * Because nrfx HALs and drivers require these peripheral accessing symbols
  321. * without any suffixes, the following macro is provided that will translate
  322. * their names according to the kind of the target that is built.
  323. */
  324. #if defined(NRF_TRUSTZONE_NONSECURE)
  325. #define NRF_PERIPH(P) P##_NS
  326. #else
  327. #define NRF_PERIPH(P) P##_S
  328. #endif
  329. #if defined(NRF51)
  330. #include <nrfx_config_nrf51.h>
  331. #elif defined(NRF5340_XXAA_APPLICATION)
  332. #include <nrfx_config_nrf5340_application.h>
  333. #elif defined(NRF5340_XXAA_NETWORK)
  334. #include <nrfx_config_nrf5340_network.h>
  335. #elif defined(NRF9160_XXAA)
  336. #include <nrfx_config_nrf9160.h>
  337. #endif
  338. #endif // NRFX_CONFIG_H__