hw_timer.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. //*****************************************************************************
  2. //
  3. // hw_timer.h - Defines and macros used when accessing the timer.
  4. //
  5. // Copyright (c) 2005-2014 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions
  10. // are met:
  11. //
  12. // Redistributions of source code must retain the above copyright
  13. // notice, this list of conditions and the following disclaimer.
  14. //
  15. // Redistributions in binary form must reproduce the above copyright
  16. // notice, this list of conditions and the following disclaimer in the
  17. // documentation and/or other materials provided with the
  18. // 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. // This is part of revision 2.1.0.12573 of the Tiva Firmware Development Package.
  37. //
  38. //*****************************************************************************
  39. #ifndef __HW_TIMER_H__
  40. #define __HW_TIMER_H__
  41. //*****************************************************************************
  42. //
  43. // The following are defines for the Timer register offsets.
  44. //
  45. //*****************************************************************************
  46. #define TIMER_O_CFG 0x00000000 // GPTM Configuration
  47. #define TIMER_O_TAMR 0x00000004 // GPTM Timer A Mode
  48. #define TIMER_O_TBMR 0x00000008 // GPTM Timer B Mode
  49. #define TIMER_O_CTL 0x0000000C // GPTM Control
  50. #define TIMER_O_SYNC 0x00000010 // GPTM Synchronize
  51. #define TIMER_O_IMR 0x00000018 // GPTM Interrupt Mask
  52. #define TIMER_O_RIS 0x0000001C // GPTM Raw Interrupt Status
  53. #define TIMER_O_MIS 0x00000020 // GPTM Masked Interrupt Status
  54. #define TIMER_O_ICR 0x00000024 // GPTM Interrupt Clear
  55. #define TIMER_O_TAILR 0x00000028 // GPTM Timer A Interval Load
  56. #define TIMER_O_TBILR 0x0000002C // GPTM Timer B Interval Load
  57. #define TIMER_O_TAMATCHR 0x00000030 // GPTM Timer A Match
  58. #define TIMER_O_TBMATCHR 0x00000034 // GPTM Timer B Match
  59. #define TIMER_O_TAPR 0x00000038 // GPTM Timer A Prescale
  60. #define TIMER_O_TBPR 0x0000003C // GPTM Timer B Prescale
  61. #define TIMER_O_TAPMR 0x00000040 // GPTM TimerA Prescale Match
  62. #define TIMER_O_TBPMR 0x00000044 // GPTM TimerB Prescale Match
  63. #define TIMER_O_TAR 0x00000048 // GPTM Timer A
  64. #define TIMER_O_TBR 0x0000004C // GPTM Timer B
  65. #define TIMER_O_TAV 0x00000050 // GPTM Timer A Value
  66. #define TIMER_O_TBV 0x00000054 // GPTM Timer B Value
  67. #define TIMER_O_RTCPD 0x00000058 // GPTM RTC Predivide
  68. #define TIMER_O_TAPS 0x0000005C // GPTM Timer A Prescale Snapshot
  69. #define TIMER_O_TBPS 0x00000060 // GPTM Timer B Prescale Snapshot
  70. #define TIMER_O_TAPV 0x00000064 // GPTM Timer A Prescale Value
  71. #define TIMER_O_TBPV 0x00000068 // GPTM Timer B Prescale Value
  72. #define TIMER_O_DMAEV 0x0000006C // GPTM DMA Event
  73. #define TIMER_O_ADCEV 0x00000070 // GPTM ADC Event
  74. #define TIMER_O_PP 0x00000FC0 // GPTM Peripheral Properties
  75. #define TIMER_O_CC 0x00000FC8 // GPTM Clock Configuration
  76. //*****************************************************************************
  77. //
  78. // The following are defines for the bit fields in the TIMER_O_CFG register.
  79. //
  80. //*****************************************************************************
  81. #define TIMER_CFG_M 0x00000007 // GPTM Configuration
  82. #define TIMER_CFG_32_BIT_TIMER 0x00000000 // For a 16/32-bit timer, this
  83. // value selects the 32-bit timer
  84. // configuration
  85. #define TIMER_CFG_32_BIT_RTC 0x00000001 // For a 16/32-bit timer, this
  86. // value selects the 32-bit
  87. // real-time clock (RTC) counter
  88. // configuration
  89. #define TIMER_CFG_16_BIT 0x00000004 // For a 16/32-bit timer, this
  90. // value selects the 16-bit timer
  91. // configuration
  92. //*****************************************************************************
  93. //
  94. // The following are defines for the bit fields in the TIMER_O_TAMR register.
  95. //
  96. //*****************************************************************************
  97. #define TIMER_TAMR_TCACT_M 0x0000E000 // Timer Compare Action Select
  98. #define TIMER_TAMR_TCACT_NONE 0x00000000 // Disable compare operations
  99. #define TIMER_TAMR_TCACT_TOGGLE 0x00002000 // Toggle State on Time-Out
  100. #define TIMER_TAMR_TCACT_CLRTO 0x00004000 // Clear CCP on Time-Out
  101. #define TIMER_TAMR_TCACT_SETTO 0x00006000 // Set CCP on Time-Out
  102. #define TIMER_TAMR_TCACT_SETTOGTO \
  103. 0x00008000 // Set CCP immediately and toggle
  104. // on Time-Out
  105. #define TIMER_TAMR_TCACT_CLRTOGTO \
  106. 0x0000A000 // Clear CCP immediately and toggle
  107. // on Time-Out
  108. #define TIMER_TAMR_TCACT_SETCLRTO \
  109. 0x0000C000 // Set CCP immediately and clear on
  110. // Time-Out
  111. #define TIMER_TAMR_TCACT_CLRSETTO \
  112. 0x0000E000 // Clear CCP immediately and set on
  113. // Time-Out
  114. #define TIMER_TAMR_TACINTD 0x00001000 // One-shot/Periodic Interrupt
  115. // Disable
  116. #define TIMER_TAMR_TAPLO 0x00000800 // GPTM Timer A PWM Legacy
  117. // Operation
  118. #define TIMER_TAMR_TAMRSU 0x00000400 // GPTM Timer A Match Register
  119. // Update
  120. #define TIMER_TAMR_TAPWMIE 0x00000200 // GPTM Timer A PWM Interrupt
  121. // Enable
  122. #define TIMER_TAMR_TAILD 0x00000100 // GPTM Timer A Interval Load Write
  123. #define TIMER_TAMR_TASNAPS 0x00000080 // GPTM Timer A Snap-Shot Mode
  124. #define TIMER_TAMR_TAWOT 0x00000040 // GPTM Timer A Wait-on-Trigger
  125. #define TIMER_TAMR_TAMIE 0x00000020 // GPTM Timer A Match Interrupt
  126. // Enable
  127. #define TIMER_TAMR_TACDIR 0x00000010 // GPTM Timer A Count Direction
  128. #define TIMER_TAMR_TAAMS 0x00000008 // GPTM Timer A Alternate Mode
  129. // Select
  130. #define TIMER_TAMR_TACMR 0x00000004 // GPTM Timer A Capture Mode
  131. #define TIMER_TAMR_TAMR_M 0x00000003 // GPTM Timer A Mode
  132. #define TIMER_TAMR_TAMR_1_SHOT 0x00000001 // One-Shot Timer mode
  133. #define TIMER_TAMR_TAMR_PERIOD 0x00000002 // Periodic Timer mode
  134. #define TIMER_TAMR_TAMR_CAP 0x00000003 // Capture mode
  135. //*****************************************************************************
  136. //
  137. // The following are defines for the bit fields in the TIMER_O_TBMR register.
  138. //
  139. //*****************************************************************************
  140. #define TIMER_TBMR_TCACT_M 0x0000E000 // Timer Compare Action Select
  141. #define TIMER_TBMR_TCACT_NONE 0x00000000 // Disable compare operations
  142. #define TIMER_TBMR_TCACT_TOGGLE 0x00002000 // Toggle State on Time-Out
  143. #define TIMER_TBMR_TCACT_CLRTO 0x00004000 // Clear CCP on Time-Out
  144. #define TIMER_TBMR_TCACT_SETTO 0x00006000 // Set CCP on Time-Out
  145. #define TIMER_TBMR_TCACT_SETTOGTO \
  146. 0x00008000 // Set CCP immediately and toggle
  147. // on Time-Out
  148. #define TIMER_TBMR_TCACT_CLRTOGTO \
  149. 0x0000A000 // Clear CCP immediately and toggle
  150. // on Time-Out
  151. #define TIMER_TBMR_TCACT_SETCLRTO \
  152. 0x0000C000 // Set CCP immediately and clear on
  153. // Time-Out
  154. #define TIMER_TBMR_TCACT_CLRSETTO \
  155. 0x0000E000 // Clear CCP immediately and set on
  156. // Time-Out
  157. #define TIMER_TBMR_TBCINTD 0x00001000 // One-Shot/Periodic Interrupt
  158. // Disable
  159. #define TIMER_TBMR_TBPLO 0x00000800 // GPTM Timer B PWM Legacy
  160. // Operation
  161. #define TIMER_TBMR_TBMRSU 0x00000400 // GPTM Timer B Match Register
  162. // Update
  163. #define TIMER_TBMR_TBPWMIE 0x00000200 // GPTM Timer B PWM Interrupt
  164. // Enable
  165. #define TIMER_TBMR_TBILD 0x00000100 // GPTM Timer B Interval Load Write
  166. #define TIMER_TBMR_TBSNAPS 0x00000080 // GPTM Timer B Snap-Shot Mode
  167. #define TIMER_TBMR_TBWOT 0x00000040 // GPTM Timer B Wait-on-Trigger
  168. #define TIMER_TBMR_TBMIE 0x00000020 // GPTM Timer B Match Interrupt
  169. // Enable
  170. #define TIMER_TBMR_TBCDIR 0x00000010 // GPTM Timer B Count Direction
  171. #define TIMER_TBMR_TBAMS 0x00000008 // GPTM Timer B Alternate Mode
  172. // Select
  173. #define TIMER_TBMR_TBCMR 0x00000004 // GPTM Timer B Capture Mode
  174. #define TIMER_TBMR_TBMR_M 0x00000003 // GPTM Timer B Mode
  175. #define TIMER_TBMR_TBMR_1_SHOT 0x00000001 // One-Shot Timer mode
  176. #define TIMER_TBMR_TBMR_PERIOD 0x00000002 // Periodic Timer mode
  177. #define TIMER_TBMR_TBMR_CAP 0x00000003 // Capture mode
  178. //*****************************************************************************
  179. //
  180. // The following are defines for the bit fields in the TIMER_O_CTL register.
  181. //
  182. //*****************************************************************************
  183. #define TIMER_CTL_TBPWML 0x00004000 // GPTM Timer B PWM Output Level
  184. #define TIMER_CTL_TBOTE 0x00002000 // GPTM Timer B Output Trigger
  185. // Enable
  186. #define TIMER_CTL_TBEVENT_M 0x00000C00 // GPTM Timer B Event Mode
  187. #define TIMER_CTL_TBEVENT_POS 0x00000000 // Positive edge
  188. #define TIMER_CTL_TBEVENT_NEG 0x00000400 // Negative edge
  189. #define TIMER_CTL_TBEVENT_BOTH 0x00000C00 // Both edges
  190. #define TIMER_CTL_TBSTALL 0x00000200 // GPTM Timer B Stall Enable
  191. #define TIMER_CTL_TBEN 0x00000100 // GPTM Timer B Enable
  192. #define TIMER_CTL_TAPWML 0x00000040 // GPTM Timer A PWM Output Level
  193. #define TIMER_CTL_TAOTE 0x00000020 // GPTM Timer A Output Trigger
  194. // Enable
  195. #define TIMER_CTL_RTCEN 0x00000010 // GPTM RTC Stall Enable
  196. #define TIMER_CTL_TAEVENT_M 0x0000000C // GPTM Timer A Event Mode
  197. #define TIMER_CTL_TAEVENT_POS 0x00000000 // Positive edge
  198. #define TIMER_CTL_TAEVENT_NEG 0x00000004 // Negative edge
  199. #define TIMER_CTL_TAEVENT_BOTH 0x0000000C // Both edges
  200. #define TIMER_CTL_TASTALL 0x00000002 // GPTM Timer A Stall Enable
  201. #define TIMER_CTL_TAEN 0x00000001 // GPTM Timer A Enable
  202. //*****************************************************************************
  203. //
  204. // The following are defines for the bit fields in the TIMER_O_SYNC register.
  205. //
  206. //*****************************************************************************
  207. #define TIMER_SYNC_SYNCWT5_M 0x00C00000 // Synchronize GPTM 32/64-Bit Timer
  208. // 5
  209. #define TIMER_SYNC_SYNCWT5_NONE 0x00000000 // GPTM 32/64-Bit Timer 5 is not
  210. // affected
  211. #define TIMER_SYNC_SYNCWT5_TA 0x00400000 // A timeout event for Timer A of
  212. // GPTM 32/64-Bit Timer 5 is
  213. // triggered
  214. #define TIMER_SYNC_SYNCWT5_TB 0x00800000 // A timeout event for Timer B of
  215. // GPTM 32/64-Bit Timer 5 is
  216. // triggered
  217. #define TIMER_SYNC_SYNCWT5_TATB 0x00C00000 // A timeout event for both Timer A
  218. // and Timer B of GPTM 32/64-Bit
  219. // Timer 5 is triggered
  220. #define TIMER_SYNC_SYNCWT4_M 0x00300000 // Synchronize GPTM 32/64-Bit Timer
  221. // 4
  222. #define TIMER_SYNC_SYNCWT4_NONE 0x00000000 // GPTM 32/64-Bit Timer 4 is not
  223. // affected
  224. #define TIMER_SYNC_SYNCWT4_TA 0x00100000 // A timeout event for Timer A of
  225. // GPTM 32/64-Bit Timer 4 is
  226. // triggered
  227. #define TIMER_SYNC_SYNCWT4_TB 0x00200000 // A timeout event for Timer B of
  228. // GPTM 32/64-Bit Timer 4 is
  229. // triggered
  230. #define TIMER_SYNC_SYNCWT4_TATB 0x00300000 // A timeout event for both Timer A
  231. // and Timer B of GPTM 32/64-Bit
  232. // Timer 4 is triggered
  233. #define TIMER_SYNC_SYNCWT3_M 0x000C0000 // Synchronize GPTM 32/64-Bit Timer
  234. // 3
  235. #define TIMER_SYNC_SYNCWT3_NONE 0x00000000 // GPTM 32/64-Bit Timer 3 is not
  236. // affected
  237. #define TIMER_SYNC_SYNCWT3_TA 0x00040000 // A timeout event for Timer A of
  238. // GPTM 32/64-Bit Timer 3 is
  239. // triggered
  240. #define TIMER_SYNC_SYNCWT3_TB 0x00080000 // A timeout event for Timer B of
  241. // GPTM 32/64-Bit Timer 3 is
  242. // triggered
  243. #define TIMER_SYNC_SYNCWT3_TATB 0x000C0000 // A timeout event for both Timer A
  244. // and Timer B of GPTM 32/64-Bit
  245. // Timer 3 is triggered
  246. #define TIMER_SYNC_SYNCWT2_M 0x00030000 // Synchronize GPTM 32/64-Bit Timer
  247. // 2
  248. #define TIMER_SYNC_SYNCWT2_NONE 0x00000000 // GPTM 32/64-Bit Timer 2 is not
  249. // affected
  250. #define TIMER_SYNC_SYNCWT2_TA 0x00010000 // A timeout event for Timer A of
  251. // GPTM 32/64-Bit Timer 2 is
  252. // triggered
  253. #define TIMER_SYNC_SYNCWT2_TB 0x00020000 // A timeout event for Timer B of
  254. // GPTM 32/64-Bit Timer 2 is
  255. // triggered
  256. #define TIMER_SYNC_SYNCWT2_TATB 0x00030000 // A timeout event for both Timer A
  257. // and Timer B of GPTM 32/64-Bit
  258. // Timer 2 is triggered
  259. #define TIMER_SYNC_SYNCT7_M 0x0000C000 // Synchronize GPTM Timer 7
  260. #define TIMER_SYNC_SYNCT7_NONE 0x00000000 // GPT7 is not affected
  261. #define TIMER_SYNC_SYNCT7_TA 0x00004000 // A timeout event for Timer A of
  262. // GPTM7 is triggered
  263. #define TIMER_SYNC_SYNCT7_TB 0x00008000 // A timeout event for Timer B of
  264. // GPTM7 is triggered
  265. #define TIMER_SYNC_SYNCT7_TATB 0x0000C000 // A timeout event for both Timer A
  266. // and Timer B of GPTM7 is
  267. // triggered
  268. #define TIMER_SYNC_SYNCWT1_M 0x0000C000 // Synchronize GPTM 32/64-Bit Timer
  269. // 1
  270. #define TIMER_SYNC_SYNCWT1_NONE 0x00000000 // GPTM 32/64-Bit Timer 1 is not
  271. // affected
  272. #define TIMER_SYNC_SYNCWT1_TA 0x00004000 // A timeout event for Timer A of
  273. // GPTM 32/64-Bit Timer 1 is
  274. // triggered
  275. #define TIMER_SYNC_SYNCWT1_TB 0x00008000 // A timeout event for Timer B of
  276. // GPTM 32/64-Bit Timer 1 is
  277. // triggered
  278. #define TIMER_SYNC_SYNCWT1_TATB 0x0000C000 // A timeout event for both Timer A
  279. // and Timer B of GPTM 32/64-Bit
  280. // Timer 1 is triggered
  281. #define TIMER_SYNC_SYNCWT0_M 0x00003000 // Synchronize GPTM 32/64-Bit Timer
  282. // 0
  283. #define TIMER_SYNC_SYNCWT0_NONE 0x00000000 // GPTM 32/64-Bit Timer 0 is not
  284. // affected
  285. #define TIMER_SYNC_SYNCWT0_TA 0x00001000 // A timeout event for Timer A of
  286. // GPTM 32/64-Bit Timer 0 is
  287. // triggered
  288. #define TIMER_SYNC_SYNCWT0_TB 0x00002000 // A timeout event for Timer B of
  289. // GPTM 32/64-Bit Timer 0 is
  290. // triggered
  291. #define TIMER_SYNC_SYNCWT0_TATB 0x00003000 // A timeout event for both Timer A
  292. // and Timer B of GPTM 32/64-Bit
  293. // Timer 0 is triggered
  294. #define TIMER_SYNC_SYNCT6_M 0x00003000 // Synchronize GPTM Timer 6
  295. #define TIMER_SYNC_SYNCT6_NONE 0x00000000 // GPTM6 is not affected
  296. #define TIMER_SYNC_SYNCT6_TA 0x00001000 // A timeout event for Timer A of
  297. // GPTM6 is triggered
  298. #define TIMER_SYNC_SYNCT6_TB 0x00002000 // A timeout event for Timer B of
  299. // GPTM6 is triggered
  300. #define TIMER_SYNC_SYNCT6_TATB 0x00003000 // A timeout event for both Timer A
  301. // and Timer B of GPTM6 is
  302. // triggered
  303. #define TIMER_SYNC_SYNCT5_M 0x00000C00 // Synchronize GPTM Timer 5
  304. #define TIMER_SYNC_SYNCT5_NONE 0x00000000 // GPTM5 is not affected
  305. #define TIMER_SYNC_SYNCT5_TA 0x00000400 // A timeout event for Timer A of
  306. // GPTM5 is triggered
  307. #define TIMER_SYNC_SYNCT5_TB 0x00000800 // A timeout event for Timer B of
  308. // GPTM5 is triggered
  309. #define TIMER_SYNC_SYNCT5_TATB 0x00000C00 // A timeout event for both Timer A
  310. // and Timer B of GPTM5 is
  311. // triggered
  312. #define TIMER_SYNC_SYNCT4_M 0x00000300 // Synchronize GPTM Timer 4
  313. #define TIMER_SYNC_SYNCT4_NONE 0x00000000 // GPTM4 is not affected
  314. #define TIMER_SYNC_SYNCT4_TA 0x00000100 // A timeout event for Timer A of
  315. // GPTM4 is triggered
  316. #define TIMER_SYNC_SYNCT4_TB 0x00000200 // A timeout event for Timer B of
  317. // GPTM4 is triggered
  318. #define TIMER_SYNC_SYNCT4_TATB 0x00000300 // A timeout event for both Timer A
  319. // and Timer B of GPTM4 is
  320. // triggered
  321. #define TIMER_SYNC_SYNCT3_M 0x000000C0 // Synchronize GPTM Timer 3
  322. #define TIMER_SYNC_SYNCT3_NONE 0x00000000 // GPTM3 is not affected
  323. #define TIMER_SYNC_SYNCT3_TA 0x00000040 // A timeout event for Timer A of
  324. // GPTM3 is triggered
  325. #define TIMER_SYNC_SYNCT3_TB 0x00000080 // A timeout event for Timer B of
  326. // GPTM3 is triggered
  327. #define TIMER_SYNC_SYNCT3_TATB 0x000000C0 // A timeout event for both Timer A
  328. // and Timer B of GPTM3 is
  329. // triggered
  330. #define TIMER_SYNC_SYNCT2_M 0x00000030 // Synchronize GPTM Timer 2
  331. #define TIMER_SYNC_SYNCT2_NONE 0x00000000 // GPTM2 is not affected
  332. #define TIMER_SYNC_SYNCT2_TA 0x00000010 // A timeout event for Timer A of
  333. // GPTM2 is triggered
  334. #define TIMER_SYNC_SYNCT2_TB 0x00000020 // A timeout event for Timer B of
  335. // GPTM2 is triggered
  336. #define TIMER_SYNC_SYNCT2_TATB 0x00000030 // A timeout event for both Timer A
  337. // and Timer B of GPTM2 is
  338. // triggered
  339. #define TIMER_SYNC_SYNCT1_M 0x0000000C // Synchronize GPTM Timer 1
  340. #define TIMER_SYNC_SYNCT1_NONE 0x00000000 // GPTM1 is not affected
  341. #define TIMER_SYNC_SYNCT1_TA 0x00000004 // A timeout event for Timer A of
  342. // GPTM1 is triggered
  343. #define TIMER_SYNC_SYNCT1_TB 0x00000008 // A timeout event for Timer B of
  344. // GPTM1 is triggered
  345. #define TIMER_SYNC_SYNCT1_TATB 0x0000000C // A timeout event for both Timer A
  346. // and Timer B of GPTM1 is
  347. // triggered
  348. #define TIMER_SYNC_SYNCT0_M 0x00000003 // Synchronize GPTM Timer 0
  349. #define TIMER_SYNC_SYNCT0_NONE 0x00000000 // GPTM0 is not affected
  350. #define TIMER_SYNC_SYNCT0_TA 0x00000001 // A timeout event for Timer A of
  351. // GPTM0 is triggered
  352. #define TIMER_SYNC_SYNCT0_TB 0x00000002 // A timeout event for Timer B of
  353. // GPTM0 is triggered
  354. #define TIMER_SYNC_SYNCT0_TATB 0x00000003 // A timeout event for both Timer A
  355. // and Timer B of GPTM0 is
  356. // triggered
  357. //*****************************************************************************
  358. //
  359. // The following are defines for the bit fields in the TIMER_O_IMR register.
  360. //
  361. //*****************************************************************************
  362. #define TIMER_IMR_WUEIM 0x00010000 // 32/64-Bit Wide GPTM Write Update
  363. // Error Interrupt Mask
  364. #define TIMER_IMR_DMABIM 0x00002000 // GPTM Timer B DMA Done Interrupt
  365. // Mask
  366. #define TIMER_IMR_TBMIM 0x00000800 // GPTM Timer B Match Interrupt
  367. // Mask
  368. #define TIMER_IMR_CBEIM 0x00000400 // GPTM Timer B Capture Mode Event
  369. // Interrupt Mask
  370. #define TIMER_IMR_CBMIM 0x00000200 // GPTM Timer B Capture Mode Match
  371. // Interrupt Mask
  372. #define TIMER_IMR_TBTOIM 0x00000100 // GPTM Timer B Time-Out Interrupt
  373. // Mask
  374. #define TIMER_IMR_DMAAIM 0x00000020 // GPTM Timer A DMA Done Interrupt
  375. // Mask
  376. #define TIMER_IMR_TAMIM 0x00000010 // GPTM Timer A Match Interrupt
  377. // Mask
  378. #define TIMER_IMR_RTCIM 0x00000008 // GPTM RTC Interrupt Mask
  379. #define TIMER_IMR_CAEIM 0x00000004 // GPTM Timer A Capture Mode Event
  380. // Interrupt Mask
  381. #define TIMER_IMR_CAMIM 0x00000002 // GPTM Timer A Capture Mode Match
  382. // Interrupt Mask
  383. #define TIMER_IMR_TATOIM 0x00000001 // GPTM Timer A Time-Out Interrupt
  384. // Mask
  385. //*****************************************************************************
  386. //
  387. // The following are defines for the bit fields in the TIMER_O_RIS register.
  388. //
  389. //*****************************************************************************
  390. #define TIMER_RIS_WUERIS 0x00010000 // 32/64-Bit Wide GPTM Write Update
  391. // Error Raw Interrupt Status
  392. #define TIMER_RIS_DMABRIS 0x00002000 // GPTM Timer B DMA Done Raw
  393. // Interrupt Status
  394. #define TIMER_RIS_TBMRIS 0x00000800 // GPTM Timer B Match Raw Interrupt
  395. #define TIMER_RIS_CBERIS 0x00000400 // GPTM Timer B Capture Mode Event
  396. // Raw Interrupt
  397. #define TIMER_RIS_CBMRIS 0x00000200 // GPTM Timer B Capture Mode Match
  398. // Raw Interrupt
  399. #define TIMER_RIS_TBTORIS 0x00000100 // GPTM Timer B Time-Out Raw
  400. // Interrupt
  401. #define TIMER_RIS_DMAARIS 0x00000020 // GPTM Timer A DMA Done Raw
  402. // Interrupt Status
  403. #define TIMER_RIS_TAMRIS 0x00000010 // GPTM Timer A Match Raw Interrupt
  404. #define TIMER_RIS_RTCRIS 0x00000008 // GPTM RTC Raw Interrupt
  405. #define TIMER_RIS_CAERIS 0x00000004 // GPTM Timer A Capture Mode Event
  406. // Raw Interrupt
  407. #define TIMER_RIS_CAMRIS 0x00000002 // GPTM Timer A Capture Mode Match
  408. // Raw Interrupt
  409. #define TIMER_RIS_TATORIS 0x00000001 // GPTM Timer A Time-Out Raw
  410. // Interrupt
  411. //*****************************************************************************
  412. //
  413. // The following are defines for the bit fields in the TIMER_O_MIS register.
  414. //
  415. //*****************************************************************************
  416. #define TIMER_MIS_WUEMIS 0x00010000 // 32/64-Bit Wide GPTM Write Update
  417. // Error Masked Interrupt Status
  418. #define TIMER_MIS_DMABMIS 0x00002000 // GPTM Timer B DMA Done Masked
  419. // Interrupt
  420. #define TIMER_MIS_TBMMIS 0x00000800 // GPTM Timer B Match Masked
  421. // Interrupt
  422. #define TIMER_MIS_CBEMIS 0x00000400 // GPTM Timer B Capture Mode Event
  423. // Masked Interrupt
  424. #define TIMER_MIS_CBMMIS 0x00000200 // GPTM Timer B Capture Mode Match
  425. // Masked Interrupt
  426. #define TIMER_MIS_TBTOMIS 0x00000100 // GPTM Timer B Time-Out Masked
  427. // Interrupt
  428. #define TIMER_MIS_DMAAMIS 0x00000020 // GPTM Timer A DMA Done Masked
  429. // Interrupt
  430. #define TIMER_MIS_TAMMIS 0x00000010 // GPTM Timer A Match Masked
  431. // Interrupt
  432. #define TIMER_MIS_RTCMIS 0x00000008 // GPTM RTC Masked Interrupt
  433. #define TIMER_MIS_CAEMIS 0x00000004 // GPTM Timer A Capture Mode Event
  434. // Masked Interrupt
  435. #define TIMER_MIS_CAMMIS 0x00000002 // GPTM Timer A Capture Mode Match
  436. // Masked Interrupt
  437. #define TIMER_MIS_TATOMIS 0x00000001 // GPTM Timer A Time-Out Masked
  438. // Interrupt
  439. //*****************************************************************************
  440. //
  441. // The following are defines for the bit fields in the TIMER_O_ICR register.
  442. //
  443. //*****************************************************************************
  444. #define TIMER_ICR_WUECINT 0x00010000 // 32/64-Bit Wide GPTM Write Update
  445. // Error Interrupt Clear
  446. #define TIMER_ICR_DMABINT 0x00002000 // GPTM Timer B DMA Done Interrupt
  447. // Clear
  448. #define TIMER_ICR_TBMCINT 0x00000800 // GPTM Timer B Match Interrupt
  449. // Clear
  450. #define TIMER_ICR_CBECINT 0x00000400 // GPTM Timer B Capture Mode Event
  451. // Interrupt Clear
  452. #define TIMER_ICR_CBMCINT 0x00000200 // GPTM Timer B Capture Mode Match
  453. // Interrupt Clear
  454. #define TIMER_ICR_TBTOCINT 0x00000100 // GPTM Timer B Time-Out Interrupt
  455. // Clear
  456. #define TIMER_ICR_DMAAINT 0x00000020 // GPTM Timer A DMA Done Interrupt
  457. // Clear
  458. #define TIMER_ICR_TAMCINT 0x00000010 // GPTM Timer A Match Interrupt
  459. // Clear
  460. #define TIMER_ICR_RTCCINT 0x00000008 // GPTM RTC Interrupt Clear
  461. #define TIMER_ICR_CAECINT 0x00000004 // GPTM Timer A Capture Mode Event
  462. // Interrupt Clear
  463. #define TIMER_ICR_CAMCINT 0x00000002 // GPTM Timer A Capture Mode Match
  464. // Interrupt Clear
  465. #define TIMER_ICR_TATOCINT 0x00000001 // GPTM Timer A Time-Out Raw
  466. // Interrupt
  467. //*****************************************************************************
  468. //
  469. // The following are defines for the bit fields in the TIMER_O_TAILR register.
  470. //
  471. //*****************************************************************************
  472. #define TIMER_TAILR_M 0xFFFFFFFF // GPTM Timer A Interval Load
  473. // Register
  474. #define TIMER_TAILR_S 0
  475. //*****************************************************************************
  476. //
  477. // The following are defines for the bit fields in the TIMER_O_TBILR register.
  478. //
  479. //*****************************************************************************
  480. #define TIMER_TBILR_M 0xFFFFFFFF // GPTM Timer B Interval Load
  481. // Register
  482. #define TIMER_TBILR_S 0
  483. //*****************************************************************************
  484. //
  485. // The following are defines for the bit fields in the TIMER_O_TAMATCHR
  486. // register.
  487. //
  488. //*****************************************************************************
  489. #define TIMER_TAMATCHR_TAMR_M 0xFFFFFFFF // GPTM Timer A Match Register
  490. #define TIMER_TAMATCHR_TAMR_S 0
  491. //*****************************************************************************
  492. //
  493. // The following are defines for the bit fields in the TIMER_O_TBMATCHR
  494. // register.
  495. //
  496. //*****************************************************************************
  497. #define TIMER_TBMATCHR_TBMR_M 0xFFFFFFFF // GPTM Timer B Match Register
  498. #define TIMER_TBMATCHR_TBMR_S 0
  499. //*****************************************************************************
  500. //
  501. // The following are defines for the bit fields in the TIMER_O_TAPR register.
  502. //
  503. //*****************************************************************************
  504. #define TIMER_TAPR_TAPSRH_M 0x0000FF00 // GPTM Timer A Prescale High Byte
  505. #define TIMER_TAPR_TAPSR_M 0x000000FF // GPTM Timer A Prescale
  506. #define TIMER_TAPR_TAPSRH_S 8
  507. #define TIMER_TAPR_TAPSR_S 0
  508. //*****************************************************************************
  509. //
  510. // The following are defines for the bit fields in the TIMER_O_TBPR register.
  511. //
  512. //*****************************************************************************
  513. #define TIMER_TBPR_TBPSRH_M 0x0000FF00 // GPTM Timer B Prescale High Byte
  514. #define TIMER_TBPR_TBPSR_M 0x000000FF // GPTM Timer B Prescale
  515. #define TIMER_TBPR_TBPSRH_S 8
  516. #define TIMER_TBPR_TBPSR_S 0
  517. //*****************************************************************************
  518. //
  519. // The following are defines for the bit fields in the TIMER_O_TAPMR register.
  520. //
  521. //*****************************************************************************
  522. #define TIMER_TAPMR_TAPSMRH_M 0x0000FF00 // GPTM Timer A Prescale Match High
  523. // Byte
  524. #define TIMER_TAPMR_TAPSMR_M 0x000000FF // GPTM TimerA Prescale Match
  525. #define TIMER_TAPMR_TAPSMRH_S 8
  526. #define TIMER_TAPMR_TAPSMR_S 0
  527. //*****************************************************************************
  528. //
  529. // The following are defines for the bit fields in the TIMER_O_TBPMR register.
  530. //
  531. //*****************************************************************************
  532. #define TIMER_TBPMR_TBPSMRH_M 0x0000FF00 // GPTM Timer B Prescale Match High
  533. // Byte
  534. #define TIMER_TBPMR_TBPSMR_M 0x000000FF // GPTM TimerB Prescale Match
  535. #define TIMER_TBPMR_TBPSMRH_S 8
  536. #define TIMER_TBPMR_TBPSMR_S 0
  537. //*****************************************************************************
  538. //
  539. // The following are defines for the bit fields in the TIMER_O_TAR register.
  540. //
  541. //*****************************************************************************
  542. #define TIMER_TAR_M 0xFFFFFFFF // GPTM Timer A Register
  543. #define TIMER_TAR_S 0
  544. //*****************************************************************************
  545. //
  546. // The following are defines for the bit fields in the TIMER_O_TBR register.
  547. //
  548. //*****************************************************************************
  549. #define TIMER_TBR_M 0xFFFFFFFF // GPTM Timer B Register
  550. #define TIMER_TBR_S 0
  551. //*****************************************************************************
  552. //
  553. // The following are defines for the bit fields in the TIMER_O_TAV register.
  554. //
  555. //*****************************************************************************
  556. #define TIMER_TAV_M 0xFFFFFFFF // GPTM Timer A Value
  557. #define TIMER_TAV_S 0
  558. //*****************************************************************************
  559. //
  560. // The following are defines for the bit fields in the TIMER_O_TBV register.
  561. //
  562. //*****************************************************************************
  563. #define TIMER_TBV_M 0xFFFFFFFF // GPTM Timer B Value
  564. #define TIMER_TBV_S 0
  565. //*****************************************************************************
  566. //
  567. // The following are defines for the bit fields in the TIMER_O_RTCPD register.
  568. //
  569. //*****************************************************************************
  570. #define TIMER_RTCPD_RTCPD_M 0x0000FFFF // RTC Predivide Counter Value
  571. #define TIMER_RTCPD_RTCPD_S 0
  572. //*****************************************************************************
  573. //
  574. // The following are defines for the bit fields in the TIMER_O_TAPS register.
  575. //
  576. //*****************************************************************************
  577. #define TIMER_TAPS_PSS_M 0x0000FFFF // GPTM Timer A Prescaler Snapshot
  578. #define TIMER_TAPS_PSS_S 0
  579. //*****************************************************************************
  580. //
  581. // The following are defines for the bit fields in the TIMER_O_TBPS register.
  582. //
  583. //*****************************************************************************
  584. #define TIMER_TBPS_PSS_M 0x0000FFFF // GPTM Timer A Prescaler Value
  585. #define TIMER_TBPS_PSS_S 0
  586. //*****************************************************************************
  587. //
  588. // The following are defines for the bit fields in the TIMER_O_TAPV register.
  589. //
  590. //*****************************************************************************
  591. #define TIMER_TAPV_PSV_M 0x0000FFFF // GPTM Timer A Prescaler Value
  592. #define TIMER_TAPV_PSV_S 0
  593. //*****************************************************************************
  594. //
  595. // The following are defines for the bit fields in the TIMER_O_TBPV register.
  596. //
  597. //*****************************************************************************
  598. #define TIMER_TBPV_PSV_M 0x0000FFFF // GPTM Timer B Prescaler Value
  599. #define TIMER_TBPV_PSV_S 0
  600. //*****************************************************************************
  601. //
  602. // The following are defines for the bit fields in the TIMER_O_DMAEV register.
  603. //
  604. //*****************************************************************************
  605. #define TIMER_DMAEV_TBMDMAEN 0x00000800 // GPTM B Mode Match Event DMA
  606. // Trigger Enable
  607. #define TIMER_DMAEV_CBEDMAEN 0x00000400 // GPTM B Capture Event DMA Trigger
  608. // Enable
  609. #define TIMER_DMAEV_CBMDMAEN 0x00000200 // GPTM B Capture Match Event DMA
  610. // Trigger Enable
  611. #define TIMER_DMAEV_TBTODMAEN 0x00000100 // GPTM B Time-Out Event DMA
  612. // Trigger Enable
  613. #define TIMER_DMAEV_TAMDMAEN 0x00000010 // GPTM A Mode Match Event DMA
  614. // Trigger Enable
  615. #define TIMER_DMAEV_RTCDMAEN 0x00000008 // GPTM A RTC Match Event DMA
  616. // Trigger Enable
  617. #define TIMER_DMAEV_CAEDMAEN 0x00000004 // GPTM A Capture Event DMA Trigger
  618. // Enable
  619. #define TIMER_DMAEV_CAMDMAEN 0x00000002 // GPTM A Capture Match Event DMA
  620. // Trigger Enable
  621. #define TIMER_DMAEV_TATODMAEN 0x00000001 // GPTM A Time-Out Event DMA
  622. // Trigger Enable
  623. //*****************************************************************************
  624. //
  625. // The following are defines for the bit fields in the TIMER_O_ADCEV register.
  626. //
  627. //*****************************************************************************
  628. #define TIMER_ADCEV_TBMADCEN 0x00000800 // GPTM B Mode Match Event ADC
  629. // Trigger Enable
  630. #define TIMER_ADCEV_CBEADCEN 0x00000400 // GPTM B Capture Event ADC Trigger
  631. // Enable
  632. #define TIMER_ADCEV_CBMADCEN 0x00000200 // GPTM B Capture Match Event ADC
  633. // Trigger Enable
  634. #define TIMER_ADCEV_TBTOADCEN 0x00000100 // GPTM B Time-Out Event ADC
  635. // Trigger Enable
  636. #define TIMER_ADCEV_TAMADCEN 0x00000010 // GPTM A Mode Match Event ADC
  637. // Trigger Enable
  638. #define TIMER_ADCEV_RTCADCEN 0x00000008 // GPTM RTC Match Event ADC Trigger
  639. // Enable
  640. #define TIMER_ADCEV_CAEADCEN 0x00000004 // GPTM A Capture Event ADC Trigger
  641. // Enable
  642. #define TIMER_ADCEV_CAMADCEN 0x00000002 // GPTM A Capture Match Event ADC
  643. // Trigger Enable
  644. #define TIMER_ADCEV_TATOADCEN 0x00000001 // GPTM A Time-Out Event ADC
  645. // Trigger Enable
  646. //*****************************************************************************
  647. //
  648. // The following are defines for the bit fields in the TIMER_O_PP register.
  649. //
  650. //*****************************************************************************
  651. #define TIMER_PP_ALTCLK 0x00000040 // Alternate Clock Source
  652. #define TIMER_PP_SYNCCNT 0x00000020 // Synchronize Start
  653. #define TIMER_PP_CHAIN 0x00000010 // Chain with Other Timers
  654. #define TIMER_PP_SIZE_M 0x0000000F // Count Size
  655. #define TIMER_PP_SIZE_16 0x00000000 // Timer A and Timer B counters are
  656. // 16 bits each with an 8-bit
  657. // prescale counter
  658. #define TIMER_PP_SIZE_32 0x00000001 // Timer A and Timer B counters are
  659. // 32 bits each with a 16-bit
  660. // prescale counter
  661. //*****************************************************************************
  662. //
  663. // The following are defines for the bit fields in the TIMER_O_CC register.
  664. //
  665. //*****************************************************************************
  666. #define TIMER_CC_ALTCLK 0x00000001 // Alternate Clock Source
  667. #endif // __HW_TIMER_H__