nrf.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. Copyright (c) 2010 - 2020, Nordic Semiconductor ASA
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without modification,
  5. are permitted provided that the following conditions are met:
  6. 1. Redistributions of source code must retain the above copyright notice, this
  7. list of conditions and the following disclaimer.
  8. 2. Redistributions in binary form, except as embedded into a Nordic
  9. Semiconductor ASA integrated circuit in a product or a software update for
  10. such product, must reproduce the above copyright notice, this list of
  11. conditions and the following disclaimer in the documentation and/or other
  12. materials provided with the distribution.
  13. 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  14. contributors may be used to endorse or promote products derived from this
  15. software without specific prior written permission.
  16. 4. This software, with or without modification, must only be used with a
  17. Nordic Semiconductor ASA integrated circuit.
  18. 5. Any software provided in binary form under this license must not be reverse
  19. engineered, decompiled, modified and/or disassembled.
  20. THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  21. OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  22. OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  23. DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  24. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  26. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  27. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  28. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  29. OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. #ifndef NRF_H
  32. #define NRF_H
  33. /* MDK version */
  34. #define MDK_MAJOR_VERSION 8
  35. #define MDK_MINOR_VERSION 32
  36. #define MDK_MICRO_VERSION 1
  37. /* Define NRF51_SERIES for common use in nRF51 series devices. Only if not previously defined. */
  38. #if defined (NRF51) ||\
  39. defined (NRF51422_XXAA) ||\
  40. defined (NRF51422_XXAB) ||\
  41. defined (NRF51422_XXAC) ||\
  42. defined (NRF51801_XXAB) ||\
  43. defined (NRF51802_XXAA) ||\
  44. defined (NRF51822_XXAA) ||\
  45. defined (NRF51822_XXAB) ||\
  46. defined (NRF51822_XXAC) ||\
  47. defined (NRF51824_XXAA)
  48. #ifndef NRF51_SERIES
  49. #define NRF51_SERIES
  50. #endif
  51. #ifndef NRF51
  52. #define NRF51
  53. #endif
  54. #endif
  55. /* Redefine "old" too-generic name NRF52 to NRF52832_XXAA to keep backwards compatibility. */
  56. #if defined (NRF52)
  57. #ifndef NRF52832_XXAA
  58. #define NRF52832_XXAA
  59. #endif
  60. #endif
  61. /* Define NRF52_SERIES for common use in nRF52 series devices. Only if not previously defined. */
  62. #if defined (NRF52805_XXAA) || defined (NRF52810_XXAA) || defined (NRF52811_XXAA) || defined (NRF52820_XXAA) || defined (NRF52832_XXAA) || defined (NRF52832_XXAB) || defined (NRF52833_XXAA) || defined (NRF52840_XXAA)
  63. #ifndef NRF52_SERIES
  64. #define NRF52_SERIES
  65. #endif
  66. #endif
  67. /* Define NRF53_SERIES for common use in nRF53 series devices. */
  68. #if defined (NRF5340_XXAA_APPLICATION) || defined (NRF5340_XXAA_NETWORK)
  69. #ifndef NRF53_SERIES
  70. #define NRF53_SERIES
  71. #endif
  72. #endif
  73. /* Define NRF91_SERIES for common use in nRF91 series devices. */
  74. #if defined (NRF9160_XXAA)
  75. #ifndef NRF91_SERIES
  76. #define NRF91_SERIES
  77. #endif
  78. #endif
  79. /* Define coprocessor domains */
  80. #if defined (NRF5340_XXAA_APPLICATION) || defined (NRF5340_XXAA_NETWORK)
  81. #ifndef NRF5340_XXAA
  82. #define NRF5340_XXAA
  83. #endif
  84. #endif
  85. #if defined (NRF5340_XXAA_APPLICATION)
  86. #ifndef NRF_APPLICATION
  87. #define NRF_APPLICATION
  88. #endif
  89. #endif
  90. #if defined (NRF5340_XXAA_NETWORK)
  91. #ifndef NRF_NETWORK
  92. #define NRF_NETWORK
  93. #endif
  94. #endif
  95. /* Apply compatibility macros for old nRF5340 macros */
  96. #if defined(NRF5340_XXAA)
  97. #if defined (NRF_APPLICATION)
  98. #ifndef NRF5340_XXAA_APPLICATION
  99. #define NRF5340_XXAA_APPLICATION
  100. #endif
  101. #endif
  102. #if defined (NRF_NETWORK)
  103. #ifndef NRF5340_XXAA_NETWORK
  104. #define NRF5340_XXAA_NETWORK
  105. #endif
  106. #endif
  107. #endif
  108. #if defined(_WIN32)
  109. /* Do not include nrf specific files when building for PC host */
  110. #elif defined(__unix)
  111. /* Do not include nrf specific files when building for PC host */
  112. #elif defined(__APPLE__)
  113. /* Do not include nrf specific files when building for PC host */
  114. #else
  115. /* Device selection for device includes. */
  116. #if defined (NRF51)
  117. #include "nrf51.h"
  118. #include "nrf51_bitfields.h"
  119. #include "nrf51_deprecated.h"
  120. #elif defined (NRF52805_XXAA)
  121. #include "nrf52805.h"
  122. #include "nrf52805_bitfields.h"
  123. #include "nrf51_to_nrf52810.h"
  124. #include "nrf52_to_nrf52810.h"
  125. #include "nrf52810_to_nrf52811.h"
  126. #elif defined (NRF52810_XXAA)
  127. #include "nrf52810.h"
  128. #include "nrf52810_bitfields.h"
  129. #include "nrf51_to_nrf52810.h"
  130. #include "nrf52_to_nrf52810.h"
  131. #include "nrf52810_name_change.h"
  132. #elif defined (NRF52811_XXAA)
  133. #include "nrf52811.h"
  134. #include "nrf52811_bitfields.h"
  135. #include "nrf51_to_nrf52810.h"
  136. #include "nrf52_to_nrf52810.h"
  137. #include "nrf52810_to_nrf52811.h"
  138. #elif defined (NRF52820_XXAA)
  139. #include "nrf52820.h"
  140. #include "nrf52820_bitfields.h"
  141. #include "nrf51_to_nrf52.h"
  142. #include "nrf52_to_nrf52833.h"
  143. #include "nrf52833_to_nrf52820.h"
  144. #elif defined (NRF52832_XXAA) || defined (NRF52832_XXAB)
  145. #include "nrf52.h"
  146. #include "nrf52_bitfields.h"
  147. #include "nrf51_to_nrf52.h"
  148. #include "nrf52_name_change.h"
  149. #elif defined (NRF52833_XXAA)
  150. #include "nrf52833.h"
  151. #include "nrf52833_bitfields.h"
  152. #include "nrf52_to_nrf52833.h"
  153. #include "nrf51_to_nrf52.h"
  154. #elif defined (NRF52840_XXAA)
  155. #include "nrf52840.h"
  156. #include "nrf52840_bitfields.h"
  157. #include "nrf51_to_nrf52840.h"
  158. #include "nrf52_to_nrf52840.h"
  159. #elif defined (NRF5340_XXAA)
  160. #if defined(NRF_APPLICATION)
  161. #include "nrf5340_application.h"
  162. #include "nrf5340_application_bitfields.h"
  163. #elif defined (NRF_NETWORK)
  164. #include "nrf5340_network.h"
  165. #include "nrf5340_network_bitfields.h"
  166. #endif
  167. #elif defined (NRF9160_XXAA)
  168. #include "nrf9160.h"
  169. #include "nrf9160_bitfields.h"
  170. #include "nrf9160_name_change.h"
  171. #else
  172. #error "Device must be defined. See nrf.h."
  173. #endif /* NRF51, NRF52805_XXAA, NRF52810_XXAA, NRF52811_XXAA, NRF52820_XXAA, NRF52832_XXAA, NRF52832_XXAB, NRF52833_XXAA, NRF52840_XXAA, NRF5340_XXAA_APPLICATION, NRF5340_XXAA_NETWORK, NRF9160_XXAA */
  174. #include "compiler_abstraction.h"
  175. #endif /* _WIN32 || __unix || __APPLE__ */
  176. #endif /* NRF_H */