am_reg_rstgen.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. //*****************************************************************************
  2. //
  3. // am_reg_rstgen.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the RSTGEN module
  7. //
  8. //*****************************************************************************
  9. //*****************************************************************************
  10. //
  11. // Copyright (c) 2017, Ambiq Micro
  12. // All rights reserved.
  13. //
  14. // Redistribution and use in source and binary forms, with or without
  15. // modification, are permitted provided that the following conditions are met:
  16. //
  17. // 1. Redistributions of source code must retain the above copyright notice,
  18. // this list of conditions and the following disclaimer.
  19. //
  20. // 2. Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the distribution.
  23. //
  24. // 3. Neither the name of the copyright holder nor the names of its
  25. // contributors may be used to endorse or promote products derived from this
  26. // software without specific prior written permission.
  27. //
  28. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  32. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  34. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  35. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  37. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. // POSSIBILITY OF SUCH DAMAGE.
  39. //
  40. // This is part of revision 1.2.11 of the AmbiqSuite Development Package.
  41. //
  42. //*****************************************************************************
  43. #ifndef AM_REG_RSTGEN_H
  44. #define AM_REG_RSTGEN_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (1 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_RSTGEN_NUM_MODULES 1
  51. #define AM_REG_RSTGENn(n) \
  52. (REG_RSTGEN_BASEADDR + 0x00000000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_RSTGEN_CFG_O 0x00000000
  59. #define AM_REG_RSTGEN_SWPOI_O 0x00000004
  60. #define AM_REG_RSTGEN_SWPOR_O 0x00000008
  61. #define AM_REG_RSTGEN_STAT_O 0x0000000C
  62. #define AM_REG_RSTGEN_CLRSTAT_O 0x00000010
  63. #define AM_REG_RSTGEN_TPIU_RST_O 0x00000014
  64. #define AM_REG_RSTGEN_INTEN_O 0x00000200
  65. #define AM_REG_RSTGEN_INTSTAT_O 0x00000204
  66. #define AM_REG_RSTGEN_INTCLR_O 0x00000208
  67. #define AM_REG_RSTGEN_INTSET_O 0x0000020C
  68. //*****************************************************************************
  69. //
  70. // RSTGEN_INTEN - Reset Interrupt register: Enable
  71. //
  72. //*****************************************************************************
  73. // Enables an interrupt that triggers when VCC is below BODH level.
  74. #define AM_REG_RSTGEN_INTEN_BODH_S 0
  75. #define AM_REG_RSTGEN_INTEN_BODH_M 0x00000001
  76. #define AM_REG_RSTGEN_INTEN_BODH(n) (((uint32_t)(n) << 0) & 0x00000001)
  77. //*****************************************************************************
  78. //
  79. // RSTGEN_INTSTAT - Reset Interrupt register: Status
  80. //
  81. //*****************************************************************************
  82. // Enables an interrupt that triggers when VCC is below BODH level.
  83. #define AM_REG_RSTGEN_INTSTAT_BODH_S 0
  84. #define AM_REG_RSTGEN_INTSTAT_BODH_M 0x00000001
  85. #define AM_REG_RSTGEN_INTSTAT_BODH(n) (((uint32_t)(n) << 0) & 0x00000001)
  86. //*****************************************************************************
  87. //
  88. // RSTGEN_INTCLR - Reset Interrupt register: Clear
  89. //
  90. //*****************************************************************************
  91. // Enables an interrupt that triggers when VCC is below BODH level.
  92. #define AM_REG_RSTGEN_INTCLR_BODH_S 0
  93. #define AM_REG_RSTGEN_INTCLR_BODH_M 0x00000001
  94. #define AM_REG_RSTGEN_INTCLR_BODH(n) (((uint32_t)(n) << 0) & 0x00000001)
  95. //*****************************************************************************
  96. //
  97. // RSTGEN_INTSET - Reset Interrupt register: Set
  98. //
  99. //*****************************************************************************
  100. // Enables an interrupt that triggers when VCC is below BODH level.
  101. #define AM_REG_RSTGEN_INTSET_BODH_S 0
  102. #define AM_REG_RSTGEN_INTSET_BODH_M 0x00000001
  103. #define AM_REG_RSTGEN_INTSET_BODH(n) (((uint32_t)(n) << 0) & 0x00000001)
  104. //*****************************************************************************
  105. //
  106. // RSTGEN_CFG - Configuration Register
  107. //
  108. //*****************************************************************************
  109. // Watchdog Timer Reset Enable. NOTE: The WDT module must also be configured
  110. // for WDT reset.
  111. #define AM_REG_RSTGEN_CFG_WDREN_S 1
  112. #define AM_REG_RSTGEN_CFG_WDREN_M 0x00000002
  113. #define AM_REG_RSTGEN_CFG_WDREN(n) (((uint32_t)(n) << 1) & 0x00000002)
  114. // Brown out high (2.1v) reset enable.
  115. #define AM_REG_RSTGEN_CFG_BODHREN_S 0
  116. #define AM_REG_RSTGEN_CFG_BODHREN_M 0x00000001
  117. #define AM_REG_RSTGEN_CFG_BODHREN(n) (((uint32_t)(n) << 0) & 0x00000001)
  118. //*****************************************************************************
  119. //
  120. // RSTGEN_SWPOI - Software POI Reset
  121. //
  122. //*****************************************************************************
  123. // 0x1B generates a software POI reset.
  124. #define AM_REG_RSTGEN_SWPOI_SWPOIKEY_S 0
  125. #define AM_REG_RSTGEN_SWPOI_SWPOIKEY_M 0x000000FF
  126. #define AM_REG_RSTGEN_SWPOI_SWPOIKEY(n) (((uint32_t)(n) << 0) & 0x000000FF)
  127. #define AM_REG_RSTGEN_SWPOI_SWPOIKEY_KEYVALUE 0x0000001B
  128. //*****************************************************************************
  129. //
  130. // RSTGEN_SWPOR - Software POR Reset
  131. //
  132. //*****************************************************************************
  133. // 0xD4 generates a software POR reset.
  134. #define AM_REG_RSTGEN_SWPOR_SWPORKEY_S 0
  135. #define AM_REG_RSTGEN_SWPOR_SWPORKEY_M 0x000000FF
  136. #define AM_REG_RSTGEN_SWPOR_SWPORKEY(n) (((uint32_t)(n) << 0) & 0x000000FF)
  137. #define AM_REG_RSTGEN_SWPOR_SWPORKEY_KEYVALUE 0x000000D4
  138. //*****************************************************************************
  139. //
  140. // RSTGEN_STAT - Status Register
  141. //
  142. //*****************************************************************************
  143. // Reset was initiated by a Watchdog Timer Reset.
  144. #define AM_REG_RSTGEN_STAT_WDRSTAT_S 6
  145. #define AM_REG_RSTGEN_STAT_WDRSTAT_M 0x00000040
  146. #define AM_REG_RSTGEN_STAT_WDRSTAT(n) (((uint32_t)(n) << 6) & 0x00000040)
  147. // Reset was a initiated by Debugger Reset.
  148. #define AM_REG_RSTGEN_STAT_DBGRSTAT_S 5
  149. #define AM_REG_RSTGEN_STAT_DBGRSTAT_M 0x00000020
  150. #define AM_REG_RSTGEN_STAT_DBGRSTAT(n) (((uint32_t)(n) << 5) & 0x00000020)
  151. // Reset was a initiated by Software POI Reset.
  152. #define AM_REG_RSTGEN_STAT_POIRSTAT_S 4
  153. #define AM_REG_RSTGEN_STAT_POIRSTAT_M 0x00000010
  154. #define AM_REG_RSTGEN_STAT_POIRSTAT(n) (((uint32_t)(n) << 4) & 0x00000010)
  155. // Reset was a initiated by SW POR or AIRCR Reset.
  156. #define AM_REG_RSTGEN_STAT_SWRSTAT_S 3
  157. #define AM_REG_RSTGEN_STAT_SWRSTAT_M 0x00000008
  158. #define AM_REG_RSTGEN_STAT_SWRSTAT(n) (((uint32_t)(n) << 3) & 0x00000008)
  159. // Reset was initiated by a Brown-Out Reset.
  160. #define AM_REG_RSTGEN_STAT_BORSTAT_S 2
  161. #define AM_REG_RSTGEN_STAT_BORSTAT_M 0x00000004
  162. #define AM_REG_RSTGEN_STAT_BORSTAT(n) (((uint32_t)(n) << 2) & 0x00000004)
  163. // Reset was initiated by a Power-On Reset.
  164. #define AM_REG_RSTGEN_STAT_PORSTAT_S 1
  165. #define AM_REG_RSTGEN_STAT_PORSTAT_M 0x00000002
  166. #define AM_REG_RSTGEN_STAT_PORSTAT(n) (((uint32_t)(n) << 1) & 0x00000002)
  167. // Reset was initiated by an External Reset.
  168. #define AM_REG_RSTGEN_STAT_EXRSTAT_S 0
  169. #define AM_REG_RSTGEN_STAT_EXRSTAT_M 0x00000001
  170. #define AM_REG_RSTGEN_STAT_EXRSTAT(n) (((uint32_t)(n) << 0) & 0x00000001)
  171. //*****************************************************************************
  172. //
  173. // RSTGEN_CLRSTAT - Clear the status register
  174. //
  175. //*****************************************************************************
  176. // Writing a 1 to this bit clears all bits in the RST_STAT.
  177. #define AM_REG_RSTGEN_CLRSTAT_CLRSTAT_S 0
  178. #define AM_REG_RSTGEN_CLRSTAT_CLRSTAT_M 0x00000001
  179. #define AM_REG_RSTGEN_CLRSTAT_CLRSTAT(n) (((uint32_t)(n) << 0) & 0x00000001)
  180. //*****************************************************************************
  181. //
  182. // RSTGEN_TPIU_RST - TPIU reset
  183. //
  184. //*****************************************************************************
  185. // Static reset for the TPIU. Write to '1' to assert reset to TPIU. Write to '0'
  186. // to clear the reset.
  187. #define AM_REG_RSTGEN_TPIU_RST_TPIURST_S 0
  188. #define AM_REG_RSTGEN_TPIU_RST_TPIURST_M 0x00000001
  189. #define AM_REG_RSTGEN_TPIU_RST_TPIURST(n) (((uint32_t)(n) << 0) & 0x00000001)
  190. #endif // AM_REG_RSTGEN_H