nrf52_to_nrf52810.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #define UARTE0_UART0_IRQHandler UARTE0_IRQHandler
  42. #define COMP_LPCOMP_IRQHandler COMP_IRQHandler
  43. #define SWI2_EGU2_IRQHandler SWI2_IRQHandler
  44. #define SWI3_EGU3_IRQHandler SWI3_IRQHandler
  45. #define SWI4_EGU4_IRQHandler SWI4_IRQHandler
  46. #define SWI5_EGU5_IRQHandler SWI5_IRQHandler
  47. /* Interrupt service routines index. Note that indexes SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn and
  48. SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn are not redefined since functionality is not equivalent. */
  49. #define UARTE0_UART0_IRQn UARTE0_IRQn
  50. #define COMP_LPCOMP_IRQn COMP_IRQn
  51. #define SWI2_EGU2_IRQn SWI2_IRQn
  52. #define SWI3_EGU3_IRQn SWI3_IRQn
  53. #define SWI4_EGU4_IRQn SWI4_IRQn
  54. #define SWI5_EGU5_IRQn SWI5_IRQn
  55. /* 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. */
  56. /* I2S */
  57. /* Several enumerations changed case. Adding old macros to keep compilation compatibility. */
  58. #define I2S_ENABLE_ENABLE_DISABLE I2S_ENABLE_ENABLE_Disabled
  59. #define I2S_ENABLE_ENABLE_ENABLE I2S_ENABLE_ENABLE_Enabled
  60. #define I2S_CONFIG_MODE_MODE_MASTER I2S_CONFIG_MODE_MODE_Master
  61. #define I2S_CONFIG_MODE_MODE_SLAVE I2S_CONFIG_MODE_MODE_Slave
  62. #define I2S_CONFIG_RXEN_RXEN_DISABLE I2S_CONFIG_RXEN_RXEN_Disabled
  63. #define I2S_CONFIG_RXEN_RXEN_ENABLE I2S_CONFIG_RXEN_RXEN_Enabled
  64. #define I2S_CONFIG_TXEN_TXEN_DISABLE I2S_CONFIG_TXEN_TXEN_Disabled
  65. #define I2S_CONFIG_TXEN_TXEN_ENABLE I2S_CONFIG_TXEN_TXEN_Enabled
  66. #define I2S_CONFIG_MCKEN_MCKEN_DISABLE I2S_CONFIG_MCKEN_MCKEN_Disabled
  67. #define I2S_CONFIG_MCKEN_MCKEN_ENABLE I2S_CONFIG_MCKEN_MCKEN_Enabled
  68. #define I2S_CONFIG_SWIDTH_SWIDTH_8BIT I2S_CONFIG_SWIDTH_SWIDTH_8Bit
  69. #define I2S_CONFIG_SWIDTH_SWIDTH_16BIT I2S_CONFIG_SWIDTH_SWIDTH_16Bit
  70. #define I2S_CONFIG_SWIDTH_SWIDTH_24BIT I2S_CONFIG_SWIDTH_SWIDTH_24Bit
  71. #define I2S_CONFIG_ALIGN_ALIGN_LEFT I2S_CONFIG_ALIGN_ALIGN_Left
  72. #define I2S_CONFIG_ALIGN_ALIGN_RIGHT I2S_CONFIG_ALIGN_ALIGN_Right
  73. #define I2S_CONFIG_FORMAT_FORMAT_ALIGNED I2S_CONFIG_FORMAT_FORMAT_Aligned
  74. #define I2S_CONFIG_CHANNELS_CHANNELS_STEREO I2S_CONFIG_CHANNELS_CHANNELS_Stereo
  75. #define I2S_CONFIG_CHANNELS_CHANNELS_LEFT I2S_CONFIG_CHANNELS_CHANNELS_Left
  76. #define I2S_CONFIG_CHANNELS_CHANNELS_RIGHT I2S_CONFIG_CHANNELS_CHANNELS_Right
  77. /* LPCOMP */
  78. /* Corrected typo in RESULT register. */
  79. #define LPCOMP_RESULT_RESULT_Bellow LPCOMP_RESULT_RESULT_Below
  80. /*lint --flb "Leave library region" */
  81. #endif /* NRF51_TO_NRF52810_H */