nrf52_to_nrf52810.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. Copyright (c) 2010 - 2018, 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 NRF52_TO_NRF52810_H
  32. #define NRF52_TO_NRF52810_H
  33. /*lint ++flb "Enter library region */
  34. /* This file is given to prevent your SW from not compiling with the name changes between nRF51 or nRF52832 and nRF52810 devices.
  35. * It redefines the old nRF51 or nRF52832 names into the new ones as long as the functionality is still supported. If the
  36. * functionality is gone, there old names are not defined, so compilation will fail. Note that also includes macros
  37. * from the nrf52_namechange.h file. */
  38. /* Differences between latest nRF52 headers and nRF52810 headers. */
  39. /* Interrupt service routines handlers. Note that handlers SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler and
  40. SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler are not redefined since functionality is not equivalent. */
  41. #ifndef COMP_LPCOMP_IRQHandler
  42. #define COMP_LPCOMP_IRQHandler COMP_IRQHandler
  43. #endif
  44. #ifndef SWI2_EGU2_IRQHandler
  45. #define SWI2_EGU2_IRQHandler SWI2_IRQHandler
  46. #endif
  47. #ifndef SWI3_EGU3_IRQHandler
  48. #define SWI3_EGU3_IRQHandler SWI3_IRQHandler
  49. #endif
  50. #ifndef SWI4_EGU4_IRQHandler
  51. #define SWI4_EGU4_IRQHandler SWI4_IRQHandler
  52. #endif
  53. #ifndef SWI5_EGU5_IRQHandler
  54. #define SWI5_EGU5_IRQHandler SWI5_IRQHandler
  55. #endif
  56. /* Interrupt service routines index. Note that indexes SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn and
  57. SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn are not redefined since functionality is not equivalent. */
  58. #ifndef COMP_LPCOMP_IRQn
  59. #define COMP_LPCOMP_IRQn COMP_IRQn
  60. #endif
  61. #ifndef SWI2_EGU2_IRQn
  62. #define SWI2_EGU2_IRQn SWI2_IRQn
  63. #endif
  64. #ifndef SWI3_EGU3_IRQn
  65. #define SWI3_EGU3_IRQn SWI3_IRQn
  66. #endif
  67. #ifndef SWI4_EGU4_IRQn
  68. #define SWI4_EGU4_IRQn SWI4_IRQn
  69. #endif
  70. #ifndef SWI5_EGU5_IRQn
  71. #define SWI5_EGU5_IRQn SWI5_IRQn
  72. #endif
  73. /* From nrf52_name_change.h. Several macros changed in different versions of nRF52 headers. By defining the following, any code written for any version of nRF52 headers will still compile. */
  74. /* I2S */
  75. /* Several enumerations changed case. Adding old macros to keep compilation compatibility. */
  76. #ifndef I2S_ENABLE_ENABLE_DISABLE
  77. #define I2S_ENABLE_ENABLE_DISABLE I2S_ENABLE_ENABLE_Disabled
  78. #endif
  79. #ifndef I2S_ENABLE_ENABLE_ENABLE
  80. #define I2S_ENABLE_ENABLE_ENABLE I2S_ENABLE_ENABLE_Enabled
  81. #endif
  82. #ifndef I2S_CONFIG_MODE_MODE_MASTER
  83. #define I2S_CONFIG_MODE_MODE_MASTER I2S_CONFIG_MODE_MODE_Master
  84. #endif
  85. #ifndef I2S_CONFIG_MODE_MODE_SLAVE
  86. #define I2S_CONFIG_MODE_MODE_SLAVE I2S_CONFIG_MODE_MODE_Slave
  87. #endif
  88. #ifndef I2S_CONFIG_RXEN_RXEN_DISABLE
  89. #define I2S_CONFIG_RXEN_RXEN_DISABLE I2S_CONFIG_RXEN_RXEN_Disabled
  90. #endif
  91. #ifndef I2S_CONFIG_RXEN_RXEN_ENABLE
  92. #define I2S_CONFIG_RXEN_RXEN_ENABLE I2S_CONFIG_RXEN_RXEN_Enabled
  93. #endif
  94. #ifndef I2S_CONFIG_TXEN_TXEN_DISABLE
  95. #define I2S_CONFIG_TXEN_TXEN_DISABLE I2S_CONFIG_TXEN_TXEN_Disabled
  96. #endif
  97. #ifndef I2S_CONFIG_TXEN_TXEN_ENABLE
  98. #define I2S_CONFIG_TXEN_TXEN_ENABLE I2S_CONFIG_TXEN_TXEN_Enabled
  99. #endif
  100. #ifndef I2S_CONFIG_MCKEN_MCKEN_DISABLE
  101. #define I2S_CONFIG_MCKEN_MCKEN_DISABLE I2S_CONFIG_MCKEN_MCKEN_Disabled
  102. #endif
  103. #ifndef I2S_CONFIG_MCKEN_MCKEN_ENABLE
  104. #define I2S_CONFIG_MCKEN_MCKEN_ENABLE I2S_CONFIG_MCKEN_MCKEN_Enabled
  105. #endif
  106. #ifndef I2S_CONFIG_SWIDTH_SWIDTH_8BIT
  107. #define I2S_CONFIG_SWIDTH_SWIDTH_8BIT I2S_CONFIG_SWIDTH_SWIDTH_8Bit
  108. #endif
  109. #ifndef I2S_CONFIG_SWIDTH_SWIDTH_16BIT
  110. #define I2S_CONFIG_SWIDTH_SWIDTH_16BIT I2S_CONFIG_SWIDTH_SWIDTH_16Bit
  111. #endif
  112. #ifndef I2S_CONFIG_SWIDTH_SWIDTH_24BIT
  113. #define I2S_CONFIG_SWIDTH_SWIDTH_24BIT I2S_CONFIG_SWIDTH_SWIDTH_24Bit
  114. #endif
  115. #ifndef I2S_CONFIG_ALIGN_ALIGN_LEFT
  116. #define I2S_CONFIG_ALIGN_ALIGN_LEFT I2S_CONFIG_ALIGN_ALIGN_Left
  117. #endif
  118. #ifndef I2S_CONFIG_ALIGN_ALIGN_RIGHT
  119. #define I2S_CONFIG_ALIGN_ALIGN_RIGHT I2S_CONFIG_ALIGN_ALIGN_Right
  120. #endif
  121. #ifndef I2S_CONFIG_FORMAT_FORMAT_ALIGNED
  122. #define I2S_CONFIG_FORMAT_FORMAT_ALIGNED I2S_CONFIG_FORMAT_FORMAT_Aligned
  123. #endif
  124. #ifndef I2S_CONFIG_CHANNELS_CHANNELS_STEREO
  125. #define I2S_CONFIG_CHANNELS_CHANNELS_STEREO I2S_CONFIG_CHANNELS_CHANNELS_Stereo
  126. #endif
  127. #ifndef I2S_CONFIG_CHANNELS_CHANNELS_LEFT
  128. #define I2S_CONFIG_CHANNELS_CHANNELS_LEFT I2S_CONFIG_CHANNELS_CHANNELS_Left
  129. #endif
  130. #ifndef I2S_CONFIG_CHANNELS_CHANNELS_RIGHT
  131. #define I2S_CONFIG_CHANNELS_CHANNELS_RIGHT I2S_CONFIG_CHANNELS_CHANNELS_Right
  132. #endif
  133. /* LPCOMP */
  134. /* Corrected typo in RESULT register. */
  135. #ifndef LPCOMP_RESULT_RESULT_Bellow
  136. #define LPCOMP_RESULT_RESULT_Bellow LPCOMP_RESULT_RESULT_Below
  137. #endif
  138. /*lint --flb "Leave library region" */
  139. #endif /* NRF52_TO_NRF52810_H */