am_reg_mcuctrl.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. //*****************************************************************************
  2. //
  3. // am_reg_mcuctrl.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the MCUCTRL 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_MCUCTRL_H
  44. #define AM_REG_MCUCTRL_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (1 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_MCUCTRL_NUM_MODULES 1
  51. #define AM_REG_MCUCTRLn(n) \
  52. (REG_MCUCTRL_BASEADDR + 0x00000000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_MCUCTRL_CHIP_INFO_O 0x00000000
  59. #define AM_REG_MCUCTRL_CHIPID0_O 0x00000004
  60. #define AM_REG_MCUCTRL_CHIPID1_O 0x00000008
  61. #define AM_REG_MCUCTRL_CHIPREV_O 0x0000000C
  62. #define AM_REG_MCUCTRL_VENDORID_O 0x00000010
  63. #define AM_REG_MCUCTRL_DEBUGGER_O 0x00000014
  64. #define AM_REG_MCUCTRL_BUCK_O 0x00000060
  65. #define AM_REG_MCUCTRL_BUCK3_O 0x00000068
  66. #define AM_REG_MCUCTRL_LDOREG1_O 0x00000080
  67. #define AM_REG_MCUCTRL_LDOREG3_O 0x00000088
  68. #define AM_REG_MCUCTRL_BODPORCTRL_O 0x00000100
  69. #define AM_REG_MCUCTRL_ADCPWRDLY_O 0x00000104
  70. #define AM_REG_MCUCTRL_ADCCAL_O 0x0000010C
  71. #define AM_REG_MCUCTRL_ADCBATTLOAD_O 0x00000110
  72. #define AM_REG_MCUCTRL_BUCKTRIM_O 0x00000114
  73. #define AM_REG_MCUCTRL_BOOTLOADERLOW_O 0x000001A0
  74. #define AM_REG_MCUCTRL_SHADOWVALID_O 0x000001A4
  75. #define AM_REG_MCUCTRL_ICODEFAULTADDR_O 0x000001C0
  76. #define AM_REG_MCUCTRL_DCODEFAULTADDR_O 0x000001C4
  77. #define AM_REG_MCUCTRL_SYSFAULTADDR_O 0x000001C8
  78. #define AM_REG_MCUCTRL_FAULTSTATUS_O 0x000001CC
  79. #define AM_REG_MCUCTRL_FAULTCAPTUREEN_O 0x000001D0
  80. #define AM_REG_MCUCTRL_DBGR1_O 0x00000200
  81. #define AM_REG_MCUCTRL_DBGR2_O 0x00000204
  82. #define AM_REG_MCUCTRL_PMUENABLE_O 0x00000220
  83. #define AM_REG_MCUCTRL_TPIUCTRL_O 0x00000250
  84. //*****************************************************************************
  85. //
  86. // Key values.
  87. //
  88. //*****************************************************************************
  89. //*****************************************************************************
  90. //
  91. // MCUCTRL_CHIP_INFO - Chip Information Register
  92. //
  93. //*****************************************************************************
  94. // BCD part number.
  95. #define AM_REG_MCUCTRL_CHIP_INFO_PARTNUM_S 0
  96. #define AM_REG_MCUCTRL_CHIP_INFO_PARTNUM_M 0xFFFFFFFF
  97. #define AM_REG_MCUCTRL_CHIP_INFO_PARTNUM(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  98. #define AM_REG_MCUCTRL_CHIP_INFO_PARTNUM_APOLLO2 0x03000000
  99. #define AM_REG_MCUCTRL_CHIP_INFO_PARTNUM_APOLLO 0x01000000
  100. #define AM_REG_MCUCTRL_CHIP_INFO_PARTNUM_PN_M 0xFF000000
  101. //*****************************************************************************
  102. //
  103. // MCUCTRL_CHIPID0 - Unique Chip ID 0
  104. //
  105. //*****************************************************************************
  106. // Unique chip ID 0.
  107. #define AM_REG_MCUCTRL_CHIPID0_VALUE_S 0
  108. #define AM_REG_MCUCTRL_CHIPID0_VALUE_M 0xFFFFFFFF
  109. #define AM_REG_MCUCTRL_CHIPID0_VALUE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  110. #define AM_REG_MCUCTRL_CHIPID0_VALUE_APOLLO2 0x00000000
  111. //*****************************************************************************
  112. //
  113. // MCUCTRL_CHIPID1 - Unique Chip ID 1
  114. //
  115. //*****************************************************************************
  116. // Unique chip ID 1.
  117. #define AM_REG_MCUCTRL_CHIPID1_VALUE_S 0
  118. #define AM_REG_MCUCTRL_CHIPID1_VALUE_M 0xFFFFFFFF
  119. #define AM_REG_MCUCTRL_CHIPID1_VALUE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  120. #define AM_REG_MCUCTRL_CHIPID1_VALUE_APOLLO2 0x00000000
  121. //*****************************************************************************
  122. //
  123. // MCUCTRL_CHIPREV - Chip Revision
  124. //
  125. //*****************************************************************************
  126. // Major Revision ID.
  127. #define AM_REG_MCUCTRL_CHIPREV_REVMAJ_S 4
  128. #define AM_REG_MCUCTRL_CHIPREV_REVMAJ_M 0x000000F0
  129. #define AM_REG_MCUCTRL_CHIPREV_REVMAJ(n) (((uint32_t)(n) << 4) & 0x000000F0)
  130. #define AM_REG_MCUCTRL_CHIPREV_REVMAJ_B 0x00000020
  131. #define AM_REG_MCUCTRL_CHIPREV_REVMAJ_A 0x00000010
  132. // Minor Revision ID.
  133. #define AM_REG_MCUCTRL_CHIPREV_REVMIN_S 0
  134. #define AM_REG_MCUCTRL_CHIPREV_REVMIN_M 0x0000000F
  135. #define AM_REG_MCUCTRL_CHIPREV_REVMIN(n) (((uint32_t)(n) << 0) & 0x0000000F)
  136. #define AM_REG_MCUCTRL_CHIPREV_REVMIN_REV0 0x00000000
  137. #define AM_REG_MCUCTRL_CHIPREV_REVMIN_REV2 0x00000002
  138. //*****************************************************************************
  139. //
  140. // MCUCTRL_VENDORID - Unique Vendor ID
  141. //
  142. //*****************************************************************************
  143. // Unique Vendor ID
  144. #define AM_REG_MCUCTRL_VENDORID_VALUE_S 0
  145. #define AM_REG_MCUCTRL_VENDORID_VALUE_M 0xFFFFFFFF
  146. #define AM_REG_MCUCTRL_VENDORID_VALUE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  147. #define AM_REG_MCUCTRL_VENDORID_VALUE_AMBIQ 0x414D4251
  148. //*****************************************************************************
  149. //
  150. // MCUCTRL_DEBUGGER - Debugger Access Control
  151. //
  152. //*****************************************************************************
  153. // Lockout of debugger (SWD).
  154. #define AM_REG_MCUCTRL_DEBUGGER_LOCKOUT_S 0
  155. #define AM_REG_MCUCTRL_DEBUGGER_LOCKOUT_M 0x00000001
  156. #define AM_REG_MCUCTRL_DEBUGGER_LOCKOUT(n) (((uint32_t)(n) << 0) & 0x00000001)
  157. //*****************************************************************************
  158. //
  159. // MCUCTRL_BUCK - Analog Buck Control
  160. //
  161. //*****************************************************************************
  162. // Reset control override for Mem Buck; 0=enabled, 1=reset; Value is propagated
  163. // only when the BUCKSWE bit is active, otherwise contrl is from the power
  164. // control module.
  165. #define AM_REG_MCUCTRL_BUCK_MEMBUCKRST_S 7
  166. #define AM_REG_MCUCTRL_BUCK_MEMBUCKRST_M 0x00000080
  167. #define AM_REG_MCUCTRL_BUCK_MEMBUCKRST(n) (((uint32_t)(n) << 7) & 0x00000080)
  168. // Reset control override for Core Buck; 0=enabled, 1=reset; Value is propagated
  169. // only when the BUCKSWE bit is active, otherwise control is from the power
  170. // control module.
  171. #define AM_REG_MCUCTRL_BUCK_COREBUCKRST_S 6
  172. #define AM_REG_MCUCTRL_BUCK_COREBUCKRST_M 0x00000040
  173. #define AM_REG_MCUCTRL_BUCK_COREBUCKRST(n) (((uint32_t)(n) << 6) & 0x00000040)
  174. // Not used. Additional control of buck is available in the power control
  175. // module
  176. #define AM_REG_MCUCTRL_BUCK_BYPBUCKMEM_S 5
  177. #define AM_REG_MCUCTRL_BUCK_BYPBUCKMEM_M 0x00000020
  178. #define AM_REG_MCUCTRL_BUCK_BYPBUCKMEM(n) (((uint32_t)(n) << 5) & 0x00000020)
  179. // Memory buck power down override. 1=Powered Down; 0=Enabled; Value is
  180. // propagated only when the BUCKSWE bit is active, otherwise control is from the
  181. // power control module.
  182. #define AM_REG_MCUCTRL_BUCK_MEMBUCKPWD_S 4
  183. #define AM_REG_MCUCTRL_BUCK_MEMBUCKPWD_M 0x00000010
  184. #define AM_REG_MCUCTRL_BUCK_MEMBUCKPWD(n) (((uint32_t)(n) << 4) & 0x00000010)
  185. #define AM_REG_MCUCTRL_BUCK_MEMBUCKPWD_EN 0x00000000
  186. // HFRC clkgen bit 0 override. When set, this will override to 0 bit 0 of the
  187. // hfrc_freq_clkgen internal bus (see internal Shelby-1473)
  188. #define AM_REG_MCUCTRL_BUCK_SLEEPBUCKANA_S 3
  189. #define AM_REG_MCUCTRL_BUCK_SLEEPBUCKANA_M 0x00000008
  190. #define AM_REG_MCUCTRL_BUCK_SLEEPBUCKANA(n) (((uint32_t)(n) << 3) & 0x00000008)
  191. // Core buck power down override. 1=Powered Down; 0=Enabled; Value is propagated
  192. // only when the BUCKSWE bit is active, otherwise control is from the power
  193. // control module.
  194. #define AM_REG_MCUCTRL_BUCK_COREBUCKPWD_S 2
  195. #define AM_REG_MCUCTRL_BUCK_COREBUCKPWD_M 0x00000004
  196. #define AM_REG_MCUCTRL_BUCK_COREBUCKPWD(n) (((uint32_t)(n) << 2) & 0x00000004)
  197. #define AM_REG_MCUCTRL_BUCK_COREBUCKPWD_EN 0x00000000
  198. // Not used. Additional control of buck is available in the power control
  199. // module
  200. #define AM_REG_MCUCTRL_BUCK_BYPBUCKCORE_S 1
  201. #define AM_REG_MCUCTRL_BUCK_BYPBUCKCORE_M 0x00000002
  202. #define AM_REG_MCUCTRL_BUCK_BYPBUCKCORE(n) (((uint32_t)(n) << 1) & 0x00000002)
  203. // Buck Register Software Override Enable. This will enable the override values
  204. // for MEMBUCKPWD, COREBUCKPWD, COREBUCKRST, MEMBUCKRST, all to be propagated to
  205. // the control logic, instead of the normal power control module signal. Note -
  206. // Must take care to have correct value for ALL the register bits when this SWE
  207. // is enabled.
  208. #define AM_REG_MCUCTRL_BUCK_BUCKSWE_S 0
  209. #define AM_REG_MCUCTRL_BUCK_BUCKSWE_M 0x00000001
  210. #define AM_REG_MCUCTRL_BUCK_BUCKSWE(n) (((uint32_t)(n) << 0) & 0x00000001)
  211. #define AM_REG_MCUCTRL_BUCK_BUCKSWE_OVERRIDE_DIS 0x00000000
  212. #define AM_REG_MCUCTRL_BUCK_BUCKSWE_OVERRIDE_EN 0x00000001
  213. //*****************************************************************************
  214. //
  215. // MCUCTRL_BUCK3 - Buck control reg 3
  216. //
  217. //*****************************************************************************
  218. // MEM Buck low TON trim value
  219. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKLOTON_S 18
  220. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKLOTON_M 0x003C0000
  221. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKLOTON(n) (((uint32_t)(n) << 18) & 0x003C0000)
  222. // MEM Buck burst enable 0=disable, 0=disabled, 1=enable.
  223. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKBURSTEN_S 17
  224. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKBURSTEN_M 0x00020000
  225. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKBURSTEN(n) (((uint32_t)(n) << 17) & 0x00020000)
  226. // Memory buck zero crossing trim value
  227. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKZXTRIM_S 13
  228. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKZXTRIM_M 0x0001E000
  229. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKZXTRIM(n) (((uint32_t)(n) << 13) & 0x0001E000)
  230. // Hysterisis trim for mem buck
  231. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKHYSTTRIM_S 11
  232. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKHYSTTRIM_M 0x00001800
  233. #define AM_REG_MCUCTRL_BUCK3_MEMBUCKHYSTTRIM(n) (((uint32_t)(n) << 11) & 0x00001800)
  234. // Core Buck low TON trim value
  235. #define AM_REG_MCUCTRL_BUCK3_COREBUCKLOTON_S 7
  236. #define AM_REG_MCUCTRL_BUCK3_COREBUCKLOTON_M 0x00000780
  237. #define AM_REG_MCUCTRL_BUCK3_COREBUCKLOTON(n) (((uint32_t)(n) << 7) & 0x00000780)
  238. // Core Buck burst enable. 0=disabled, 1=enabled
  239. #define AM_REG_MCUCTRL_BUCK3_COREBUCKBURSTEN_S 6
  240. #define AM_REG_MCUCTRL_BUCK3_COREBUCKBURSTEN_M 0x00000040
  241. #define AM_REG_MCUCTRL_BUCK3_COREBUCKBURSTEN(n) (((uint32_t)(n) << 6) & 0x00000040)
  242. // Core buck zero crossing trim value
  243. #define AM_REG_MCUCTRL_BUCK3_COREBUCKZXTRIM_S 2
  244. #define AM_REG_MCUCTRL_BUCK3_COREBUCKZXTRIM_M 0x0000003C
  245. #define AM_REG_MCUCTRL_BUCK3_COREBUCKZXTRIM(n) (((uint32_t)(n) << 2) & 0x0000003C)
  246. // Hysterisis trim for core buck
  247. #define AM_REG_MCUCTRL_BUCK3_COREBUCKHYSTTRIM_S 0
  248. #define AM_REG_MCUCTRL_BUCK3_COREBUCKHYSTTRIM_M 0x00000003
  249. #define AM_REG_MCUCTRL_BUCK3_COREBUCKHYSTTRIM(n) (((uint32_t)(n) << 0) & 0x00000003)
  250. //*****************************************************************************
  251. //
  252. // MCUCTRL_LDOREG1 - Analog LDO Reg 1
  253. //
  254. //*****************************************************************************
  255. // CORE LDO IBIAS Trim
  256. #define AM_REG_MCUCTRL_LDOREG1_CORELDOIBSTRM_S 20
  257. #define AM_REG_MCUCTRL_LDOREG1_CORELDOIBSTRM_M 0x00100000
  258. #define AM_REG_MCUCTRL_LDOREG1_CORELDOIBSTRM(n) (((uint32_t)(n) << 20) & 0x00100000)
  259. // CORE LDO Low Power Trim
  260. #define AM_REG_MCUCTRL_LDOREG1_CORELDOLPTRIM_S 14
  261. #define AM_REG_MCUCTRL_LDOREG1_CORELDOLPTRIM_M 0x000FC000
  262. #define AM_REG_MCUCTRL_LDOREG1_CORELDOLPTRIM(n) (((uint32_t)(n) << 14) & 0x000FC000)
  263. // CORE LDO tempco trim (R3).
  264. #define AM_REG_MCUCTRL_LDOREG1_TRIMCORELDOR3_S 10
  265. #define AM_REG_MCUCTRL_LDOREG1_TRIMCORELDOR3_M 0x00003C00
  266. #define AM_REG_MCUCTRL_LDOREG1_TRIMCORELDOR3(n) (((uint32_t)(n) << 10) & 0x00003C00)
  267. // CORE LDO Active mode ouput trim (R1).
  268. #define AM_REG_MCUCTRL_LDOREG1_TRIMCORELDOR1_S 0
  269. #define AM_REG_MCUCTRL_LDOREG1_TRIMCORELDOR1_M 0x000003FF
  270. #define AM_REG_MCUCTRL_LDOREG1_TRIMCORELDOR1(n) (((uint32_t)(n) << 0) & 0x000003FF)
  271. //*****************************************************************************
  272. //
  273. // MCUCTRL_LDOREG3 - LDO Control Register 3
  274. //
  275. //*****************************************************************************
  276. // MEM LDO active mode trim (R1).
  277. #define AM_REG_MCUCTRL_LDOREG3_TRIMMEMLDOR1_S 12
  278. #define AM_REG_MCUCTRL_LDOREG3_TRIMMEMLDOR1_M 0x0003F000
  279. #define AM_REG_MCUCTRL_LDOREG3_TRIMMEMLDOR1(n) (((uint32_t)(n) << 12) & 0x0003F000)
  280. // MEM LDO TRIM for low power mode with ADC active
  281. #define AM_REG_MCUCTRL_LDOREG3_MEMLDOLPALTTRIM_S 6
  282. #define AM_REG_MCUCTRL_LDOREG3_MEMLDOLPALTTRIM_M 0x00000FC0
  283. #define AM_REG_MCUCTRL_LDOREG3_MEMLDOLPALTTRIM(n) (((uint32_t)(n) << 6) & 0x00000FC0)
  284. // MEM LDO TRIM for low power mode with ADC inactive
  285. #define AM_REG_MCUCTRL_LDOREG3_MEMLDOLPTRIM_S 0
  286. #define AM_REG_MCUCTRL_LDOREG3_MEMLDOLPTRIM_M 0x0000003F
  287. #define AM_REG_MCUCTRL_LDOREG3_MEMLDOLPTRIM(n) (((uint32_t)(n) << 0) & 0x0000003F)
  288. //*****************************************************************************
  289. //
  290. // MCUCTRL_BODPORCTRL - BOD and PDR control Register
  291. //
  292. //*****************************************************************************
  293. // BOD External Reference Select.
  294. #define AM_REG_MCUCTRL_BODPORCTRL_BODEXTREFSEL_S 3
  295. #define AM_REG_MCUCTRL_BODPORCTRL_BODEXTREFSEL_M 0x00000008
  296. #define AM_REG_MCUCTRL_BODPORCTRL_BODEXTREFSEL(n) (((uint32_t)(n) << 3) & 0x00000008)
  297. #define AM_REG_MCUCTRL_BODPORCTRL_BODEXTREFSEL_SELECT 0x00000008
  298. // PDR External Reference Select.
  299. #define AM_REG_MCUCTRL_BODPORCTRL_PDREXTREFSEL_S 2
  300. #define AM_REG_MCUCTRL_BODPORCTRL_PDREXTREFSEL_M 0x00000004
  301. #define AM_REG_MCUCTRL_BODPORCTRL_PDREXTREFSEL(n) (((uint32_t)(n) << 2) & 0x00000004)
  302. #define AM_REG_MCUCTRL_BODPORCTRL_PDREXTREFSEL_SELECT 0x00000004
  303. // BOD Power Down.
  304. #define AM_REG_MCUCTRL_BODPORCTRL_PWDBOD_S 1
  305. #define AM_REG_MCUCTRL_BODPORCTRL_PWDBOD_M 0x00000002
  306. #define AM_REG_MCUCTRL_BODPORCTRL_PWDBOD(n) (((uint32_t)(n) << 1) & 0x00000002)
  307. #define AM_REG_MCUCTRL_BODPORCTRL_PWDBOD_PWR_DN 0x00000002
  308. // PDR Power Down.
  309. #define AM_REG_MCUCTRL_BODPORCTRL_PWDPDR_S 0
  310. #define AM_REG_MCUCTRL_BODPORCTRL_PWDPDR_M 0x00000001
  311. #define AM_REG_MCUCTRL_BODPORCTRL_PWDPDR(n) (((uint32_t)(n) << 0) & 0x00000001)
  312. #define AM_REG_MCUCTRL_BODPORCTRL_PWDPDR_PWR_DN 0x00000001
  313. //*****************************************************************************
  314. //
  315. // MCUCTRL_ADCPWRDLY - ADC Power Up Delay Control
  316. //
  317. //*****************************************************************************
  318. // ADC Reference Keeper enable delay in 16 ADC CLK increments for ADC_CLKSEL =
  319. // 0x1, 8 ADC CLOCK increments for ADC_CLKSEL = 0x2.
  320. #define AM_REG_MCUCTRL_ADCPWRDLY_ADCPWR1_S 8
  321. #define AM_REG_MCUCTRL_ADCPWRDLY_ADCPWR1_M 0x0000FF00
  322. #define AM_REG_MCUCTRL_ADCPWRDLY_ADCPWR1(n) (((uint32_t)(n) << 8) & 0x0000FF00)
  323. // ADC Reference Buffer Power Enable delay in 64 ADC CLK increments for
  324. // ADC_CLKSEL = 0x1, 32 ADC CLOCK increments for ADC_CLKSEL = 0x2.
  325. #define AM_REG_MCUCTRL_ADCPWRDLY_ADCPWR0_S 0
  326. #define AM_REG_MCUCTRL_ADCPWRDLY_ADCPWR0_M 0x000000FF
  327. #define AM_REG_MCUCTRL_ADCPWRDLY_ADCPWR0(n) (((uint32_t)(n) << 0) & 0x000000FF)
  328. //*****************************************************************************
  329. //
  330. // MCUCTRL_ADCCAL - ADC Calibration Control
  331. //
  332. //*****************************************************************************
  333. // Status for ADC Calibration
  334. #define AM_REG_MCUCTRL_ADCCAL_ADCCALIBRATED_S 1
  335. #define AM_REG_MCUCTRL_ADCCAL_ADCCALIBRATED_M 0x00000002
  336. #define AM_REG_MCUCTRL_ADCCAL_ADCCALIBRATED(n) (((uint32_t)(n) << 1) & 0x00000002)
  337. #define AM_REG_MCUCTRL_ADCCAL_ADCCALIBRATED_FALSE 0x00000000
  338. #define AM_REG_MCUCTRL_ADCCAL_ADCCALIBRATED_TRUE 0x00000002
  339. // Run ADC Calibration on initial power up sequence
  340. #define AM_REG_MCUCTRL_ADCCAL_CALONPWRUP_S 0
  341. #define AM_REG_MCUCTRL_ADCCAL_CALONPWRUP_M 0x00000001
  342. #define AM_REG_MCUCTRL_ADCCAL_CALONPWRUP(n) (((uint32_t)(n) << 0) & 0x00000001)
  343. #define AM_REG_MCUCTRL_ADCCAL_CALONPWRUP_DIS 0x00000000
  344. #define AM_REG_MCUCTRL_ADCCAL_CALONPWRUP_EN 0x00000001
  345. //*****************************************************************************
  346. //
  347. // MCUCTRL_ADCBATTLOAD - ADC Battery Load Enable
  348. //
  349. //*****************************************************************************
  350. // Enable the ADC battery load resistor
  351. #define AM_REG_MCUCTRL_ADCBATTLOAD_BATTLOAD_S 0
  352. #define AM_REG_MCUCTRL_ADCBATTLOAD_BATTLOAD_M 0x00000001
  353. #define AM_REG_MCUCTRL_ADCBATTLOAD_BATTLOAD(n) (((uint32_t)(n) << 0) & 0x00000001)
  354. #define AM_REG_MCUCTRL_ADCBATTLOAD_BATTLOAD_DIS 0x00000000
  355. #define AM_REG_MCUCTRL_ADCBATTLOAD_BATTLOAD_EN 0x00000001
  356. //*****************************************************************************
  357. //
  358. // MCUCTRL_BUCKTRIM - Trim settings for Core and Mem buck modules
  359. //
  360. //*****************************************************************************
  361. // RESERVED.
  362. #define AM_REG_MCUCTRL_BUCKTRIM_RSVD2_S 24
  363. #define AM_REG_MCUCTRL_BUCKTRIM_RSVD2_M 0x3F000000
  364. #define AM_REG_MCUCTRL_BUCKTRIM_RSVD2(n) (((uint32_t)(n) << 24) & 0x3F000000)
  365. // Core Buck voltage output trim bits[9:6]. Concatenate with field COREBUCKR1_LO
  366. // for the full trim value.
  367. #define AM_REG_MCUCTRL_BUCKTRIM_COREBUCKR1_HI_S 16
  368. #define AM_REG_MCUCTRL_BUCKTRIM_COREBUCKR1_HI_M 0x000F0000
  369. #define AM_REG_MCUCTRL_BUCKTRIM_COREBUCKR1_HI(n) (((uint32_t)(n) << 16) & 0x000F0000)
  370. // Core Buck voltage output trim bits[5:0], Concatenate with field COREBUCKR1_HI
  371. // for the full trim value.
  372. #define AM_REG_MCUCTRL_BUCKTRIM_COREBUCKR1_LO_S 8
  373. #define AM_REG_MCUCTRL_BUCKTRIM_COREBUCKR1_LO_M 0x00003F00
  374. #define AM_REG_MCUCTRL_BUCKTRIM_COREBUCKR1_LO(n) (((uint32_t)(n) << 8) & 0x00003F00)
  375. // Trim values for BUCK regulator.
  376. #define AM_REG_MCUCTRL_BUCKTRIM_MEMBUCKR1_S 0
  377. #define AM_REG_MCUCTRL_BUCKTRIM_MEMBUCKR1_M 0x0000003F
  378. #define AM_REG_MCUCTRL_BUCKTRIM_MEMBUCKR1(n) (((uint32_t)(n) << 0) & 0x0000003F)
  379. //*****************************************************************************
  380. //
  381. // MCUCTRL_BOOTLOADERLOW - Determines whether the bootloader code is visible at
  382. // address 0x00000000
  383. //
  384. //*****************************************************************************
  385. // Determines whether the bootloader code is visible at address 0x00000000 or
  386. // not.
  387. #define AM_REG_MCUCTRL_BOOTLOADERLOW_VALUE_S 0
  388. #define AM_REG_MCUCTRL_BOOTLOADERLOW_VALUE_M 0x00000001
  389. #define AM_REG_MCUCTRL_BOOTLOADERLOW_VALUE(n) (((uint32_t)(n) << 0) & 0x00000001)
  390. #define AM_REG_MCUCTRL_BOOTLOADERLOW_VALUE_ADDR0 0x00000001
  391. //*****************************************************************************
  392. //
  393. // MCUCTRL_SHADOWVALID - Register to indicate whether the shadow registers have
  394. // been successfully loaded from the Flash Information Space.
  395. //
  396. //*****************************************************************************
  397. // Indicates whether the bootloader should sleep or deep sleep if no image
  398. // loaded.
  399. #define AM_REG_MCUCTRL_SHADOWVALID_BL_DSLEEP_S 1
  400. #define AM_REG_MCUCTRL_SHADOWVALID_BL_DSLEEP_M 0x00000002
  401. #define AM_REG_MCUCTRL_SHADOWVALID_BL_DSLEEP(n) (((uint32_t)(n) << 1) & 0x00000002)
  402. #define AM_REG_MCUCTRL_SHADOWVALID_BL_DSLEEP_DEEPSLEEP 0x00000002
  403. // Indicates whether the shadow registers contain valid data from the Flash
  404. // Information Space.
  405. #define AM_REG_MCUCTRL_SHADOWVALID_VALID_S 0
  406. #define AM_REG_MCUCTRL_SHADOWVALID_VALID_M 0x00000001
  407. #define AM_REG_MCUCTRL_SHADOWVALID_VALID(n) (((uint32_t)(n) << 0) & 0x00000001)
  408. #define AM_REG_MCUCTRL_SHADOWVALID_VALID_VALID 0x00000001
  409. //*****************************************************************************
  410. //
  411. // MCUCTRL_ICODEFAULTADDR - ICODE bus address which was present when a bus fault
  412. // occurred.
  413. //
  414. //*****************************************************************************
  415. // The ICODE bus address observed when a Bus Fault occurred. Once an address is
  416. // captured in this field, it is held until the corresponding Fault Observed bit
  417. // is cleared in the FAULTSTATUS register.
  418. #define AM_REG_MCUCTRL_ICODEFAULTADDR_ADDR_S 0
  419. #define AM_REG_MCUCTRL_ICODEFAULTADDR_ADDR_M 0xFFFFFFFF
  420. #define AM_REG_MCUCTRL_ICODEFAULTADDR_ADDR(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  421. //*****************************************************************************
  422. //
  423. // MCUCTRL_DCODEFAULTADDR - DCODE bus address which was present when a bus fault
  424. // occurred.
  425. //
  426. //*****************************************************************************
  427. // The DCODE bus address observed when a Bus Fault occurred. Once an address is
  428. // captured in this field, it is held until the corresponding Fault Observed bit
  429. // is cleared in the FAULTSTATUS register.
  430. #define AM_REG_MCUCTRL_DCODEFAULTADDR_ADDR_S 0
  431. #define AM_REG_MCUCTRL_DCODEFAULTADDR_ADDR_M 0xFFFFFFFF
  432. #define AM_REG_MCUCTRL_DCODEFAULTADDR_ADDR(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  433. //*****************************************************************************
  434. //
  435. // MCUCTRL_SYSFAULTADDR - System bus address which was present when a bus fault
  436. // occurred.
  437. //
  438. //*****************************************************************************
  439. // SYS bus address observed when a Bus Fault occurred. Once an address is
  440. // captured in this field, it is held until the corresponding Fault Observed bit
  441. // is cleared in the FAULTSTATUS register.
  442. #define AM_REG_MCUCTRL_SYSFAULTADDR_ADDR_S 0
  443. #define AM_REG_MCUCTRL_SYSFAULTADDR_ADDR_M 0xFFFFFFFF
  444. #define AM_REG_MCUCTRL_SYSFAULTADDR_ADDR(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  445. //*****************************************************************************
  446. //
  447. // MCUCTRL_FAULTSTATUS - Reflects the status of the bus decoders' fault
  448. // detection. Any write to this register will clear all of the status bits
  449. // within the register.
  450. //
  451. //*****************************************************************************
  452. // SYS Bus Decoder Fault Detected bit. When set, a fault has been detected, and
  453. // the SYSFAULTADDR register will contain the bus address which generated the
  454. // fault.
  455. #define AM_REG_MCUCTRL_FAULTSTATUS_SYS_S 2
  456. #define AM_REG_MCUCTRL_FAULTSTATUS_SYS_M 0x00000004
  457. #define AM_REG_MCUCTRL_FAULTSTATUS_SYS(n) (((uint32_t)(n) << 2) & 0x00000004)
  458. #define AM_REG_MCUCTRL_FAULTSTATUS_SYS_NOFAULT 0x00000000
  459. #define AM_REG_MCUCTRL_FAULTSTATUS_SYS_FAULT 0x00000004
  460. // DCODE Bus Decoder Fault Detected bit. When set, a fault has been detected,
  461. // and the DCODEFAULTADDR register will contain the bus address which generated
  462. // the fault.
  463. #define AM_REG_MCUCTRL_FAULTSTATUS_DCODE_S 1
  464. #define AM_REG_MCUCTRL_FAULTSTATUS_DCODE_M 0x00000002
  465. #define AM_REG_MCUCTRL_FAULTSTATUS_DCODE(n) (((uint32_t)(n) << 1) & 0x00000002)
  466. #define AM_REG_MCUCTRL_FAULTSTATUS_DCODE_NOFAULT 0x00000000
  467. #define AM_REG_MCUCTRL_FAULTSTATUS_DCODE_FAULT 0x00000002
  468. // The ICODE Bus Decoder Fault Detected bit. When set, a fault has been
  469. // detected, and the ICODEFAULTADDR register will contain the bus address which
  470. // generated the fault.
  471. #define AM_REG_MCUCTRL_FAULTSTATUS_ICODE_S 0
  472. #define AM_REG_MCUCTRL_FAULTSTATUS_ICODE_M 0x00000001
  473. #define AM_REG_MCUCTRL_FAULTSTATUS_ICODE(n) (((uint32_t)(n) << 0) & 0x00000001)
  474. #define AM_REG_MCUCTRL_FAULTSTATUS_ICODE_NOFAULT 0x00000000
  475. #define AM_REG_MCUCTRL_FAULTSTATUS_ICODE_FAULT 0x00000001
  476. //*****************************************************************************
  477. //
  478. // MCUCTRL_FAULTCAPTUREEN - Enable the fault capture registers
  479. //
  480. //*****************************************************************************
  481. // Fault Capture Enable field. When set, the Fault Capture monitors are enabled
  482. // and addresses which generate a hard fault are captured into the FAULTADDR
  483. // registers.
  484. #define AM_REG_MCUCTRL_FAULTCAPTUREEN_ENABLE_S 0
  485. #define AM_REG_MCUCTRL_FAULTCAPTUREEN_ENABLE_M 0x00000001
  486. #define AM_REG_MCUCTRL_FAULTCAPTUREEN_ENABLE(n) (((uint32_t)(n) << 0) & 0x00000001)
  487. #define AM_REG_MCUCTRL_FAULTCAPTUREEN_ENABLE_DIS 0x00000000
  488. #define AM_REG_MCUCTRL_FAULTCAPTUREEN_ENABLE_EN 0x00000001
  489. //*****************************************************************************
  490. //
  491. // MCUCTRL_DBGR1 - Read-only debug register 1
  492. //
  493. //*****************************************************************************
  494. // Read-only register for communication validation
  495. #define AM_REG_MCUCTRL_DBGR1_ONETO8_S 0
  496. #define AM_REG_MCUCTRL_DBGR1_ONETO8_M 0xFFFFFFFF
  497. #define AM_REG_MCUCTRL_DBGR1_ONETO8(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  498. //*****************************************************************************
  499. //
  500. // MCUCTRL_DBGR2 - Read-only debug register 2
  501. //
  502. //*****************************************************************************
  503. // Read-only register for communication validation
  504. #define AM_REG_MCUCTRL_DBGR2_COOLCODE_S 0
  505. #define AM_REG_MCUCTRL_DBGR2_COOLCODE_M 0xFFFFFFFF
  506. #define AM_REG_MCUCTRL_DBGR2_COOLCODE(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  507. //*****************************************************************************
  508. //
  509. // MCUCTRL_PMUENABLE - Control bit to enable/disable the PMU
  510. //
  511. //*****************************************************************************
  512. // PMU Enable Control bit. When set, the MCU's PMU will place the MCU into the
  513. // lowest power consuming Deep Sleep mode upon execution of a WFI instruction
  514. // (dependent on the setting of the SLEEPDEEP bit in the ARM SCR register). When
  515. // cleared, regardless of the requested sleep mode, the PMU will not enter the
  516. // lowest power Deep Sleep mode, instead entering the Sleep mode.
  517. #define AM_REG_MCUCTRL_PMUENABLE_ENABLE_S 0
  518. #define AM_REG_MCUCTRL_PMUENABLE_ENABLE_M 0x00000001
  519. #define AM_REG_MCUCTRL_PMUENABLE_ENABLE(n) (((uint32_t)(n) << 0) & 0x00000001)
  520. #define AM_REG_MCUCTRL_PMUENABLE_ENABLE_DIS 0x00000000
  521. #define AM_REG_MCUCTRL_PMUENABLE_ENABLE_EN 0x00000001
  522. //*****************************************************************************
  523. //
  524. // MCUCTRL_TPIUCTRL - TPIU Control Register. Determines the clock enable and
  525. // frequency for the M4's TPIU interface.
  526. //
  527. //*****************************************************************************
  528. // This field selects the frequency of the ARM M4 TPIU port.
  529. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_S 8
  530. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_M 0x00000700
  531. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL(n) (((uint32_t)(n) << 8) & 0x00000700)
  532. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_LOW_PWR 0x00000000
  533. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_0MHz 0x00000000
  534. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_HFRC_DIV_2 0x00000100
  535. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_HFRC_DIV_8 0x00000200
  536. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_HFRC_DIV_16 0x00000300
  537. #define AM_REG_MCUCTRL_TPIUCTRL_CLKSEL_HFRC_DIV_32 0x00000400
  538. // TPIU Enable field. When set, the ARM M4 TPIU is enabled and data can be
  539. // streamed out of the MCU's SWO port using the ARM ITM and TPIU modules.
  540. #define AM_REG_MCUCTRL_TPIUCTRL_ENABLE_S 0
  541. #define AM_REG_MCUCTRL_TPIUCTRL_ENABLE_M 0x00000001
  542. #define AM_REG_MCUCTRL_TPIUCTRL_ENABLE(n) (((uint32_t)(n) << 0) & 0x00000001)
  543. #define AM_REG_MCUCTRL_TPIUCTRL_ENABLE_DIS 0x00000000
  544. #define AM_REG_MCUCTRL_TPIUCTRL_ENABLE_EN 0x00000001
  545. #endif // AM_REG_MCUCTRL_H