nrfx_glue.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /**
  2. * Copyright (c) 2017 - 2018, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef NRFX_GLUE_H__
  41. #define NRFX_GLUE_H__
  42. // THIS IS A TEMPLATE FILE.
  43. // It should be copied to a suitable location within the host environment into
  44. // which nrfx is integrated, and the following macros should be provided with
  45. // appropriate implementations.
  46. // And this comment should be removed from the customized file.
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. /**
  51. * @defgroup nrfx_glue nrfx_glue.h
  52. * @{
  53. * @ingroup nrfx
  54. *
  55. * @brief This file contains macros that should be implemented according to
  56. * the needs of the host environment into which @em nrfx is integrated.
  57. */
  58. // Uncomment this line to use the standard MDK way of binding IRQ handlers
  59. // at linking time.
  60. //#include <soc/nrfx_irqs.h>
  61. //------------------------------------------------------------------------------
  62. /**
  63. * @brief Macro for placing a runtime assertion.
  64. *
  65. * @param expression Expression to evaluate.
  66. */
  67. #define NRFX_ASSERT(expression)
  68. /**
  69. * @brief Macro for placing a compile time assertion.
  70. *
  71. * @param expression Expression to evaluate.
  72. */
  73. #define NRFX_STATIC_ASSERT(expression)
  74. //------------------------------------------------------------------------------
  75. /**
  76. * @brief Macro for setting the priority of a specific IRQ.
  77. *
  78. * @param irq_number IRQ number.
  79. * @param priority Priority to set.
  80. */
  81. #define NRFX_IRQ_PRIORITY_SET(irq_number, priority)
  82. /**
  83. * @brief Macro for enabling a specific IRQ.
  84. *
  85. * @param irq_number IRQ number.
  86. */
  87. #define NRFX_IRQ_ENABLE(irq_number)
  88. /**
  89. * @brief Macro for checking if a specific IRQ is enabled.
  90. *
  91. * @param irq_number IRQ number.
  92. *
  93. * @retval true If the IRQ is enabled.
  94. * @retval false Otherwise.
  95. */
  96. #define NRFX_IRQ_IS_ENABLED(irq_number)
  97. /**
  98. * @brief Macro for disabling a specific IRQ.
  99. *
  100. * @param irq_number IRQ number.
  101. */
  102. #define NRFX_IRQ_DISABLE(irq_number)
  103. /**
  104. * @brief Macro for setting a specific IRQ as pending.
  105. *
  106. * @param irq_number IRQ number.
  107. */
  108. #define NRFX_IRQ_PENDING_SET(irq_number)
  109. /**
  110. * @brief Macro for clearing the pending status of a specific IRQ.
  111. *
  112. * @param irq_number IRQ number.
  113. */
  114. #define NRFX_IRQ_PENDING_CLEAR(irq_number)
  115. /**
  116. * @brief Macro for checking the pending status of a specific IRQ.
  117. *
  118. * @retval true If the IRQ is pending.
  119. * @retval false Otherwise.
  120. */
  121. #define NRFX_IRQ_IS_PENDING(irq_number)
  122. /**
  123. * @brief Macro for entering into a critical section.
  124. */
  125. #define NRFX_CRITICAL_SECTION_ENTER()
  126. /**
  127. * @brief Macro for exiting from a critical section.
  128. */
  129. #define NRFX_CRITICAL_SECTION_EXIT()
  130. //------------------------------------------------------------------------------
  131. /**
  132. * @brief When set to a non-zero value, this macro specifies that
  133. * @ref nrfx_coredep_delay_us uses a precise DWT-based solution.
  134. * A compilation error is generated if the DWT unit is not present
  135. * in the SoC used.
  136. */
  137. #define NRFX_DELAY_DWT_BASED 0
  138. /**
  139. * @brief Macro for delaying the code execution for at least the specified time.
  140. *
  141. * @param us_time Number of microseconds to wait.
  142. */
  143. #define NRFX_DELAY_US(us_time)
  144. //------------------------------------------------------------------------------
  145. /**
  146. * @brief When set to a non-zero value, this macro specifies that the
  147. * @ref nrfx_error_codes and the @ref nrfx_err_t type itself are defined
  148. * in a customized way and the default definitions from @c <nrfx_error.h>
  149. * should not be used.
  150. */
  151. #define NRFX_CUSTOM_ERROR_CODES 0
  152. //------------------------------------------------------------------------------
  153. /**
  154. * @brief Bitmask defining PPI channels reserved to be used outside of nrfx.
  155. */
  156. #define NRFX_PPI_CHANNELS_USED 0
  157. /**
  158. * @brief Bitmask defining PPI groups reserved to be used outside of nrfx.
  159. */
  160. #define NRFX_PPI_GROUPS_USED 0
  161. /**
  162. * @brief Bitmask defining SWI instances reserved to be used outside of nrfx.
  163. */
  164. #define NRFX_SWI_USED 0
  165. /**
  166. * @brief Bitmask defining TIMER instances reserved to be used outside of nrfx.
  167. */
  168. #define NRFX_TIMERS_USED 0
  169. /** @} */
  170. #ifdef __cplusplus
  171. }
  172. #endif
  173. #endif // NRFX_GLUE_H__