hw_timer.h 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. //*****************************************************************************
  2. //
  3. // hw_timer.h - Defines and macros used when accessing the timer.
  4. //
  5. // Copyright (c) 2005-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_TIMER_H__
  25. #define __HW_TIMER_H__
  26. //*****************************************************************************
  27. //
  28. // The following are defines for the Timer register offsets.
  29. //
  30. //*****************************************************************************
  31. #define TIMER_O_CFG 0x00000000 // GPTM Configuration
  32. #define TIMER_O_TAMR 0x00000004 // GPTM Timer A Mode
  33. #define TIMER_O_TBMR 0x00000008 // GPTM Timer B Mode
  34. #define TIMER_O_CTL 0x0000000C // GPTM Control
  35. #define TIMER_O_SYNC 0x00000010 // GPTM Synchronize
  36. #define TIMER_O_IMR 0x00000018 // GPTM Interrupt Mask
  37. #define TIMER_O_RIS 0x0000001C // GPTM Raw Interrupt Status
  38. #define TIMER_O_MIS 0x00000020 // GPTM Masked Interrupt Status
  39. #define TIMER_O_ICR 0x00000024 // GPTM Interrupt Clear
  40. #define TIMER_O_TAILR 0x00000028 // GPTM Timer A Interval Load
  41. #define TIMER_O_TBILR 0x0000002C // GPTM Timer B Interval Load
  42. #define TIMER_O_TAMATCHR 0x00000030 // GPTM Timer A Match
  43. #define TIMER_O_TBMATCHR 0x00000034 // GPTM Timer B Match
  44. #define TIMER_O_TAPR 0x00000038 // GPTM Timer A Prescale
  45. #define TIMER_O_TBPR 0x0000003C // GPTM Timer B Prescale
  46. #define TIMER_O_TAPMR 0x00000040 // GPTM TimerA Prescale Match
  47. #define TIMER_O_TBPMR 0x00000044 // GPTM TimerB Prescale Match
  48. #define TIMER_O_TAR 0x00000048 // GPTM Timer A
  49. #define TIMER_O_TBR 0x0000004C // GPTM Timer B
  50. #define TIMER_O_TAV 0x00000050 // GPTM Timer A Value
  51. #define TIMER_O_TBV 0x00000054 // GPTM Timer B Value
  52. #define TIMER_O_RTCPD 0x00000058 // GPTM RTC Predivide
  53. #define TIMER_O_TAPS 0x0000005C // GPTM Timer A Prescale Snapshot
  54. #define TIMER_O_TBPS 0x00000060 // GPTM Timer B Prescale Snapshot
  55. #define TIMER_O_TAPV 0x00000064 // GPTM Timer A Prescale Value
  56. #define TIMER_O_TBPV 0x00000068 // GPTM Timer B Prescale Value
  57. #define TIMER_O_PP 0x00000FC0 // GPTM Peripheral Properties
  58. //*****************************************************************************
  59. //
  60. // The following are defines for the bit fields in the TIMER_O_CFG register.
  61. //
  62. //*****************************************************************************
  63. #define TIMER_CFG_M 0x00000007 // GPTM Configuration
  64. #define TIMER_CFG_32_BIT_TIMER 0x00000000 // 32-bit timer configuration
  65. #define TIMER_CFG_32_BIT_RTC 0x00000001 // 32-bit real-time clock (RTC)
  66. // counter configuration
  67. #define TIMER_CFG_16_BIT 0x00000004 // 16-bit timer configuration. The
  68. // function is controlled by bits
  69. // 1:0 of GPTMTAMR and GPTMTBMR
  70. //*****************************************************************************
  71. //
  72. // The following are defines for the bit fields in the TIMER_O_TAMR register.
  73. //
  74. //*****************************************************************************
  75. #define TIMER_TAMR_TAPLO 0x00000800 // GPTM Timer A PWM Legacy
  76. // Operation
  77. #define TIMER_TAMR_TAMRSU 0x00000400 // GPTM Timer A Match Register
  78. // Update
  79. #define TIMER_TAMR_TAPWMIE 0x00000200 // GPTM Timer A PWM Interrupt
  80. // Enable
  81. #define TIMER_TAMR_TAILD 0x00000100 // GPTM Timer A Interval Load Write
  82. #define TIMER_TAMR_TASNAPS 0x00000080 // GPTM Timer A Snap-Shot Mode
  83. #define TIMER_TAMR_TAWOT 0x00000040 // GPTM Timer A Wait-on-Trigger
  84. #define TIMER_TAMR_TAMIE 0x00000020 // GPTM Timer A Match Interrupt
  85. // Enable
  86. #define TIMER_TAMR_TACDIR 0x00000010 // GPTM Timer A Count Direction
  87. #define TIMER_TAMR_TAAMS 0x00000008 // GPTM Timer A Alternate Mode
  88. // Select
  89. #define TIMER_TAMR_TACMR 0x00000004 // GPTM Timer A Capture Mode
  90. #define TIMER_TAMR_TAMR_M 0x00000003 // GPTM Timer A Mode
  91. #define TIMER_TAMR_TAMR_1_SHOT 0x00000001 // One-Shot Timer mode
  92. #define TIMER_TAMR_TAMR_PERIOD 0x00000002 // Periodic Timer mode
  93. #define TIMER_TAMR_TAMR_CAP 0x00000003 // Capture mode
  94. //*****************************************************************************
  95. //
  96. // The following are defines for the bit fields in the TIMER_O_TBMR register.
  97. //
  98. //*****************************************************************************
  99. #define TIMER_TBMR_TBPLO 0x00000800 // GPTM Timer B PWM Legacy
  100. // Operation
  101. #define TIMER_TBMR_TBMRSU 0x00000400 // GPTM Timer B Match Register
  102. // Update
  103. #define TIMER_TBMR_TBPWMIE 0x00000200 // GPTM Timer B PWM Interrupt
  104. // Enable
  105. #define TIMER_TBMR_TBILD 0x00000100 // GPTM Timer B Interval Load Write
  106. #define TIMER_TBMR_TBSNAPS 0x00000080 // GPTM Timer B Snap-Shot Mode
  107. #define TIMER_TBMR_TBWOT 0x00000040 // GPTM Timer B Wait-on-Trigger
  108. #define TIMER_TBMR_TBMIE 0x00000020 // GPTM Timer B Match Interrupt
  109. // Enable
  110. #define TIMER_TBMR_TBCDIR 0x00000010 // GPTM Timer B Count Direction
  111. #define TIMER_TBMR_TBAMS 0x00000008 // GPTM Timer B Alternate Mode
  112. // Select
  113. #define TIMER_TBMR_TBCMR 0x00000004 // GPTM Timer B Capture Mode
  114. #define TIMER_TBMR_TBMR_M 0x00000003 // GPTM Timer B Mode
  115. #define TIMER_TBMR_TBMR_1_SHOT 0x00000001 // One-Shot Timer mode
  116. #define TIMER_TBMR_TBMR_PERIOD 0x00000002 // Periodic Timer mode
  117. #define TIMER_TBMR_TBMR_CAP 0x00000003 // Capture mode
  118. //*****************************************************************************
  119. //
  120. // The following are defines for the bit fields in the TIMER_O_CTL register.
  121. //
  122. //*****************************************************************************
  123. #define TIMER_CTL_TBPWML 0x00004000 // GPTM Timer B PWM Output Level
  124. #define TIMER_CTL_TBOTE 0x00002000 // GPTM Timer B Output Trigger
  125. // Enable
  126. #define TIMER_CTL_TBEVENT_M 0x00000C00 // GPTM Timer B Event Mode
  127. #define TIMER_CTL_TBEVENT_POS 0x00000000 // Positive edge
  128. #define TIMER_CTL_TBEVENT_NEG 0x00000400 // Negative edge
  129. #define TIMER_CTL_TBEVENT_BOTH 0x00000C00 // Both edges
  130. #define TIMER_CTL_TBSTALL 0x00000200 // GPTM Timer B Stall Enable
  131. #define TIMER_CTL_TBEN 0x00000100 // GPTM Timer B Enable
  132. #define TIMER_CTL_TAPWML 0x00000040 // GPTM Timer A PWM Output Level
  133. #define TIMER_CTL_TAOTE 0x00000020 // GPTM Timer A Output Trigger
  134. // Enable
  135. #define TIMER_CTL_RTCEN 0x00000010 // GPTM RTC Enable
  136. #define TIMER_CTL_TAEVENT_M 0x0000000C // GPTM Timer A Event Mode
  137. #define TIMER_CTL_TAEVENT_POS 0x00000000 // Positive edge
  138. #define TIMER_CTL_TAEVENT_NEG 0x00000004 // Negative edge
  139. #define TIMER_CTL_TAEVENT_BOTH 0x0000000C // Both edges
  140. #define TIMER_CTL_TASTALL 0x00000002 // GPTM Timer A Stall Enable
  141. #define TIMER_CTL_TAEN 0x00000001 // GPTM Timer A Enable
  142. //*****************************************************************************
  143. //
  144. // The following are defines for the bit fields in the TIMER_O_SYNC register.
  145. //
  146. //*****************************************************************************
  147. #define TIMER_SYNC_SYNCWT5_M 0x00C00000 // Synchronize GPTM 32/64-Bit Timer
  148. // 5
  149. #define TIMER_SYNC_SYNCWT5_NONE 0x00000000 // GPTM 32/64-Bit Timer 5 is not
  150. // affected
  151. #define TIMER_SYNC_SYNCWT5_TA 0x00400000 // A timeout event for Timer A of
  152. // GPTM 32/64-Bit Timer 5 is
  153. // triggered
  154. #define TIMER_SYNC_SYNCWT5_TB 0x00800000 // A timeout event for Timer B of
  155. // GPTM 32/64-Bit Timer 5 is
  156. // triggered
  157. #define TIMER_SYNC_SYNCWT5_TATB 0x00C00000 // A timeout event for both Timer A
  158. // and Timer B of GPTM 32/64-Bit
  159. // Timer 5 is triggered
  160. #define TIMER_SYNC_SYNCWT4_M 0x00300000 // Synchronize GPTM 32/64-Bit Timer
  161. // 4
  162. #define TIMER_SYNC_SYNCWT4_NONE 0x00000000 // GPTM 32/64-Bit Timer 4 is not
  163. // affected
  164. #define TIMER_SYNC_SYNCWT4_TA 0x00100000 // A timeout event for Timer A of
  165. // GPTM 32/64-Bit Timer 4 is
  166. // triggered
  167. #define TIMER_SYNC_SYNCWT4_TB 0x00200000 // A timeout event for Timer B of
  168. // GPTM 32/64-Bit Timer 4 is
  169. // triggered
  170. #define TIMER_SYNC_SYNCWT4_TATB 0x00300000 // A timeout event for both Timer A
  171. // and Timer B of GPTM 32/64-Bit
  172. // Timer 4 is triggered
  173. #define TIMER_SYNC_SYNCWT3_M 0x000C0000 // Synchronize GPTM 32/64-Bit Timer
  174. // 3
  175. #define TIMER_SYNC_SYNCWT3_NONE 0x00000000 // GPTM 32/64-Bit Timer 3 is not
  176. // affected
  177. #define TIMER_SYNC_SYNCWT3_TA 0x00040000 // A timeout event for Timer A of
  178. // GPTM 32/64-Bit Timer 3 is
  179. // triggered
  180. #define TIMER_SYNC_SYNCWT3_TB 0x00080000 // A timeout event for Timer B of
  181. // GPTM 32/64-Bit Timer 3 is
  182. // triggered
  183. #define TIMER_SYNC_SYNCWT3_TATB 0x000C0000 // A timeout event for both Timer A
  184. // and Timer B of GPTM 32/64-Bit
  185. // Timer 3 is triggered
  186. #define TIMER_SYNC_SYNCWT2_M 0x00030000 // Synchronize GPTM 32/64-Bit Timer
  187. // 2
  188. #define TIMER_SYNC_SYNCWT2_NONE 0x00000000 // GPTM 32/64-Bit Timer 2 is not
  189. // affected
  190. #define TIMER_SYNC_SYNCWT2_TA 0x00010000 // A timeout event for Timer A of
  191. // GPTM 32/64-Bit Timer 2 is
  192. // triggered
  193. #define TIMER_SYNC_SYNCWT2_TB 0x00020000 // A timeout event for Timer B of
  194. // GPTM 32/64-Bit Timer 2 is
  195. // triggered
  196. #define TIMER_SYNC_SYNCWT2_TATB 0x00030000 // A timeout event for both Timer A
  197. // and Timer B of GPTM 32/64-Bit
  198. // Timer 2 is triggered
  199. #define TIMER_SYNC_SYNCWT1_M 0x0000C000 // Synchronize GPTM 32/64-Bit Timer
  200. // 1
  201. #define TIMER_SYNC_SYNCWT1_NONE 0x00000000 // GPTM 32/64-Bit Timer 1 is not
  202. // affected
  203. #define TIMER_SYNC_SYNCWT1_TA 0x00004000 // A timeout event for Timer A of
  204. // GPTM 32/64-Bit Timer 1 is
  205. // triggered
  206. #define TIMER_SYNC_SYNCWT1_TB 0x00008000 // A timeout event for Timer B of
  207. // GPTM 32/64-Bit Timer 1 is
  208. // triggered
  209. #define TIMER_SYNC_SYNCWT1_TATB 0x0000C000 // A timeout event for both Timer A
  210. // and Timer B of GPTM 32/64-Bit
  211. // Timer 1 is triggered
  212. #define TIMER_SYNC_SYNCWT0_M 0x00003000 // Synchronize GPTM 32/64-Bit Timer
  213. // 0
  214. #define TIMER_SYNC_SYNCWT0_NONE 0x00000000 // GPTM 32/64-Bit Timer 0 is not
  215. // affected
  216. #define TIMER_SYNC_SYNCWT0_TA 0x00001000 // A timeout event for Timer A of
  217. // GPTM 32/64-Bit Timer 0 is
  218. // triggered
  219. #define TIMER_SYNC_SYNCWT0_TB 0x00002000 // A timeout event for Timer B of
  220. // GPTM 32/64-Bit Timer 0 is
  221. // triggered
  222. #define TIMER_SYNC_SYNCWT0_TATB 0x00003000 // A timeout event for both Timer A
  223. // and Timer B of GPTM 32/64-Bit
  224. // Timer 0 is triggered
  225. #define TIMER_SYNC_SYNCT5_M 0x00000C00 // Synchronize GPTM 16/32-Bit Timer
  226. // 5
  227. #define TIMER_SYNC_SYNCT5_NONE 0x00000000 // GPTM 16/32-Bit Timer 5 is not
  228. // affected
  229. #define TIMER_SYNC_SYNCT5_TA 0x00000400 // A timeout event for Timer A of
  230. // GPTM 16/32-Bit Timer 5 is
  231. // triggered
  232. #define TIMER_SYNC_SYNCT5_TB 0x00000800 // A timeout event for Timer B of
  233. // GPTM 16/32-Bit Timer 5 is
  234. // triggered
  235. #define TIMER_SYNC_SYNCT5_TATB 0x00000C00 // A timeout event for both Timer A
  236. // and Timer B of GPTM 16/32-Bit
  237. // Timer 5 is triggered
  238. #define TIMER_SYNC_SYNCT4_M 0x00000300 // Synchronize GPTM 16/32-Bit Timer
  239. // 4
  240. #define TIMER_SYNC_SYNCT4_NONE 0x00000000 // GPTM 16/32-Bit Timer 4 is not
  241. // affected
  242. #define TIMER_SYNC_SYNCT4_TA 0x00000100 // A timeout event for Timer A of
  243. // GPTM 16/32-Bit Timer 4 is
  244. // triggered
  245. #define TIMER_SYNC_SYNCT4_TB 0x00000200 // A timeout event for Timer B of
  246. // GPTM 16/32-Bit Timer 4 is
  247. // triggered
  248. #define TIMER_SYNC_SYNCT4_TATB 0x00000300 // A timeout event for both Timer A
  249. // and Timer B of GPTM 16/32-Bit
  250. // Timer 4 is triggered
  251. #define TIMER_SYNC_SYNCT3_M 0x000000C0 // Synchronize GPTM 16/32-Bit Timer
  252. // 3
  253. #define TIMER_SYNC_SYNCT3_NONE 0x00000000 // GPTM 16/32-Bit Timer 3 is not
  254. // affected
  255. #define TIMER_SYNC_SYNCT3_TA 0x00000040 // A timeout event for Timer A of
  256. // GPTM 16/32-Bit Timer 3 is
  257. // triggered
  258. #define TIMER_SYNC_SYNCT3_TB 0x00000080 // A timeout event for Timer B of
  259. // GPTM 16/32-Bit Timer 3 is
  260. // triggered
  261. #define TIMER_SYNC_SYNCT3_TATB 0x000000C0 // A timeout event for both Timer A
  262. // and Timer B of GPTM 16/32-Bit
  263. // Timer 3 is triggered
  264. #define TIMER_SYNC_SYNCT2_M 0x00000030 // Synchronize GPTM 16/32-Bit Timer
  265. // 2
  266. #define TIMER_SYNC_SYNCT2_NONE 0x00000000 // GPTM 16/32-Bit Timer 2 is not
  267. // affected
  268. #define TIMER_SYNC_SYNCT2_TA 0x00000010 // A timeout event for Timer A of
  269. // GPTM 16/32-Bit Timer 2 is
  270. // triggered
  271. #define TIMER_SYNC_SYNCT2_TB 0x00000020 // A timeout event for Timer B of
  272. // GPTM 16/32-Bit Timer 2 is
  273. // triggered
  274. #define TIMER_SYNC_SYNCT2_TATB 0x00000030 // A timeout event for both Timer A
  275. // and Timer B of GPTM 16/32-Bit
  276. // Timer 2 is triggered
  277. #define TIMER_SYNC_SYNCT1_M 0x0000000C // Synchronize GPTM 16/32-Bit Timer
  278. // 1
  279. #define TIMER_SYNC_SYNCT1_NONE 0x00000000 // GPTM 16/32-Bit Timer 1 is not
  280. // affected
  281. #define TIMER_SYNC_SYNCT1_TA 0x00000004 // A timeout event for Timer A of
  282. // GPTM 16/32-Bit Timer 1 is
  283. // triggered
  284. #define TIMER_SYNC_SYNCT1_TB 0x00000008 // A timeout event for Timer B of
  285. // GPTM 16/32-Bit Timer 1 is
  286. // triggered
  287. #define TIMER_SYNC_SYNCT1_TATB 0x0000000C // A timeout event for both Timer A
  288. // and Timer B of GPTM 16/32-Bit
  289. // Timer 1 is triggered
  290. #define TIMER_SYNC_SYNCT0_M 0x00000003 // Synchronize GPTM 16/32-Bit Timer
  291. // 0
  292. #define TIMER_SYNC_SYNCT0_NONE 0x00000000 // GPTM 16/32-Bit Timer 0 is not
  293. // affected
  294. #define TIMER_SYNC_SYNCT0_TA 0x00000001 // A timeout event for Timer A of
  295. // GPTM 16/32-Bit Timer 0 is
  296. // triggered
  297. #define TIMER_SYNC_SYNCT0_TB 0x00000002 // A timeout event for Timer B of
  298. // GPTM 16/32-Bit Timer 0 is
  299. // triggered
  300. #define TIMER_SYNC_SYNCT0_TATB 0x00000003 // A timeout event for both Timer A
  301. // and Timer B of GPTM 16/32-Bit
  302. // Timer 0 is triggered
  303. //*****************************************************************************
  304. //
  305. // The following are defines for the bit fields in the TIMER_O_IMR register.
  306. //
  307. //*****************************************************************************
  308. #define TIMER_IMR_WUEIM 0x00010000 // 32/64-Bit GPTM Write Update
  309. // Error Interrupt Mask
  310. #define TIMER_IMR_TBMIM 0x00000800 // GPTM Timer B Mode Match
  311. // Interrupt Mask
  312. #define TIMER_IMR_CBEIM 0x00000400 // GPTM Capture B Event Interrupt
  313. // Mask
  314. #define TIMER_IMR_CBMIM 0x00000200 // GPTM Capture B Match Interrupt
  315. // Mask
  316. #define TIMER_IMR_TBTOIM 0x00000100 // GPTM Timer B Time-Out Interrupt
  317. // Mask
  318. #define TIMER_IMR_TAMIM 0x00000010 // GPTM Timer A Mode Match
  319. // Interrupt Mask
  320. #define TIMER_IMR_RTCIM 0x00000008 // GPTM RTC Interrupt Mask
  321. #define TIMER_IMR_CAEIM 0x00000004 // GPTM Capture A Event Interrupt
  322. // Mask
  323. #define TIMER_IMR_CAMIM 0x00000002 // GPTM Capture A Match Interrupt
  324. // Mask
  325. #define TIMER_IMR_TATOIM 0x00000001 // GPTM Timer A Time-Out Interrupt
  326. // Mask
  327. //*****************************************************************************
  328. //
  329. // The following are defines for the bit fields in the TIMER_O_RIS register.
  330. //
  331. //*****************************************************************************
  332. #define TIMER_RIS_WUERIS 0x00010000 // 32/64-Bit GPTM Write Update
  333. // Error Raw Interrupt Status
  334. #define TIMER_RIS_TBMRIS 0x00000800 // GPTM Timer B Mode Match Raw
  335. // Interrupt
  336. #define TIMER_RIS_CBERIS 0x00000400 // GPTM Capture B Event Raw
  337. // Interrupt
  338. #define TIMER_RIS_CBMRIS 0x00000200 // GPTM Capture B Match Raw
  339. // Interrupt
  340. #define TIMER_RIS_TBTORIS 0x00000100 // GPTM Timer B Time-Out Raw
  341. // Interrupt
  342. #define TIMER_RIS_TAMRIS 0x00000010 // GPTM Timer A Mode Match Raw
  343. // Interrupt
  344. #define TIMER_RIS_RTCRIS 0x00000008 // GPTM RTC Raw Interrupt
  345. #define TIMER_RIS_CAERIS 0x00000004 // GPTM Capture A Event Raw
  346. // Interrupt
  347. #define TIMER_RIS_CAMRIS 0x00000002 // GPTM Capture A Match Raw
  348. // Interrupt
  349. #define TIMER_RIS_TATORIS 0x00000001 // GPTM Timer A Time-Out Raw
  350. // Interrupt
  351. //*****************************************************************************
  352. //
  353. // The following are defines for the bit fields in the TIMER_O_MIS register.
  354. //
  355. //*****************************************************************************
  356. #define TIMER_MIS_WUEMIS 0x00010000 // 32/64-Bit GPTM Write Update
  357. // Error Masked Interrupt Status
  358. #define TIMER_MIS_TBMMIS 0x00000800 // GPTM Timer B Mode Match Masked
  359. // Interrupt
  360. #define TIMER_MIS_CBEMIS 0x00000400 // GPTM Capture B Event Masked
  361. // Interrupt
  362. #define TIMER_MIS_CBMMIS 0x00000200 // GPTM Capture B Match Masked
  363. // Interrupt
  364. #define TIMER_MIS_TBTOMIS 0x00000100 // GPTM Timer B Time-Out Masked
  365. // Interrupt
  366. #define TIMER_MIS_TAMMIS 0x00000010 // GPTM Timer A Mode Match Masked
  367. // Interrupt
  368. #define TIMER_MIS_RTCMIS 0x00000008 // GPTM RTC Masked Interrupt
  369. #define TIMER_MIS_CAEMIS 0x00000004 // GPTM Capture A Event Masked
  370. // Interrupt
  371. #define TIMER_MIS_CAMMIS 0x00000002 // GPTM Capture A Match Masked
  372. // Interrupt
  373. #define TIMER_MIS_TATOMIS 0x00000001 // GPTM Timer A Time-Out Masked
  374. // Interrupt
  375. //*****************************************************************************
  376. //
  377. // The following are defines for the bit fields in the TIMER_O_ICR register.
  378. //
  379. //*****************************************************************************
  380. #define TIMER_ICR_WUECINT 0x00010000 // 32/64-Bit GPTM Write Update
  381. // Error Interrupt Clear
  382. #define TIMER_ICR_TBMCINT 0x00000800 // GPTM Timer B Mode Match
  383. // Interrupt Clear
  384. #define TIMER_ICR_CBECINT 0x00000400 // GPTM Capture B Event Interrupt
  385. // Clear
  386. #define TIMER_ICR_CBMCINT 0x00000200 // GPTM Capture B Match Interrupt
  387. // Clear
  388. #define TIMER_ICR_TBTOCINT 0x00000100 // GPTM Timer B Time-Out Interrupt
  389. // Clear
  390. #define TIMER_ICR_TAMCINT 0x00000010 // GPTM Timer A Mode Match
  391. // Interrupt Clear
  392. #define TIMER_ICR_RTCCINT 0x00000008 // GPTM RTC Interrupt Clear
  393. #define TIMER_ICR_CAECINT 0x00000004 // GPTM Capture A Event Interrupt
  394. // Clear
  395. #define TIMER_ICR_CAMCINT 0x00000002 // GPTM Capture A Match Interrupt
  396. // Clear
  397. #define TIMER_ICR_TATOCINT 0x00000001 // GPTM Timer A Time-Out Raw
  398. // Interrupt
  399. //*****************************************************************************
  400. //
  401. // The following are defines for the bit fields in the TIMER_O_TAILR register.
  402. //
  403. //*****************************************************************************
  404. #define TIMER_TAILR_M 0xFFFFFFFF // GPTM Timer A Interval Load
  405. // Register
  406. #define TIMER_TAILR_TAILRH_M 0xFFFF0000 // GPTM Timer A Interval Load
  407. // Register High
  408. #define TIMER_TAILR_TAILRL_M 0x0000FFFF // GPTM Timer A Interval Load
  409. // Register Low
  410. #define TIMER_TAILR_TAILRH_S 16
  411. #define TIMER_TAILR_TAILRL_S 0
  412. #define TIMER_TAILR_S 0
  413. //*****************************************************************************
  414. //
  415. // The following are defines for the bit fields in the TIMER_O_TBILR register.
  416. //
  417. //*****************************************************************************
  418. #define TIMER_TBILR_M 0xFFFFFFFF // GPTM Timer B Interval Load
  419. // Register
  420. #define TIMER_TBILR_TBILRL_M 0x0000FFFF // GPTM Timer B Interval Load
  421. // Register
  422. #define TIMER_TBILR_TBILRL_S 0
  423. #define TIMER_TBILR_S 0
  424. //*****************************************************************************
  425. //
  426. // The following are defines for the bit fields in the TIMER_O_TAMATCHR
  427. // register.
  428. //
  429. //*****************************************************************************
  430. #define TIMER_TAMATCHR_TAMR_M 0xFFFFFFFF // GPTM Timer A Match Register
  431. #define TIMER_TAMATCHR_TAMRH_M 0xFFFF0000 // GPTM Timer A Match Register High
  432. #define TIMER_TAMATCHR_TAMRL_M 0x0000FFFF // GPTM Timer A Match Register Low
  433. #define TIMER_TAMATCHR_TAMRH_S 16
  434. #define TIMER_TAMATCHR_TAMRL_S 0
  435. #define TIMER_TAMATCHR_TAMR_S 0
  436. //*****************************************************************************
  437. //
  438. // The following are defines for the bit fields in the TIMER_O_TBMATCHR
  439. // register.
  440. //
  441. //*****************************************************************************
  442. #define TIMER_TBMATCHR_TBMR_M 0xFFFFFFFF // GPTM Timer B Match Register
  443. #define TIMER_TBMATCHR_TBMRL_M 0x0000FFFF // GPTM Timer B Match Register Low
  444. #define TIMER_TBMATCHR_TBMR_S 0
  445. #define TIMER_TBMATCHR_TBMRL_S 0
  446. //*****************************************************************************
  447. //
  448. // The following are defines for the bit fields in the TIMER_O_TAPR register.
  449. //
  450. //*****************************************************************************
  451. #define TIMER_TAPR_TAPSRH_M 0x0000FF00 // GPTM Timer A Prescale High Byte
  452. #define TIMER_TAPR_TAPSR_M 0x000000FF // GPTM Timer A Prescale
  453. #define TIMER_TAPR_TAPSRH_S 8
  454. #define TIMER_TAPR_TAPSR_S 0
  455. //*****************************************************************************
  456. //
  457. // The following are defines for the bit fields in the TIMER_O_TBPR register.
  458. //
  459. //*****************************************************************************
  460. #define TIMER_TBPR_TBPSRH_M 0x0000FF00 // GPTM Timer B Prescale High Byte
  461. #define TIMER_TBPR_TBPSR_M 0x000000FF // GPTM Timer B Prescale
  462. #define TIMER_TBPR_TBPSRH_S 8
  463. #define TIMER_TBPR_TBPSR_S 0
  464. //*****************************************************************************
  465. //
  466. // The following are defines for the bit fields in the TIMER_O_TAPMR register.
  467. //
  468. //*****************************************************************************
  469. #define TIMER_TAPMR_TAPSMRH_M 0x0000FF00 // GPTM Timer A Prescale Match High
  470. // Byte
  471. #define TIMER_TAPMR_TAPSMR_M 0x000000FF // GPTM TimerA Prescale Match
  472. #define TIMER_TAPMR_TAPSMRH_S 8
  473. #define TIMER_TAPMR_TAPSMR_S 0
  474. //*****************************************************************************
  475. //
  476. // The following are defines for the bit fields in the TIMER_O_TBPMR register.
  477. //
  478. //*****************************************************************************
  479. #define TIMER_TBPMR_TBPSMRH_M 0x0000FF00 // GPTM Timer B Prescale Match High
  480. // Byte
  481. #define TIMER_TBPMR_TBPSMR_M 0x000000FF // GPTM TimerB Prescale Match
  482. #define TIMER_TBPMR_TBPSMRH_S 8
  483. #define TIMER_TBPMR_TBPSMR_S 0
  484. //*****************************************************************************
  485. //
  486. // The following are defines for the bit fields in the TIMER_O_TAR register.
  487. //
  488. //*****************************************************************************
  489. #define TIMER_TAR_M 0xFFFFFFFF // GPTM Timer A Register
  490. #define TIMER_TAR_TARH_M 0xFFFF0000 // GPTM Timer A Register High
  491. #define TIMER_TAR_TARL_M 0x0000FFFF // GPTM Timer A Register Low
  492. #define TIMER_TAR_TARH_S 16
  493. #define TIMER_TAR_TARL_S 0
  494. #define TIMER_TAR_S 0
  495. //*****************************************************************************
  496. //
  497. // The following are defines for the bit fields in the TIMER_O_TBR register.
  498. //
  499. //*****************************************************************************
  500. #define TIMER_TBR_M 0xFFFFFFFF // GPTM Timer B Register
  501. #define TIMER_TBR_TBRL_M 0x00FFFFFF // GPTM Timer B
  502. #define TIMER_TBR_TBRL_S 0
  503. #define TIMER_TBR_S 0
  504. //*****************************************************************************
  505. //
  506. // The following are defines for the bit fields in the TIMER_O_TAV register.
  507. //
  508. //*****************************************************************************
  509. #define TIMER_TAV_M 0xFFFFFFFF // GPTM Timer A Value
  510. #define TIMER_TAV_TAVH_M 0xFFFF0000 // GPTM Timer A Value High
  511. #define TIMER_TAV_TAVL_M 0x0000FFFF // GPTM Timer A Register Low
  512. #define TIMER_TAV_TAVH_S 16
  513. #define TIMER_TAV_TAVL_S 0
  514. #define TIMER_TAV_S 0
  515. //*****************************************************************************
  516. //
  517. // The following are defines for the bit fields in the TIMER_O_TBV register.
  518. //
  519. //*****************************************************************************
  520. #define TIMER_TBV_M 0xFFFFFFFF // GPTM Timer B Value
  521. #define TIMER_TBV_TBVL_M 0x0000FFFF // GPTM Timer B Register
  522. #define TIMER_TBV_TBVL_S 0
  523. #define TIMER_TBV_S 0
  524. //*****************************************************************************
  525. //
  526. // The following are defines for the bit fields in the TIMER_O_RTCPD register.
  527. //
  528. //*****************************************************************************
  529. #define TIMER_RTCPD_RTCPD_M 0x0000FFFF // RTC Predivide Counter Value
  530. #define TIMER_RTCPD_RTCPD_S 0
  531. //*****************************************************************************
  532. //
  533. // The following are defines for the bit fields in the TIMER_O_TAPS register.
  534. //
  535. //*****************************************************************************
  536. #define TIMER_TAPS_PSS_M 0x0000FFFF // GPTM Timer A Prescaler Snapshot
  537. #define TIMER_TAPS_PSS_S 0
  538. //*****************************************************************************
  539. //
  540. // The following are defines for the bit fields in the TIMER_O_TBPS register.
  541. //
  542. //*****************************************************************************
  543. #define TIMER_TBPS_PSS_M 0x0000FFFF // GPTM Timer A Prescaler Value
  544. #define TIMER_TBPS_PSS_S 0
  545. //*****************************************************************************
  546. //
  547. // The following are defines for the bit fields in the TIMER_O_TAPV register.
  548. //
  549. //*****************************************************************************
  550. #define TIMER_TAPV_PSV_M 0x0000FFFF // GPTM Timer A Prescaler Value
  551. #define TIMER_TAPV_PSV_S 0
  552. //*****************************************************************************
  553. //
  554. // The following are defines for the bit fields in the TIMER_O_TBPV register.
  555. //
  556. //*****************************************************************************
  557. #define TIMER_TBPV_PSV_M 0x0000FFFF // GPTM Timer B Prescaler Value
  558. #define TIMER_TBPV_PSV_S 0
  559. //*****************************************************************************
  560. //
  561. // The following are defines for the bit fields in the TIMER_O_PP register.
  562. //
  563. //*****************************************************************************
  564. #define TIMER_PP_SIZE_M 0x0000000F // Count Size
  565. #define TIMER_PP_SIZE_16 0x00000000 // Timer A and Timer B counters are
  566. // 16 bits each with an 8-bit
  567. // prescale counter
  568. #define TIMER_PP_SIZE_32 0x00000001 // Timer A and Timer B counters are
  569. // 32 bits each with a 16-bit
  570. // prescale counter
  571. //*****************************************************************************
  572. //
  573. // The following definitions are deprecated.
  574. //
  575. //*****************************************************************************
  576. #ifndef DEPRECATED
  577. //*****************************************************************************
  578. //
  579. // The following are deprecated defines for the bit fields in the TIMER_O_CFG
  580. // register.
  581. //
  582. //*****************************************************************************
  583. #define TIMER_CFG_CFG_MSK 0x00000007 // Configuration options mask
  584. //*****************************************************************************
  585. //
  586. // The following are deprecated defines for the bit fields in the TIMER_O_CTL
  587. // register.
  588. //
  589. //*****************************************************************************
  590. #define TIMER_CTL_TBEVENT_MSK 0x00000C00 // TimerB event mode mask
  591. #define TIMER_CTL_TAEVENT_MSK 0x0000000C // TimerA event mode mask
  592. //*****************************************************************************
  593. //
  594. // The following are deprecated defines for the bit fields in the TIMER_O_RIS
  595. // register.
  596. //
  597. //*****************************************************************************
  598. #define TIMER_RIS_CBEMIS 0x00000400 // CaptureB event masked int status
  599. #define TIMER_RIS_CBMMIS 0x00000200 // CaptureB match masked int status
  600. #define TIMER_RIS_TBTOMIS 0x00000100 // TimerB time out masked int stat
  601. #define TIMER_RIS_RTCMIS 0x00000008 // RTC masked int status
  602. #define TIMER_RIS_CAEMIS 0x00000004 // CaptureA event masked int status
  603. #define TIMER_RIS_CAMMIS 0x00000002 // CaptureA match masked int status
  604. #define TIMER_RIS_TATOMIS 0x00000001 // TimerA time out masked int stat
  605. //*****************************************************************************
  606. //
  607. // The following are deprecated defines for the bit fields in the TIMER_O_TAILR
  608. // register.
  609. //
  610. //*****************************************************************************
  611. #define TIMER_TAILR_TAILRH 0xFFFF0000 // TimerB load val in 32 bit mode
  612. #define TIMER_TAILR_TAILRL 0x0000FFFF // TimerA interval load value
  613. //*****************************************************************************
  614. //
  615. // The following are deprecated defines for the bit fields in the TIMER_O_TBILR
  616. // register.
  617. //
  618. //*****************************************************************************
  619. #define TIMER_TBILR_TBILRL 0x0000FFFF // TimerB interval load value
  620. //*****************************************************************************
  621. //
  622. // The following are deprecated defines for the bit fields in the
  623. // TIMER_O_TAMATCHR register.
  624. //
  625. //*****************************************************************************
  626. #define TIMER_TAMATCHR_TAMRH 0xFFFF0000 // TimerB match val in 32 bit mode
  627. #define TIMER_TAMATCHR_TAMRL 0x0000FFFF // TimerA match value
  628. //*****************************************************************************
  629. //
  630. // The following are deprecated defines for the bit fields in the
  631. // TIMER_O_TBMATCHR register.
  632. //
  633. //*****************************************************************************
  634. #define TIMER_TBMATCHR_TBMRL 0x0000FFFF // TimerB match load value
  635. //*****************************************************************************
  636. //
  637. // The following are deprecated defines for the bit fields in the TIMER_O_TAR
  638. // register.
  639. //
  640. //*****************************************************************************
  641. #define TIMER_TAR_TARH 0xFFFF0000 // TimerB val in 32 bit mode
  642. #define TIMER_TAR_TARL 0x0000FFFF // TimerA value
  643. //*****************************************************************************
  644. //
  645. // The following are deprecated defines for the bit fields in the TIMER_O_TBR
  646. // register.
  647. //
  648. //*****************************************************************************
  649. #define TIMER_TBR_TBRL 0x0000FFFF // TimerB value
  650. //*****************************************************************************
  651. //
  652. // The following are deprecated defines for the reset values of the timer
  653. // registers.
  654. //
  655. //*****************************************************************************
  656. #define TIMER_RV_TAILR 0xFFFFFFFF // TimerA interval load reg RV
  657. #define TIMER_RV_TAR 0xFFFFFFFF // TimerA register RV
  658. #define TIMER_RV_TAMATCHR 0xFFFFFFFF // TimerA match register RV
  659. #define TIMER_RV_TBILR 0x0000FFFF // TimerB interval load reg RV
  660. #define TIMER_RV_TBMATCHR 0x0000FFFF // TimerB match register RV
  661. #define TIMER_RV_TBR 0x0000FFFF // TimerB register RV
  662. #define TIMER_RV_TAPR 0x00000000 // TimerA prescale register RV
  663. #define TIMER_RV_CFG 0x00000000 // Configuration register RV
  664. #define TIMER_RV_TBPMR 0x00000000 // TimerB prescale match regi RV
  665. #define TIMER_RV_TAPMR 0x00000000 // TimerA prescale match reg RV
  666. #define TIMER_RV_CTL 0x00000000 // Control register RV
  667. #define TIMER_RV_ICR 0x00000000 // Interrupt clear register RV
  668. #define TIMER_RV_TBMR 0x00000000 // TimerB mode register RV
  669. #define TIMER_RV_MIS 0x00000000 // Masked interrupt status reg RV
  670. #define TIMER_RV_RIS 0x00000000 // Interrupt status register RV
  671. #define TIMER_RV_TBPR 0x00000000 // TimerB prescale register RV
  672. #define TIMER_RV_IMR 0x00000000 // Interrupt mask register RV
  673. #define TIMER_RV_TAMR 0x00000000 // TimerA mode register RV
  674. //*****************************************************************************
  675. //
  676. // The following are deprecated defines for the bit fields in the TIMER_TnMR
  677. // register.
  678. //
  679. //*****************************************************************************
  680. #define TIMER_TNMR_TNAMS 0x00000008 // Alternate mode select
  681. #define TIMER_TNMR_TNCMR 0x00000004 // Capture mode - count or time
  682. #define TIMER_TNMR_TNTMR_MSK 0x00000003 // Timer mode mask
  683. #define TIMER_TNMR_TNTMR_1_SHOT 0x00000001 // Mode - one shot
  684. #define TIMER_TNMR_TNTMR_PERIOD 0x00000002 // Mode - periodic
  685. #define TIMER_TNMR_TNTMR_CAP 0x00000003 // Mode - capture
  686. //*****************************************************************************
  687. //
  688. // The following are deprecated defines for the bit fields in the TIMER_TnPR
  689. // register.
  690. //
  691. //*****************************************************************************
  692. #define TIMER_TNPR_TNPSR 0x000000FF // TimerN prescale value
  693. //*****************************************************************************
  694. //
  695. // The following are deprecated defines for the bit fields in the TIMER_TnPMR
  696. // register.
  697. //
  698. //*****************************************************************************
  699. #define TIMER_TNPMR_TNPSMR 0x000000FF // TimerN prescale match value
  700. #endif
  701. #endif // __HW_TIMER_H__