hw_hibernate.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. //*****************************************************************************
  2. //
  3. // hw_hibernate.h - Defines and Macros for the Hibernation module.
  4. //
  5. // Copyright (c) 2007-2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Firmware Development Package.
  22. //
  23. //*****************************************************************************
  24. #ifndef __HW_HIBERNATE_H__
  25. #define __HW_HIBERNATE_H__
  26. //*****************************************************************************
  27. //
  28. // The following are defines for the Hibernation module register addresses.
  29. //
  30. //*****************************************************************************
  31. #define HIB_RTCC 0x400FC000 // Hibernation RTC Counter
  32. #define HIB_RTCM0 0x400FC004 // Hibernation RTC Match 0
  33. #define HIB_RTCM1 0x400FC008 // Hibernation RTC Match 1
  34. #define HIB_RTCLD 0x400FC00C // Hibernation RTC Load
  35. #define HIB_CTL 0x400FC010 // Hibernation Control
  36. #define HIB_IM 0x400FC014 // Hibernation Interrupt Mask
  37. #define HIB_RIS 0x400FC018 // Hibernation Raw Interrupt Status
  38. #define HIB_MIS 0x400FC01C // Hibernation Masked Interrupt
  39. // Status
  40. #define HIB_IC 0x400FC020 // Hibernation Interrupt Clear
  41. #define HIB_RTCT 0x400FC024 // Hibernation RTC Trim
  42. #define HIB_RTCSS 0x400FC028 // Hibernation RTC Sub Seconds
  43. #define HIB_DATA 0x400FC030 // Hibernation Data
  44. //*****************************************************************************
  45. //
  46. // The following are defines for the bit fields in the HIB_RTCC register.
  47. //
  48. //*****************************************************************************
  49. #define HIB_RTCC_M 0xFFFFFFFF // RTC Counter
  50. #define HIB_RTCC_S 0
  51. //*****************************************************************************
  52. //
  53. // The following are defines for the bit fields in the HIB_RTCM0 register.
  54. //
  55. //*****************************************************************************
  56. #define HIB_RTCM0_M 0xFFFFFFFF // RTC Match 0
  57. #define HIB_RTCM0_S 0
  58. //*****************************************************************************
  59. //
  60. // The following are defines for the bit fields in the HIB_RTCM1 register.
  61. //
  62. //*****************************************************************************
  63. #define HIB_RTCM1_M 0xFFFFFFFF // RTC Match 1
  64. #define HIB_RTCM1_S 0
  65. //*****************************************************************************
  66. //
  67. // The following are defines for the bit fields in the HIB_RTCLD register.
  68. //
  69. //*****************************************************************************
  70. #define HIB_RTCLD_M 0xFFFFFFFF // RTC Load
  71. #define HIB_RTCLD_S 0
  72. //*****************************************************************************
  73. //
  74. // The following are defines for the bit fields in the HIB_CTL register.
  75. //
  76. //*****************************************************************************
  77. #define HIB_CTL_WRC 0x80000000 // Write Complete/Capable
  78. #define HIB_CTL_OSCHYS 0x00040000 // 32
  79. #define HIB_CTL_OSCDRV 0x00020000 // Oscillator Drive Capability
  80. #define HIB_CTL_OSCBYP 0x00010000 // Oscillator Bypass
  81. #define HIB_CTL_VBATSEL_M 0x00006000 // Select for Low-Battery
  82. // Comparator
  83. #define HIB_CTL_VBATSEL_1_9V 0x00000000 // 1.9 Volts
  84. #define HIB_CTL_VBATSEL_2_1V 0x00002000 // 2.1 Volts (default)
  85. #define HIB_CTL_VBATSEL_2_3V 0x00004000 // 2.3 Volts
  86. #define HIB_CTL_VBATSEL_2_5V 0x00006000 // 2.5 Volts
  87. #define HIB_CTL_BATCHK 0x00000400 // Check Battery Status
  88. #define HIB_CTL_BATWKEN 0x00000200 // Wake on Low Battery
  89. #define HIB_CTL_VDD3ON 0x00000100 // VDD Powered
  90. #define HIB_CTL_VABORT 0x00000080 // Power Cut Abort Enable
  91. #define HIB_CTL_CLK32EN 0x00000040 // Clocking Enable
  92. #define HIB_CTL_LOWBATEN 0x00000020 // Low Battery Monitoring Enable
  93. #define HIB_CTL_PINWEN 0x00000010 // External WAKE Pin Enable
  94. #define HIB_CTL_RTCWEN 0x00000008 // RTC Wake-up Enable
  95. #define HIB_CTL_CLKSEL 0x00000004 // Hibernation Module Clock Select
  96. #define HIB_CTL_HIBREQ 0x00000002 // Hibernation Request
  97. #define HIB_CTL_RTCEN 0x00000001 // RTC Timer Enable
  98. //*****************************************************************************
  99. //
  100. // The following are defines for the bit fields in the HIB_IM register.
  101. //
  102. //*****************************************************************************
  103. #define HIB_IM_WC 0x00000010 // External Write Complete/Capable
  104. // Interrupt Mask
  105. #define HIB_IM_EXTW 0x00000008 // External Wake-Up Interrupt Mask
  106. #define HIB_IM_LOWBAT 0x00000004 // Low Battery Voltage Interrupt
  107. // Mask
  108. #define HIB_IM_RTCALT1 0x00000002 // RTC Alert 1 Interrupt Mask
  109. #define HIB_IM_RTCALT0 0x00000001 // RTC Alert 0 Interrupt Mask
  110. //*****************************************************************************
  111. //
  112. // The following are defines for the bit fields in the HIB_RIS register.
  113. //
  114. //*****************************************************************************
  115. #define HIB_RIS_WC 0x00000010 // Write Complete/Capable Raw
  116. // Interrupt Status
  117. #define HIB_RIS_EXTW 0x00000008 // External Wake-Up Raw Interrupt
  118. // Status
  119. #define HIB_RIS_LOWBAT 0x00000004 // Low Battery Voltage Raw
  120. // Interrupt Status
  121. #define HIB_RIS_RTCALT1 0x00000002 // RTC Alert 1 Raw Interrupt Status
  122. #define HIB_RIS_RTCALT0 0x00000001 // RTC Alert 0 Raw Interrupt Status
  123. //*****************************************************************************
  124. //
  125. // The following are defines for the bit fields in the HIB_MIS register.
  126. //
  127. //*****************************************************************************
  128. #define HIB_MIS_WC 0x00000010 // Write Complete/Capable Masked
  129. // Interrupt Status
  130. #define HIB_MIS_EXTW 0x00000008 // External Wake-Up Masked
  131. // Interrupt Status
  132. #define HIB_MIS_LOWBAT 0x00000004 // Low Battery Voltage Masked
  133. // Interrupt Status
  134. #define HIB_MIS_RTCALT1 0x00000002 // RTC Alert 1 Masked Interrupt
  135. // Status
  136. #define HIB_MIS_RTCALT0 0x00000001 // RTC Alert 0 Masked Interrupt
  137. // Status
  138. //*****************************************************************************
  139. //
  140. // The following are defines for the bit fields in the HIB_IC register.
  141. //
  142. //*****************************************************************************
  143. #define HIB_IC_WC 0x00000010 // Write Complete/Capable Masked
  144. // Interrupt Clear
  145. #define HIB_IC_EXTW 0x00000008 // External Wake-Up Masked
  146. // Interrupt Clear
  147. #define HIB_IC_LOWBAT 0x00000004 // Low Battery Voltage Masked
  148. // Interrupt Clear
  149. #define HIB_IC_RTCALT1 0x00000002 // RTC Alert1 Masked Interrupt
  150. // Clear
  151. #define HIB_IC_RTCALT0 0x00000001 // RTC Alert0 Masked Interrupt
  152. // Clear
  153. //*****************************************************************************
  154. //
  155. // The following are defines for the bit fields in the HIB_RTCT register.
  156. //
  157. //*****************************************************************************
  158. #define HIB_RTCT_TRIM_M 0x0000FFFF // RTC Trim Value
  159. #define HIB_RTCT_TRIM_S 0
  160. //*****************************************************************************
  161. //
  162. // The following are defines for the bit fields in the HIB_RTCSS register.
  163. //
  164. //*****************************************************************************
  165. #define HIB_RTCSS_RTCSSM_M 0x7FFF0000 // RTC Sub Seconds Match
  166. #define HIB_RTCSS_RTCSSC_M 0x00007FFF // RTC Sub Seconds Count
  167. #define HIB_RTCSS_RTCSSM_S 16
  168. #define HIB_RTCSS_RTCSSC_S 0
  169. //*****************************************************************************
  170. //
  171. // The following are defines for the bit fields in the HIB_DATA register.
  172. //
  173. //*****************************************************************************
  174. #define HIB_DATA_RTD_M 0xFFFFFFFF // Hibernation Module NV Data
  175. #define HIB_DATA_RTD_S 0
  176. //*****************************************************************************
  177. //
  178. // The following definitions are deprecated.
  179. //
  180. //*****************************************************************************
  181. #ifndef DEPRECATED
  182. //*****************************************************************************
  183. //
  184. // The following are deprecated defines for the Hibernation module register
  185. // addresses.
  186. //
  187. //*****************************************************************************
  188. #define HIB_DATA_END 0x400FC130 // end of data area, exclusive
  189. //*****************************************************************************
  190. //
  191. // The following are deprecated defines for the bit fields in the HIB_RTCC
  192. // register.
  193. //
  194. //*****************************************************************************
  195. #define HIB_RTCC_MASK 0xFFFFFFFF // RTC counter mask
  196. //*****************************************************************************
  197. //
  198. // The following are deprecated defines for the bit fields in the HIB_RTCM0
  199. // register.
  200. //
  201. //*****************************************************************************
  202. #define HIB_RTCM0_MASK 0xFFFFFFFF // RTC match 0 mask
  203. //*****************************************************************************
  204. //
  205. // The following are deprecated defines for the bit fields in the HIB_RTCM1
  206. // register.
  207. //
  208. //*****************************************************************************
  209. #define HIB_RTCM1_MASK 0xFFFFFFFF // RTC match 1 mask
  210. //*****************************************************************************
  211. //
  212. // The following are deprecated defines for the bit fields in the HIB_RTCLD
  213. // register.
  214. //
  215. //*****************************************************************************
  216. #define HIB_RTCLD_MASK 0xFFFFFFFF // RTC load mask
  217. //*****************************************************************************
  218. //
  219. // The following are deprecated defines for the bit fields in the HIB_RIS
  220. // register.
  221. //
  222. //*****************************************************************************
  223. #define HIB_RID_RTCALT0 0x00000001 // RTC match 0 interrupt
  224. //*****************************************************************************
  225. //
  226. // The following are deprecated defines for the bit fields in the HIB_MIS
  227. // register.
  228. //
  229. //*****************************************************************************
  230. #define HIB_MID_RTCALT0 0x00000001 // RTC match 0 interrupt
  231. //*****************************************************************************
  232. //
  233. // The following are deprecated defines for the bit fields in the HIB_RTCT
  234. // register.
  235. //
  236. //*****************************************************************************
  237. #define HIB_RTCT_MASK 0x0000FFFF // RTC trim mask
  238. //*****************************************************************************
  239. //
  240. // The following are deprecated defines for the bit fields in the HIB_DATA
  241. // register.
  242. //
  243. //*****************************************************************************
  244. #define HIB_DATA_MASK 0xFFFFFFFF // NV memory data mask
  245. #endif
  246. #endif // __HW_HIBERNATE_H__