hw_smwdthrosc.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. /******************************************************************************
  2. * Filename: hw_smwdthrosc.h
  3. * Revised: $Date: 2013-04-30 17:13:44 +0200 (Tue, 30 Apr 2013) $
  4. * Revision: $Revision: 9943 $
  5. *
  6. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  7. *
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. *
  16. * Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the distribution.
  19. *
  20. * Neither the name of Texas Instruments Incorporated nor the names of
  21. * its contributors may be used to endorse or promote products derived
  22. * from this software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. ******************************************************************************/
  37. #ifndef __HW_SMWDTHROSC_H__
  38. #define __HW_SMWDTHROSC_H__
  39. //*****************************************************************************
  40. //
  41. // The following are defines for the SMWDTHROSC register offsets.
  42. //
  43. //*****************************************************************************
  44. #define SMWDTHROSC_WDCTL 0x400D5000 // Watchdog Timer Control
  45. #define SMWDTHROSC_ST0 0x400D5040 // Sleep Timer 0 count and compare
  46. #define SMWDTHROSC_ST1 0x400D5044 // Sleep Timer 1 count and compare
  47. #define SMWDTHROSC_ST2 0x400D5048 // Sleep Timer 2 count and compare
  48. #define SMWDTHROSC_ST3 0x400D504C // Sleep Timer 3 count and compare
  49. #define SMWDTHROSC_STLOAD 0x400D5050 // Sleep Timer load status
  50. #define SMWDTHROSC_STCC 0x400D5054 // Sleep Timer Capture control
  51. #define SMWDTHROSC_STCS 0x400D5058 // Sleep Timer Capture status
  52. #define SMWDTHROSC_STCV0 0x400D505C // Sleep Timer Capture value byte
  53. // 0
  54. #define SMWDTHROSC_STCV1 0x400D5060 // Sleep Timer Capture value byte
  55. // 1
  56. #define SMWDTHROSC_STCV2 0x400D5064 // Sleep Timer Capture value byte
  57. // 2
  58. #define SMWDTHROSC_STCV3 0x400D5068 // Sleep Timer Capture value byte
  59. // 3
  60. //*****************************************************************************
  61. //
  62. // The following are defines for the bit fields in the
  63. // SMWDTHROSC_WDCTL register.
  64. //
  65. //*****************************************************************************
  66. #define SMWDTHROSC_WDCTL_CLR_M 0x000000F0 // Clear timer When 0xA followed
  67. // by 0x5 is written to these bits,
  68. // the timer is loaded with 0x0000.
  69. // Note that 0x5 must be written
  70. // within one watchdog clock period
  71. // Twdt after 0xA was written for
  72. // the clearing to take effect
  73. // (ensured). If 0x5 is written
  74. // between Twdt and 2Twdt after 0xA
  75. // was written, the clearing may
  76. // take effect, but there is no
  77. // guarantee. If 0x5 is written >
  78. // 2Twdt after 0xA was written, the
  79. // timer will not be cleared. If a
  80. // value other than 0x5 is written
  81. // after 0xA has been written, the
  82. // clear sequence is aborted. If
  83. // 0xA is written, this starts a
  84. // new clear sequence. Writing to
  85. // these bits when EN = 0 has no
  86. // effect.
  87. #define SMWDTHROSC_WDCTL_CLR_S 4
  88. #define SMWDTHROSC_WDCTL_EN 0x00000008 // Enable timer When 1 is written
  89. // to this bit the timer is enabled
  90. // and starts incrementing. The
  91. // interval setting specified by
  92. // INT[1:0] is used. Writing 0 to
  93. // this bit have no effect.
  94. #define SMWDTHROSC_WDCTL_EN_M 0x00000008
  95. #define SMWDTHROSC_WDCTL_EN_S 3
  96. #define SMWDTHROSC_WDCTL_INT_M 0x00000003 // Timer interval select These
  97. // bits select the timer interval
  98. // as follows: 00: Twdt x 32768 01:
  99. // Twdt x 8192 10: Twdt x 512 11:
  100. // Twdt x 64 Writing these bits
  101. // when EN = 1 has no effect.
  102. #define SMWDTHROSC_WDCTL_INT_S 0
  103. //*****************************************************************************
  104. //
  105. // The following are defines for the bit fields in the
  106. // SMWDTHROSC_ST0 register.
  107. //
  108. //*****************************************************************************
  109. #define SMWDTHROSC_ST0_ST0_M 0x000000FF // Sleep Timer count and compare
  110. // value. When read, this register
  111. // returns the low bits [7:0] of
  112. // the Sleep Timer count. When
  113. // writing this register sets the
  114. // low bits [7:0] of the compare
  115. // value.
  116. #define SMWDTHROSC_ST0_ST0_S 0
  117. //*****************************************************************************
  118. //
  119. // The following are defines for the bit fields in the
  120. // SMWDTHROSC_ST1 register.
  121. //
  122. //*****************************************************************************
  123. #define SMWDTHROSC_ST1_ST1_M 0x000000FF // Sleep Timer count and compare
  124. // value When read, this register
  125. // returns the middle bits [15:8]
  126. // of the Sleep Timer count. When
  127. // writing this register sets the
  128. // middle bits [15:8] of the
  129. // compare value. The value read is
  130. // latched at the time of reading
  131. // register ST0. The value written
  132. // is latched when ST0 is written.
  133. #define SMWDTHROSC_ST1_ST1_S 0
  134. //*****************************************************************************
  135. //
  136. // The following are defines for the bit fields in the
  137. // SMWDTHROSC_ST2 register.
  138. //
  139. //*****************************************************************************
  140. #define SMWDTHROSC_ST2_ST2_M 0x000000FF // Sleep Timer count and compare
  141. // value When read, this register
  142. // returns the high bits [23:16] of
  143. // the Sleep Timer count. When
  144. // writing this register sets the
  145. // high bits [23:16] of the compare
  146. // value. The value read is latched
  147. // at the time of reading register
  148. // ST0. The value written is
  149. // latched when ST0 is written.
  150. #define SMWDTHROSC_ST2_ST2_S 0
  151. //*****************************************************************************
  152. //
  153. // The following are defines for the bit fields in the
  154. // SMWDTHROSC_ST3 register.
  155. //
  156. //*****************************************************************************
  157. #define SMWDTHROSC_ST3_ST3_M 0x000000FF // Sleep Timer count and compare
  158. // value When read, this register
  159. // returns the high bits [31:24] of
  160. // the Sleep Timer count. When
  161. // writing this register sets the
  162. // high bits [31:24] of the compare
  163. // value. The value read is latched
  164. // at the time of reading register
  165. // ST0. The value written is
  166. // latched when ST0 is written.
  167. #define SMWDTHROSC_ST3_ST3_S 0
  168. //*****************************************************************************
  169. //
  170. // The following are defines for the bit fields in the
  171. // SMWDTHROSC_STLOAD register.
  172. //
  173. //*****************************************************************************
  174. #define SMWDTHROSC_STLOAD_STLOAD \
  175. 0x00000001 // Status signal for when STx
  176. // registers have been uploaded to
  177. // 32-kHz counter. 1: Load is
  178. // complete 0: Load is busy and STx
  179. // regs are blocked for writing
  180. #define SMWDTHROSC_STLOAD_STLOAD_M \
  181. 0x00000001
  182. #define SMWDTHROSC_STLOAD_STLOAD_S 0
  183. //*****************************************************************************
  184. //
  185. // The following are defines for the bit fields in the
  186. // SMWDTHROSC_STCC register.
  187. //
  188. //*****************************************************************************
  189. #define SMWDTHROSC_STCC_PORT_M 0x00000038 // Port select Valid settings are
  190. // 0-3, all others inhibit any
  191. // capture from occurring 000: Port
  192. // A selected 001: Port B selected
  193. // 010: Port C selected 011: Port D
  194. // selected
  195. #define SMWDTHROSC_STCC_PORT_S 3
  196. #define SMWDTHROSC_STCC_PIN_M 0x00000007 // Pin select Valid settings are
  197. // 1-7 when either port A, B, C, or
  198. // D is selected.
  199. #define SMWDTHROSC_STCC_PIN_S 0
  200. //*****************************************************************************
  201. //
  202. // The following are defines for the bit fields in the
  203. // SMWDTHROSC_STCS register.
  204. //
  205. //*****************************************************************************
  206. #define SMWDTHROSC_STCS_VALID 0x00000001 // Capture valid flag Set to 1
  207. // when capture value in STCV has
  208. // been updated Clear explicitly to
  209. // allow new capture
  210. #define SMWDTHROSC_STCS_VALID_M 0x00000001
  211. #define SMWDTHROSC_STCS_VALID_S 0
  212. //*****************************************************************************
  213. //
  214. // The following are defines for the bit fields in the
  215. // SMWDTHROSC_STCV0 register.
  216. //
  217. //*****************************************************************************
  218. #define SMWDTHROSC_STCV0_STCV0_M \
  219. 0x000000FF // Bits [7:0] of Sleep Timer
  220. // capture value
  221. #define SMWDTHROSC_STCV0_STCV0_S 0
  222. //*****************************************************************************
  223. //
  224. // The following are defines for the bit fields in the
  225. // SMWDTHROSC_STCV1 register.
  226. //
  227. //*****************************************************************************
  228. #define SMWDTHROSC_STCV1_STCV1_M \
  229. 0x000000FF // Bits [15:8] of Sleep Timer
  230. // capture value
  231. #define SMWDTHROSC_STCV1_STCV1_S 0
  232. //*****************************************************************************
  233. //
  234. // The following are defines for the bit fields in the
  235. // SMWDTHROSC_STCV2 register.
  236. //
  237. //*****************************************************************************
  238. #define SMWDTHROSC_STCV2_STCV2_M \
  239. 0x000000FF // Bits [23:16] of Sleep Timer
  240. // capture value
  241. #define SMWDTHROSC_STCV2_STCV2_S 0
  242. //*****************************************************************************
  243. //
  244. // The following are defines for the bit fields in the
  245. // SMWDTHROSC_STCV3 register.
  246. //
  247. //*****************************************************************************
  248. #define SMWDTHROSC_STCV3_STCV3_M \
  249. 0x000000FF // Bits [32:24] of Sleep Timer
  250. // capture value
  251. #define SMWDTHROSC_STCV3_STCV3_S 0
  252. #endif // __HW_SMWDTHROSC_H__