hw_gptimer.h 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  1. /******************************************************************************
  2. * Filename: hw_gptimer.h
  3. * Revised: $Date: 2013-04-12 15:10:54 +0200 (Fri, 12 Apr 2013) $
  4. * Revision: $Revision: 9735 $
  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_GPTIMER_H__
  38. #define __HW_GPTIMER_H__
  39. //*****************************************************************************
  40. //
  41. // The following are defines for the GPTIMER register offsets.
  42. //
  43. //*****************************************************************************
  44. #define GPTIMER_O_CFG 0x00000000 // GPTM configuration This
  45. // register configures the global
  46. // operation of the GPTM. The value
  47. // written to this register
  48. // determines whether the GPTM is
  49. // in 32-bit mode (concatenated
  50. // timers) or in 16-bit mode
  51. // (individual, split timers).
  52. #define GPTIMER_O_TAMR 0x00000004 // GPTM Timer A mode This register
  53. // configures the GPTM based on the
  54. // configuration selected in the
  55. // CFG register. This register
  56. // controls the modes for Timer A
  57. // when it is used individually.
  58. // When Timer A and Timer B are
  59. // concatenated, this register
  60. // controls the modes for both
  61. // Timer A and Timer B, and the
  62. // contents of TBMR are ignored.
  63. #define GPTIMER_O_TBMR 0x00000008 // GPTM Timer B mode This register
  64. // configures the GPTM based on the
  65. // configuration selected in the
  66. // CFG register. This register
  67. // controls the modes for Timer B
  68. // when it is used individually.
  69. // When Timer A and Timer B are
  70. // concatenated, this register is
  71. // ignored and TBMR controls the
  72. // modes for both Timer A and Timer
  73. // B.
  74. #define GPTIMER_O_CTL 0x0000000C // GPTM control This register is
  75. // used alongside the CFG and TnMR
  76. // registers to fine-tune the timer
  77. // configuration, and to enable
  78. // other features such as timer
  79. // stall.
  80. #define GPTIMER_O_SYNC 0x00000010 // GPTM synchronize Note: This
  81. // register is implemented on GPTM
  82. // 0 base address only. This
  83. // register does however, allow
  84. // software to synchronize a number
  85. // of timers.
  86. #define GPTIMER_O_IMR 0x00000018 // GPTM interrupt mask This
  87. // register allows software to
  88. // enable and disable GPTM
  89. // controller-level interrupts.
  90. // Setting a bit enables the
  91. // corresponding interrupt, while
  92. // clearing a bit disables it.
  93. #define GPTIMER_O_RIS 0x0000001C // GPTM raw interrupt status This
  94. // register shows the state of the
  95. // GPTM internal interrupt signal.
  96. // These bits are set whether or
  97. // not the interrupt is masked in
  98. // the IMR register. Each bit can
  99. // be cleared by writing 1 to its
  100. // corresponding bit in ICR.
  101. #define GPTIMER_O_MIS 0x00000020 // GPTM masked interrupt status
  102. // This register shows the state of
  103. // the GPTM controller-level
  104. // interrupt. If an interrupt is
  105. // unmasked in IMR, and there is an
  106. // event that causes the interrupt
  107. // to be asserted, the
  108. // corresponding bit is set in this
  109. // register. All bits are cleared
  110. // by writing 1 to the
  111. // corresponding bit in ICR.
  112. #define GPTIMER_O_ICR 0x00000024 // GPTM interrupt clear This
  113. // register is used to clear the
  114. // status bits in the RIS and MIS
  115. // registers. Writing 1 to a bit
  116. // clears the corresponding bit in
  117. // the RIS and MIS registers.
  118. #define GPTIMER_O_TAILR 0x00000028 // GPTM Timer A interval load When
  119. // the Timer is counting down, this
  120. // register is used to load the
  121. // starting count value into the
  122. // Timer. When the Timer is
  123. // counting up, this register sets
  124. // the upper bound for the timeout
  125. // event. When a GPTM is configured
  126. // to one of the 32-bit modes,
  127. // TAILR appears as a 32-bit
  128. // register (the upper 16-bits
  129. // correspond to the contents of
  130. // the GPTM Timer B Interval Load
  131. // (TBILR) register). In a 16-bit
  132. // mode, the upper 16 bits of this
  133. // register read as 0s and have no
  134. // effect on the state of TBILR.
  135. #define GPTIMER_O_TBILR 0x0000002C // GPTM Timer B interval load When
  136. // the Timer is counting down, this
  137. // register is used to load the
  138. // starting count value into the
  139. // Timer. When the Timer is
  140. // counting up, this register sets
  141. // the upper bound for the time-out
  142. // event. When a GPTM is configured
  143. // to one of the 32-bit modes, the
  144. // contents of bits [15:0] in this
  145. // register are loaded into the
  146. // upper 16 bits of the TAILR
  147. // register. Reads from this
  148. // register return the current
  149. // value of Timer B and writes are
  150. // ignored. In a 16-bit mode, bits
  151. // [15:0] are used for the load
  152. // value. Bits [31:16] are reserved
  153. // in both cases.
  154. #define GPTIMER_O_TAMATCHR 0x00000030 // GPTM Timer A match This
  155. // register is loaded with a match
  156. // value. Interrupts can be
  157. // generated when the Timer value
  158. // is equal to the value in this
  159. // register in one-shot or periodic
  160. // mode. When a GPTM is configured
  161. // to one of the 32-bit modes,
  162. // TAMATCHR appears as a 32-bit
  163. // register (the upper 16-bits
  164. // correspond to the contents of
  165. // the GPTM Timer B match
  166. // (GPTMTBMATCHR) register). In a
  167. // 16-bit mode, the upper 16 bits
  168. // of this register read as 0s and
  169. // have no effect on the state of
  170. // TBMATCHR.
  171. #define GPTIMER_O_TBMATCHR 0x00000034 // PTM Timer B match This register
  172. // is loaded with a match value.
  173. // Interrupts can be generated when
  174. // the Timer value is equal to the
  175. // value in this register in
  176. // one-shot or periodic mode. When
  177. // a GPTM is configured to one of
  178. // the 32-bit modes, the contents
  179. // of bits [15:0] in this register
  180. // are loaded into the upper 16
  181. // bits of the TAMATCHR register.
  182. // Reads from this register return
  183. // the current match value of Timer
  184. // B and writes are ignored. In a
  185. // 16-bit mode, bits [15:0] are
  186. // used for the match value. Bits
  187. // [31:16] are reserved in both
  188. // cases.
  189. #define GPTIMER_O_TAPR 0x00000038 // GPTM Timer A prescale This
  190. // register allows software to
  191. // extend the range of the 16-bit
  192. // Timers in periodic and one-shot
  193. // modes.
  194. #define GPTIMER_O_TBPR 0x0000003C // GPTM Timer B prescale This
  195. // register allows software to
  196. // extend the range of the 16-bit
  197. // Timers in periodic and one-shot
  198. // modes.
  199. #define GPTIMER_O_TAPMR 0x00000040 // GPTM Timer A prescale match
  200. // This register effectively
  201. // extends the range of TAMATCHR to
  202. // 24 bits when operating in
  203. // 16-bit, one-shot or periodic
  204. // mode.
  205. #define GPTIMER_O_TBPMR 0x00000044 // GPTM Timer B prescale match
  206. // This register effectively
  207. // extends the range ofMTBMATCHR to
  208. // 24 bits when operating in
  209. // 16-bit, one-shot or periodic
  210. // mode.
  211. #define GPTIMER_O_TAR 0x00000048 // GPTM Timer A This register
  212. // shows the current value of the
  213. // Timer A counter. When a GPTM is
  214. // configured to one of the 32-bit
  215. // modes, TAR appears as a 32-bit
  216. // register (the upper 16-bits
  217. // correspond to the contents of
  218. // the GPTM Timer B (TBR)
  219. // register). In the16-bit Input
  220. // edge count, input edge time, and
  221. // PWM modes, bits [15:0] contain
  222. // the value of the counter and
  223. // bits 23:16 contain the value of
  224. // the prescaler, which is the
  225. // upper 8 bits of the count. Bits
  226. // [31:24] always read as 0. To
  227. // read the value of the prescaler
  228. // in 16-bit, one-shot and periodic
  229. // modes, read bits [23:16] in the
  230. // TAV register.
  231. #define GPTIMER_O_TBR 0x0000004C // GPTM Timer B This register
  232. // shows the current value of the
  233. // Timer B counter. When a GPTM is
  234. // configured to one of the 32-bit
  235. // modes, the contents of bits
  236. // [15:0] in this register are
  237. // loaded into the upper 16 bits of
  238. // the TAR register. Reads from
  239. // this register return the current
  240. // value of Timer B. In a 16-bit
  241. // mode, bits 15:0 contain the
  242. // value of the counter and bits
  243. // [23:16] contain the value of the
  244. // prescaler in Input edge count,
  245. // input edge time, and PWM modes,
  246. // which is the upper 8 bits of the
  247. // count. Bits [31:24] always read
  248. // as 0. To read the value of the
  249. // prescaler in 16-bit, one-shot
  250. // and periodic modes, read bits
  251. // [23:16] in the TBV register.
  252. #define GPTIMER_O_TAV 0x00000050 // GPTM Timer A value When read,
  253. // this register shows the current,
  254. // free-running value of Timer A in
  255. // all modes. Software can use this
  256. // value to determine the time
  257. // elapsed between an interrupt and
  258. // the ISR entry when using the
  259. // snapshot feature with the
  260. // periodic operating mode. When
  261. // written, the value written into
  262. // this register is loaded into the
  263. // TAR register on the next clock
  264. // cycle. When a GPTM is configured
  265. // to one of the 32-bit modes, TAV
  266. // appears as a 32-bit register
  267. // (the upper 16-bits correspond to
  268. // the contents of the GPTM Timer B
  269. // Value (TBV) register). In a
  270. // 16-bit mode, bits [15:0] contain
  271. // the value of the counter and
  272. // bits [23:16] contain the
  273. // current, free-running value of
  274. // the prescaler, which is the
  275. // upper 8 bits of the count in
  276. // input edge count, input edge
  277. // time, PWM and one-shot or
  278. // periodic up count modes. In
  279. // one-shot or periodic down count
  280. // modes, the prescaler stored in
  281. // [23:16] is a true prescaler,
  282. // meaning bits [23:16] count down
  283. // before decrementing the value in
  284. // bits [15:0]. The prescaler its
  285. // [31:24] always read as 0.
  286. #define GPTIMER_O_TBV 0x00000054 // GPTM Timer B value When read,
  287. // this register shows the current,
  288. // free-running value of Timer B in
  289. // all modes. Software can use this
  290. // value to determine the time
  291. // elapsed between an interrupt and
  292. // the ISR entry. When written, the
  293. // value written into this register
  294. // is loaded into the TBR register
  295. // on the next clock cycle. When a
  296. // GPTM is configured to one of the
  297. // 32-bit modes, the contents of
  298. // bits 15:0 in this register are
  299. // loaded into the upper 16 bits of
  300. // the TAV register. Reads from
  301. // this register return the current
  302. // free-running value of Timer B.
  303. // In a 16-bit mode, bits [15:0]
  304. // contain the value of the counter
  305. // and bits [23:16] contain the
  306. // current, free-running value of
  307. // the prescaler, which is the
  308. // upper 8 bits of the count in
  309. // input edge count, input edge
  310. // time, PWM and one-shot or
  311. // periodic up count modes. In
  312. // one-shot or periodic down count
  313. // modes, the prescaler stored in
  314. // [23:16] is a true prescaler,
  315. // meaning bits [23:16] count down
  316. // before decrementing the value in
  317. // bits [15:0]. The prescaler its
  318. // [31:24] always read as 0.
  319. #define GPTIMER_O_TAPS 0x0000005C // GPTM Timer A prescale snapshot
  320. // For the 32-bit wide GPTM, this
  321. // register shows the current value
  322. // of the Timer A prescaler in the
  323. // 32-bit modes. This register is
  324. // ununsed in 16-bit GPTM mode.
  325. #define GPTIMER_O_TBPS 0x00000060 // GPTM Timer B prescale snapshot
  326. // For the 32-bit wide GPTM, this
  327. // register shows the current value
  328. // of the Timer B prescaler in the
  329. // 32-bit modes. This register is
  330. // ununsed in 16-bit GPTM mode.
  331. #define GPTIMER_O_TAPV 0x00000064 // GPTM Timer A prescale value For
  332. // the 32-bit wide GPTM, this
  333. // register shows the current
  334. // free-running value of the Timer
  335. // A prescaler in the 32-bit modes.
  336. // Software can use this value in
  337. // conjunction with the TAV
  338. // register to determine the time
  339. // elapsed between an interrupt and
  340. // the ISR entry. This register is
  341. // ununsed in 16- or 32-bit GPTM
  342. // mode.
  343. #define GPTIMER_O_TBPV 0x00000068 // GPTM Timer B prescale value For
  344. // the 32-bit wide GPTM, this
  345. // register shows the current
  346. // free-running value of the Timer
  347. // B prescaler in the 32-bit modes.
  348. // Software can use this value in
  349. // conjunction with the TBV
  350. // register to determine the time
  351. // elapsed between an interrupt and
  352. // the ISR entry. This register is
  353. // ununsed in 16- or 32-bit GPTM
  354. // mode.
  355. #define GPTIMER_O_PP 0x00000FC0 // GPTM peripheral properties The
  356. // PP register provides information
  357. // regarding the properties of the
  358. // general-purpose Timer module.
  359. //*****************************************************************************
  360. //
  361. // The following are defines for the bit fields in the GPTIMER_O_CFG register.
  362. //
  363. //*****************************************************************************
  364. #define GPTIMER_CFG_GPTMCFG_M 0x00000007 // GPTM configuration The GPTMCFG
  365. // values are defined as follows:
  366. // 0x0: 32-bit timer configuration.
  367. // 0x1: 32-bit real-time clock 0x2:
  368. // Reserved 0x3: Reserved 0x4:
  369. // 16-bit timer configuration. The
  370. // function is controlled by bits
  371. // [1:0] of GPTMTAMR and GPTMTBMR.
  372. // 0x5-0x7: Reserved
  373. #define GPTIMER_CFG_GPTMCFG_S 0
  374. //*****************************************************************************
  375. //
  376. // The following are defines for the bit fields in the GPTIMER_O_TAMR register.
  377. //
  378. //*****************************************************************************
  379. #define GPTIMER_TAMR_TAPLO 0x00000800 // Legacy PWM operation 0: Legacy
  380. // operation 1: CCP is set to 1 on
  381. // time-out.
  382. #define GPTIMER_TAMR_TAPLO_M 0x00000800
  383. #define GPTIMER_TAMR_TAPLO_S 11
  384. #define GPTIMER_TAMR_TAMRSU 0x00000400 // Timer A match register update
  385. // mode 0: Update GPTMAMATCHR and
  386. // GPTMAPR if used on the next
  387. // cycle. 1: Update GPTMAMATCHR and
  388. // GPTMAPR if used on the next
  389. // time-out. If the timer is
  390. // disabled (TAEN is clear) when
  391. // this bit is set, GPTMTAMATCHR
  392. // and GPTMTAPR are updated when
  393. // the timer is enabled. If the
  394. // timer is stalled (TASTALL is
  395. // set), GPTMTAMATCHR and GPTMTAPR
  396. // are updated according to the
  397. // configuration of this bit.
  398. #define GPTIMER_TAMR_TAMRSU_M 0x00000400
  399. #define GPTIMER_TAMR_TAMRSU_S 10
  400. #define GPTIMER_TAMR_TAPWMIE 0x00000200 // GPTM Timer A PWM interrupt
  401. // enable This bit enables
  402. // interrupts in PWM mode on
  403. // rising, falling, or both edges
  404. // of the CCP output. 0: Interrupt
  405. // is disabled. 1: Interrupt is
  406. // enabled. This bit is valid only
  407. // in PWM mode.
  408. #define GPTIMER_TAMR_TAPWMIE_M 0x00000200
  409. #define GPTIMER_TAMR_TAPWMIE_S 9
  410. #define GPTIMER_TAMR_TAILD 0x00000100 // GPTM Timer A PWM interval load
  411. // write 0: Update the GPTMTAR
  412. // register with the value in the
  413. // GPTMTAILR register on the next
  414. // cycle. If the prescaler is used,
  415. // update the GPTMTAPS register
  416. // with the value in the GPTMTAPR
  417. // register on the next cycle. 1:
  418. // Update the GPTMTAR register with
  419. // the value in the GPTMTAILR
  420. // register on the next cycle. If
  421. // the prescaler is used, update
  422. // the GPTMTAPS register with the
  423. // value in the GPTMTAPR register
  424. // on the next time-out.
  425. #define GPTIMER_TAMR_TAILD_M 0x00000100
  426. #define GPTIMER_TAMR_TAILD_S 8
  427. #define GPTIMER_TAMR_TASNAPS 0x00000080 // GPTM Timer A snap-shot mode 0:
  428. // Snap-shot mode is disabled. 1:
  429. // If Timer A is configured in
  430. // periodic mode, the actual
  431. // free-running value of Timer A is
  432. // loaded at the time-out event
  433. // into the GPTM Timer A (GPTMTAR)
  434. // register.
  435. #define GPTIMER_TAMR_TASNAPS_M 0x00000080
  436. #define GPTIMER_TAMR_TASNAPS_S 7
  437. #define GPTIMER_TAMR_TAWOT 0x00000040 // GPTM Timer A wait-on-trigger 0:
  438. // Timer A begins counting as soon
  439. // as it is enabled. 1: If Timer A
  440. // is enabled (TAEN is set in the
  441. // GPTMCTL register), Timer A does
  442. // not begin counting until it
  443. // receives a trigger from the
  444. // Timer in the previous position
  445. // in the daisy-chain. This bit
  446. // must be clear for GP Timer
  447. // module 0, Timer A.
  448. #define GPTIMER_TAMR_TAWOT_M 0x00000040
  449. #define GPTIMER_TAMR_TAWOT_S 6
  450. #define GPTIMER_TAMR_TAMIE 0x00000020 // GPTM Timer A match interrupt
  451. // enable 0: The match interrupt is
  452. // disabled. 1: An interrupt is
  453. // generated when the match value
  454. // in the GPTMTAMATCHR register is
  455. // reached in the one-shot and
  456. // periodic modes.
  457. #define GPTIMER_TAMR_TAMIE_M 0x00000020
  458. #define GPTIMER_TAMR_TAMIE_S 5
  459. #define GPTIMER_TAMR_TACDIR 0x00000010 // GPTM Timer A count direction 0:
  460. // The timer counts down. 1: The
  461. // timer counts up. When counting
  462. // up, the timer starts from a
  463. // value of 0x0.
  464. #define GPTIMER_TAMR_TACDIR_M 0x00000010
  465. #define GPTIMER_TAMR_TACDIR_S 4
  466. #define GPTIMER_TAMR_TAAMS 0x00000008 // GPTM Timer A alternate mode 0:
  467. // Capture mode is enabled. 1: PWM
  468. // mode is enabled. Note: To enable
  469. // PWM mode, the TACM bit must be
  470. // cleared and the TAMR field must
  471. // be configured to 0x2.
  472. #define GPTIMER_TAMR_TAAMS_M 0x00000008
  473. #define GPTIMER_TAMR_TAAMS_S 3
  474. #define GPTIMER_TAMR_TACMR 0x00000004 // GPTM Timer A capture mode 0:
  475. // Edge-count mode 1: Edge-time
  476. // mode
  477. #define GPTIMER_TAMR_TACMR_M 0x00000004
  478. #define GPTIMER_TAMR_TACMR_S 2
  479. #define GPTIMER_TAMR_TAMR_M 0x00000003 // GPTM Timer A mode 0x0: Reserved
  480. // 0x1: One-shot mode 0x2: Periodic
  481. // mode 0x3: Capture mode The timer
  482. // mode is based on the timer
  483. // configuration defined by bits
  484. // [2:0] in the GPTMCFG register.
  485. #define GPTIMER_TAMR_TAMR_S 0
  486. //*****************************************************************************
  487. //
  488. // The following are defines for the bit fields in the GPTIMER_O_TBMR register.
  489. //
  490. //*****************************************************************************
  491. #define GPTIMER_TBMR_TBPLO 0x00000800 // Legacy PWM operation 0: Legacy
  492. // operation 1: CCP is set to 1 on
  493. // time-out.
  494. #define GPTIMER_TBMR_TBPLO_M 0x00000800
  495. #define GPTIMER_TBMR_TBPLO_S 11
  496. #define GPTIMER_TBMR_TBMRSU 0x00000400 // Timer B match register update
  497. // mode 0: Update the GPTMBMATCHR
  498. // and the GPTMBPR, if used on the
  499. // next cycle. 1: Update the
  500. // GPTMBMATCHR and the GPTMBPR, if
  501. // used on the next time-out. If
  502. // the timer is disabled (TAEN is
  503. // clear) when this bit is set,
  504. // GPTMTBMATCHR and GPTMTBPR are
  505. // updated when the timer is
  506. // enabled. If the timer is stalled
  507. // (TBSTALL is set), GPTMTBMATCHR
  508. // and GPTMTBPR are updated
  509. // according to the configuration
  510. // of this bit.
  511. #define GPTIMER_TBMR_TBMRSU_M 0x00000400
  512. #define GPTIMER_TBMR_TBMRSU_S 10
  513. #define GPTIMER_TBMR_TBPWMIE 0x00000200 // GPTM Timer B PWM interrupt
  514. // enable This bit enables
  515. // interrupts in PWM mode on
  516. // rising, falling, or both edges
  517. // of the CCP output. 0: Interrupt
  518. // is disabled. 1: Interrupt is
  519. // enabled. This bit is valid only
  520. // in PWM mode.
  521. #define GPTIMER_TBMR_TBPWMIE_M 0x00000200
  522. #define GPTIMER_TBMR_TBPWMIE_S 9
  523. #define GPTIMER_TBMR_TBILD 0x00000100 // GPTM Timer B PWM interval load
  524. // write 0: Update the GPTMTBR
  525. // register with the value in the
  526. // GPTMTBILR register on the next
  527. // cycle. If the prescaler is used,
  528. // update the GPTMTBPS register
  529. // with the value in the GPTMTBPR
  530. // register on the next cycle. 1:
  531. // Update the GPTMTBR register with
  532. // the value in the GPTMTBILR
  533. // register on the next cycle. If
  534. // the prescaler is used, update
  535. // the GPTMTBPS register with the
  536. // value in the GPTMTBPR register
  537. // on the next time-out.
  538. #define GPTIMER_TBMR_TBILD_M 0x00000100
  539. #define GPTIMER_TBMR_TBILD_S 8
  540. #define GPTIMER_TBMR_TBSNAPS 0x00000080 // GPTM Timer B snap-shot mode 0:
  541. // Snap-shot mode is disabled. 1:
  542. // If Timer B is configured in the
  543. // periodic mode, the actual
  544. // free-running value of Timer A is
  545. // loaded into the GPTM Timer B
  546. // (GPTMTBR) register at the
  547. // time-out event.
  548. #define GPTIMER_TBMR_TBSNAPS_M 0x00000080
  549. #define GPTIMER_TBMR_TBSNAPS_S 7
  550. #define GPTIMER_TBMR_TBWOT 0x00000040 // GPTM Timer B wait-on-trigger 0:
  551. // Timer B begins counting as soon
  552. // as it is enabled. 1: If Timer B
  553. // is enabled (TBEN is set in the
  554. // GPTMCTL register), Timer B does
  555. // not begin counting until it
  556. // receives a trigger from the
  557. // timer in the previous position
  558. // in the daisy-chain.
  559. #define GPTIMER_TBMR_TBWOT_M 0x00000040
  560. #define GPTIMER_TBMR_TBWOT_S 6
  561. #define GPTIMER_TBMR_TBMIE 0x00000020 // GPTM Timer B match interrupt
  562. // enable 0: The match interrupt is
  563. // disabled. 1: An interrupt is
  564. // generated when the match value
  565. // in the GPTMTBMATCHR register is
  566. // reached in the one-shot and
  567. // periodic modes.
  568. #define GPTIMER_TBMR_TBMIE_M 0x00000020
  569. #define GPTIMER_TBMR_TBMIE_S 5
  570. #define GPTIMER_TBMR_TBCDIR 0x00000010 // GPTM Timer B count direction 0:
  571. // The timer counts down. 1: The
  572. // timer counts up. When counting
  573. // up, the timer starts from a
  574. // value of 0x0.
  575. #define GPTIMER_TBMR_TBCDIR_M 0x00000010
  576. #define GPTIMER_TBMR_TBCDIR_S 4
  577. #define GPTIMER_TBMR_TBAMS 0x00000008 // GPTM Timer B alternate mode 0:
  578. // Capture mode is enabled. 1: PWM
  579. // mode is enabled. Note: To enable
  580. // PWM mode, the TBCM bit must be
  581. // cleared and the TBMR field must
  582. // be configured to 0x2.
  583. #define GPTIMER_TBMR_TBAMS_M 0x00000008
  584. #define GPTIMER_TBMR_TBAMS_S 3
  585. #define GPTIMER_TBMR_TBCMR 0x00000004 // GPTM Timer B capture mode 0:
  586. // Edge-count mode 1: Edge-time
  587. // mode
  588. #define GPTIMER_TBMR_TBCMR_M 0x00000004
  589. #define GPTIMER_TBMR_TBCMR_S 2
  590. #define GPTIMER_TBMR_TBMR_M 0x00000003 // GPTM Timer B mode 0x0: Reserved
  591. // 0x1: One-shot timer mode 0x2:
  592. // Periodic timer mode 0x3: Capture
  593. // mode The timer mode is based on
  594. // the timer configuration defined
  595. // by bits [2:0] in the GPTMCFG
  596. // register.
  597. #define GPTIMER_TBMR_TBMR_S 0
  598. //*****************************************************************************
  599. //
  600. // The following are defines for the bit fields in the GPTIMER_O_CTL register.
  601. //
  602. //*****************************************************************************
  603. #define GPTIMER_CTL_TBPWML 0x00004000 // GPTM Timer B PWM output level
  604. // 0: Output is unaffected. 1:
  605. // Output is inverted.
  606. #define GPTIMER_CTL_TBPWML_M 0x00004000
  607. #define GPTIMER_CTL_TBPWML_S 14
  608. #define GPTIMER_CTL_TBOTE 0x00002000 // GPTM Timer B output trigger
  609. // enable 0: The ADC trigger of
  610. // output Timer B is disabled. 1:
  611. // The ADC trigger of output Timer
  612. // B is enabled.
  613. #define GPTIMER_CTL_TBOTE_M 0x00002000
  614. #define GPTIMER_CTL_TBOTE_S 13
  615. #define GPTIMER_CTL_TBEVENT_M 0x00000C00 // GPTM Timer B event mode 0x0:
  616. // Positive edge 0x1: Negative edge
  617. // 0x2: Reserved 0x3: Both edges
  618. #define GPTIMER_CTL_TBEVENT_S 10
  619. #define GPTIMER_CTL_TBSTALL 0x00000200 // GPTM Timer B stall enable 0:
  620. // Timer B continues counting while
  621. // the processor is halted by the
  622. // debugger. 1: Timer B freezes
  623. // counting while the processor is
  624. // halted by the debugger.
  625. #define GPTIMER_CTL_TBSTALL_M 0x00000200
  626. #define GPTIMER_CTL_TBSTALL_S 9
  627. #define GPTIMER_CTL_TBEN 0x00000100 // GPTM Timer B enable 0: Timer B
  628. // is disabled. 1: Timer B is
  629. // enabled and begins counting or
  630. // the capture logic is enabled
  631. // based on the GPTMCFG register.
  632. #define GPTIMER_CTL_TBEN_M 0x00000100
  633. #define GPTIMER_CTL_TBEN_S 8
  634. #define GPTIMER_CTL_TAPWML 0x00000040 // GPTM Timer A PWM output level
  635. // 0: Output is unaffected. 1:
  636. // Output is inverted.
  637. #define GPTIMER_CTL_TAPWML_M 0x00000040
  638. #define GPTIMER_CTL_TAPWML_S 6
  639. #define GPTIMER_CTL_TAOTE 0x00000020 // GPTM Timer A output trigger
  640. // enable 0: The ADC trigger of
  641. // output Timer A is disabled. 1:
  642. // The ADC trigger of output Timer
  643. // A is enabled.
  644. #define GPTIMER_CTL_TAOTE_M 0x00000020
  645. #define GPTIMER_CTL_TAOTE_S 5
  646. #define GPTIMER_CTL_TAEVENT_M 0x0000000C // GPTM Timer A event mode 0x0:
  647. // Positive edge 0x1: Negative edge
  648. // 0x2: Reserved 0x3: Both edges
  649. #define GPTIMER_CTL_TAEVENT_S 2
  650. #define GPTIMER_CTL_TASTALL 0x00000002 // GPTM Timer A stall enable 0:
  651. // Timer A continues counting while
  652. // the processor is halted by the
  653. // debugger. 1: Timer A freezes
  654. // counting while the processor is
  655. // halted by the debugger.
  656. #define GPTIMER_CTL_TASTALL_M 0x00000002
  657. #define GPTIMER_CTL_TASTALL_S 1
  658. #define GPTIMER_CTL_TAEN 0x00000001 // GPTM Timer A enable 0: Timer A
  659. // is disabled. 1: Timer A is
  660. // enabled and begins counting or
  661. // the capture logic is enabled
  662. // based on the GPTMCFG register.
  663. #define GPTIMER_CTL_TAEN_M 0x00000001
  664. #define GPTIMER_CTL_TAEN_S 0
  665. //*****************************************************************************
  666. //
  667. // The following are defines for the bit fields in the GPTIMER_O_SYNC register.
  668. //
  669. //*****************************************************************************
  670. #define GPTIMER_SYNC_SYNC3_M 0x000000C0 // Synchronize GPTM3 0x0: GPTM3 is
  671. // not affected. 0x1: A time-out
  672. // event for Timer A of GPTM3 is
  673. // triggered. 0x2: A time-out event
  674. // for Timer B of GPTM3 is
  675. // triggered. 0x3: A time-out event
  676. // for Timer A and Timer B of GPTM3
  677. // is triggered.
  678. #define GPTIMER_SYNC_SYNC3_S 6
  679. #define GPTIMER_SYNC_SYNC2_M 0x00000030 // Synchronize GPTM2 0x0: GPTM2 is
  680. // not affected. 0x1: A time-out
  681. // event for Timer A of GPTM2 is
  682. // triggered. 0x2: A time-out event
  683. // for Timer B of GPTM2 is
  684. // triggered. 0x3: A time-out event
  685. // for Timer A and Timer B of GPTM2
  686. // is triggered.
  687. #define GPTIMER_SYNC_SYNC2_S 4
  688. #define GPTIMER_SYNC_SYNC1_M 0x0000000C // Synchronize GPTM1 0x0: GPTM1 is
  689. // not affected. 0x1: A time-out
  690. // event for Timer A of GPTM1 is
  691. // triggered. 0x2: A time-out event
  692. // for Timer B of GPTM1 is
  693. // triggered. 0x3: A time-out event
  694. // for Timer A and Timer B of GPTM1
  695. // is triggered.
  696. #define GPTIMER_SYNC_SYNC1_S 2
  697. #define GPTIMER_SYNC_SYNC0_M 0x00000003 // Synchronize GPTM0 0x0: GPTM0 is
  698. // not affected. 0x1: A time-out
  699. // event for Timer A of GPTM0 is
  700. // triggered. 0x2: A time-out event
  701. // for Timer B of GPTM0 is
  702. // triggered. 0x3: A time-out event
  703. // for Timer A and Timer B of GPTM0
  704. // is triggered.
  705. #define GPTIMER_SYNC_SYNC0_S 0
  706. //*****************************************************************************
  707. //
  708. // The following are defines for the bit fields in the GPTIMER_O_IMR register.
  709. //
  710. //*****************************************************************************
  711. #define GPTIMER_IMR_TBMIM 0x00000800 // GPTM Timer B match interrupt
  712. // mask 0: Interrupt is disabled.
  713. // 1: Interrupt is enabled.
  714. #define GPTIMER_IMR_TBMIM_M 0x00000800
  715. #define GPTIMER_IMR_TBMIM_S 11
  716. #define GPTIMER_IMR_CBEIM 0x00000400 // GPTM Timer B capture event
  717. // interrupt mask 0: Interrupt is
  718. // disabled. 1: Interrupt is
  719. // enabled.
  720. #define GPTIMER_IMR_CBEIM_M 0x00000400
  721. #define GPTIMER_IMR_CBEIM_S 10
  722. #define GPTIMER_IMR_CBMIM 0x00000200 // GPTM Timer B capture match
  723. // interrupt mask 0: Interrupt is
  724. // disabled. 1: Interrupt is
  725. // enabled.
  726. #define GPTIMER_IMR_CBMIM_M 0x00000200
  727. #define GPTIMER_IMR_CBMIM_S 9
  728. #define GPTIMER_IMR_TBTOIM 0x00000100 // GPTM Timer B time-out interrupt
  729. // mask 0: Interrupt is disabled.
  730. // 1: Interrupt is enabled.
  731. #define GPTIMER_IMR_TBTOIM_M 0x00000100
  732. #define GPTIMER_IMR_TBTOIM_S 8
  733. #define GPTIMER_IMR_TAMIM 0x00000010 // GPTM Timer A match interrupt
  734. // mask 0: Interrupt is disabled.
  735. // 1: Interrupt is enabled.
  736. #define GPTIMER_IMR_TAMIM_M 0x00000010
  737. #define GPTIMER_IMR_TAMIM_S 4
  738. #define GPTIMER_IMR_CAEIM 0x00000004 // GPTM Timer A capture event
  739. // interrupt mask 0: Interrupt is
  740. // disabled. 1: Interrupt is
  741. // enabled.
  742. #define GPTIMER_IMR_CAEIM_M 0x00000004
  743. #define GPTIMER_IMR_CAEIM_S 2
  744. #define GPTIMER_IMR_CAMIM 0x00000002 // GPTM Timer A capture match
  745. // interrupt mask 0: Interrupt is
  746. // disabled. 1: Interrupt is
  747. // enabled.
  748. #define GPTIMER_IMR_CAMIM_M 0x00000002
  749. #define GPTIMER_IMR_CAMIM_S 1
  750. #define GPTIMER_IMR_TATOIM 0x00000001 // GPTM Timer A time-out interrupt
  751. // mask 0: Interrupt is disabled.
  752. // 1: Interrupt is enabled.
  753. #define GPTIMER_IMR_TATOIM_M 0x00000001
  754. #define GPTIMER_IMR_TATOIM_S 0
  755. //*****************************************************************************
  756. //
  757. // The following are defines for the bit fields in the GPTIMER_O_RIS register.
  758. //
  759. //*****************************************************************************
  760. #define GPTIMER_RIS_TBMRIS 0x00000800 // GPTM Timer B match raw
  761. // interrupt
  762. #define GPTIMER_RIS_TBMRIS_M 0x00000800
  763. #define GPTIMER_RIS_TBMRIS_S 11
  764. #define GPTIMER_RIS_CBERIS 0x00000400 // GPTM Timer B capture event raw
  765. // interrupt
  766. #define GPTIMER_RIS_CBERIS_M 0x00000400
  767. #define GPTIMER_RIS_CBERIS_S 10
  768. #define GPTIMER_RIS_CBMRIS 0x00000200 // GPTM Timer B capture match raw
  769. // interrupt
  770. #define GPTIMER_RIS_CBMRIS_M 0x00000200
  771. #define GPTIMER_RIS_CBMRIS_S 9
  772. #define GPTIMER_RIS_TBTORIS 0x00000100 // GPTM Timer B time-out raw
  773. // interrupt
  774. #define GPTIMER_RIS_TBTORIS_M 0x00000100
  775. #define GPTIMER_RIS_TBTORIS_S 8
  776. #define GPTIMER_RIS_TAMRIS 0x00000010 // GPTM Timer A match raw
  777. // interrupt
  778. #define GPTIMER_RIS_TAMRIS_M 0x00000010
  779. #define GPTIMER_RIS_TAMRIS_S 4
  780. #define GPTIMER_RIS_CAERIS 0x00000004 // GPTM Timer A capture event raw
  781. // interrupt
  782. #define GPTIMER_RIS_CAERIS_M 0x00000004
  783. #define GPTIMER_RIS_CAERIS_S 2
  784. #define GPTIMER_RIS_CAMRIS 0x00000002 // GPTM Timer A capture match raw
  785. // interrupt
  786. #define GPTIMER_RIS_CAMRIS_M 0x00000002
  787. #define GPTIMER_RIS_CAMRIS_S 1
  788. #define GPTIMER_RIS_TATORIS 0x00000001 // GPTM Timer A time-out raw
  789. // interrupt
  790. #define GPTIMER_RIS_TATORIS_M 0x00000001
  791. #define GPTIMER_RIS_TATORIS_S 0
  792. //*****************************************************************************
  793. //
  794. // The following are defines for the bit fields in the GPTIMER_O_MIS register.
  795. //
  796. //*****************************************************************************
  797. #define GPTIMER_MIS_TBMMIS 0x00000800 // GPTM Timer B match masked
  798. // interrupt
  799. #define GPTIMER_MIS_TBMMIS_M 0x00000800
  800. #define GPTIMER_MIS_TBMMIS_S 11
  801. #define GPTIMER_MIS_CBEMIS 0x00000400 // GPTM Timer B capture event
  802. // masked interrupt
  803. #define GPTIMER_MIS_CBEMIS_M 0x00000400
  804. #define GPTIMER_MIS_CBEMIS_S 10
  805. #define GPTIMER_MIS_CBMMIS 0x00000200 // GPTM Timer B capture match
  806. // masked interrupt
  807. #define GPTIMER_MIS_CBMMIS_M 0x00000200
  808. #define GPTIMER_MIS_CBMMIS_S 9
  809. #define GPTIMER_MIS_TBTOMIS 0x00000100 // GPTM Timer B time-out masked
  810. // interrupt
  811. #define GPTIMER_MIS_TBTOMIS_M 0x00000100
  812. #define GPTIMER_MIS_TBTOMIS_S 8
  813. #define GPTIMER_MIS_TAMRIS 0x00000010 // GPTM Timer A match raw
  814. // interrupt
  815. #define GPTIMER_MIS_TAMRIS_M 0x00000010
  816. #define GPTIMER_MIS_TAMRIS_S 4
  817. #define GPTIMER_MIS_CAEMIS 0x00000004 // GPTM Timer A capture event raw
  818. // interrupt
  819. #define GPTIMER_MIS_CAEMIS_M 0x00000004
  820. #define GPTIMER_MIS_CAEMIS_S 2
  821. #define GPTIMER_MIS_CAMMIS 0x00000002 // GPTM Timer A capture match raw
  822. // interrupt
  823. #define GPTIMER_MIS_CAMMIS_M 0x00000002
  824. #define GPTIMER_MIS_CAMMIS_S 1
  825. #define GPTIMER_MIS_TATOMIS 0x00000001 // GPTM Timer A time-out raw
  826. // interrupt
  827. #define GPTIMER_MIS_TATOMIS_M 0x00000001
  828. #define GPTIMER_MIS_TATOMIS_S 0
  829. //*****************************************************************************
  830. //
  831. // The following are defines for the bit fields in the GPTIMER_O_ICR register.
  832. //
  833. //*****************************************************************************
  834. #define GPTIMER_ICR_WUECINT 0x00010000 // GPTM write update error
  835. // interrupt clear
  836. #define GPTIMER_ICR_WUECINT_M 0x00010000
  837. #define GPTIMER_ICR_WUECINT_S 16
  838. #define GPTIMER_ICR_TBMCINT 0x00000800 // GPTM Timer B match interrupt
  839. // clear
  840. #define GPTIMER_ICR_TBMCINT_M 0x00000800
  841. #define GPTIMER_ICR_TBMCINT_S 11
  842. #define GPTIMER_ICR_CBECINT 0x00000400 // GPTM Timer B capture event
  843. // Interrupt clear
  844. #define GPTIMER_ICR_CBECINT_M 0x00000400
  845. #define GPTIMER_ICR_CBECINT_S 10
  846. #define GPTIMER_ICR_CBMCINT 0x00000200 // GPTM Timer B capture match
  847. // interrupt clear
  848. #define GPTIMER_ICR_CBMCINT_M 0x00000200
  849. #define GPTIMER_ICR_CBMCINT_S 9
  850. #define GPTIMER_ICR_TBTOCINT 0x00000100 // GPTM Timer B time-out interrupt
  851. // clear
  852. #define GPTIMER_ICR_TBTOCINT_M 0x00000100
  853. #define GPTIMER_ICR_TBTOCINT_S 8
  854. #define GPTIMER_ICR_TAMCINT 0x00000010 // GPTM Timer A match interrupt
  855. // clear
  856. #define GPTIMER_ICR_TAMCINT_M 0x00000010
  857. #define GPTIMER_ICR_TAMCINT_S 4
  858. #define GPTIMER_ICR_CAECINT 0x00000004 // GPTM Timer A capture event
  859. // Interrupt clear
  860. #define GPTIMER_ICR_CAECINT_M 0x00000004
  861. #define GPTIMER_ICR_CAECINT_S 2
  862. #define GPTIMER_ICR_CAMCINT 0x00000002 // GPTM Timer A capture match
  863. // interrupt clear
  864. #define GPTIMER_ICR_CAMCINT_M 0x00000002
  865. #define GPTIMER_ICR_CAMCINT_S 1
  866. #define GPTIMER_ICR_TATOCINT 0x00000001 // GPTM Timer A time-out interrupt
  867. // clear
  868. #define GPTIMER_ICR_TATOCINT_M 0x00000001
  869. #define GPTIMER_ICR_TATOCINT_S 0
  870. //*****************************************************************************
  871. //
  872. // The following are defines for the bit fields in the
  873. // GPTIMER_O_TAILR register.
  874. //
  875. //*****************************************************************************
  876. #define GPTIMER_TAILR_TAILR_M 0xFFFFFFFF // GPTM A interval load register
  877. #define GPTIMER_TAILR_TAILR_S 0
  878. //*****************************************************************************
  879. //
  880. // The following are defines for the bit fields in the
  881. // GPTIMER_O_TBILR register.
  882. //
  883. //*****************************************************************************
  884. #define GPTIMER_TBILR_TBILR_M 0x0000FFFF // GPTM B interval load register
  885. #define GPTIMER_TBILR_TBILR_S 0
  886. //*****************************************************************************
  887. //
  888. // The following are defines for the bit fields in the
  889. // GPTIMER_O_TAMATCHR register.
  890. //
  891. //*****************************************************************************
  892. #define GPTIMER_TAMATCHR_TAMR_M 0xFFFFFFFF // GPTM Timer A match register
  893. #define GPTIMER_TAMATCHR_TAMR_S 0
  894. //*****************************************************************************
  895. //
  896. // The following are defines for the bit fields in the
  897. // GPTIMER_O_TBMATCHR register.
  898. //
  899. //*****************************************************************************
  900. #define GPTIMER_TBMATCHR_TBMR_M 0x0000FFFF // GPTM Timer B match register
  901. #define GPTIMER_TBMATCHR_TBMR_S 0
  902. //*****************************************************************************
  903. //
  904. // The following are defines for the bit fields in the GPTIMER_O_TAPR register.
  905. //
  906. //*****************************************************************************
  907. #define GPTIMER_TAPR_TAPSR_M 0x000000FF // GPTM Timer A prescale
  908. #define GPTIMER_TAPR_TAPSR_S 0
  909. //*****************************************************************************
  910. //
  911. // The following are defines for the bit fields in the GPTIMER_O_TBPR register.
  912. //
  913. //*****************************************************************************
  914. #define GPTIMER_TBPR_TBPSR_M 0x000000FF // GPTM Timer B prescale
  915. #define GPTIMER_TBPR_TBPSR_S 0
  916. //*****************************************************************************
  917. //
  918. // The following are defines for the bit fields in the
  919. // GPTIMER_O_TAPMR register.
  920. //
  921. //*****************************************************************************
  922. #define GPTIMER_TAPMR_TAPSR_M 0x000000FF // GPTM Timer A prescale match
  923. #define GPTIMER_TAPMR_TAPSR_S 0
  924. //*****************************************************************************
  925. //
  926. // The following are defines for the bit fields in the
  927. // GPTIMER_O_TBPMR register.
  928. //
  929. //*****************************************************************************
  930. #define GPTIMER_TBPMR_TBPSR_M 0x000000FF // GPTM Timer B prescale match
  931. #define GPTIMER_TBPMR_TBPSR_S 0
  932. //*****************************************************************************
  933. //
  934. // The following are defines for the bit fields in the GPTIMER_O_TAR register.
  935. //
  936. //*****************************************************************************
  937. #define GPTIMER_TAR_TAR_M 0xFFFFFFFF // GPTM Timer A register
  938. #define GPTIMER_TAR_TAR_S 0
  939. //*****************************************************************************
  940. //
  941. // The following are defines for the bit fields in the GPTIMER_O_TBR register.
  942. //
  943. //*****************************************************************************
  944. #define GPTIMER_TBR_TBR_M 0x0000FFFF // GPTM Timer B register
  945. #define GPTIMER_TBR_TBR_S 0
  946. //*****************************************************************************
  947. //
  948. // The following are defines for the bit fields in the GPTIMER_O_TAV register.
  949. //
  950. //*****************************************************************************
  951. #define GPTIMER_TAV_TAV_M 0xFFFFFFFF // GPTM Timer A register
  952. #define GPTIMER_TAV_TAV_S 0
  953. //*****************************************************************************
  954. //
  955. // The following are defines for the bit fields in the GPTIMER_O_TBV register.
  956. //
  957. //*****************************************************************************
  958. #define GPTIMER_TBV_PRE_M 0x00FF0000 // GPTM Timer B prescale register
  959. // (16-bit mode)
  960. #define GPTIMER_TBV_PRE_S 16
  961. #define GPTIMER_TBV_TBV_M 0x0000FFFF // GPTM Timer B register
  962. #define GPTIMER_TBV_TBV_S 0
  963. //*****************************************************************************
  964. //
  965. // The following are defines for the bit fields in the GPTIMER_O_TAPS register.
  966. //
  967. //*****************************************************************************
  968. #define GPTIMER_TAPS_PSS_M 0x0000FFFF // GPTM Timer A prescaler
  969. #define GPTIMER_TAPS_PSS_S 0
  970. //*****************************************************************************
  971. //
  972. // The following are defines for the bit fields in the GPTIMER_O_TBPS register.
  973. //
  974. //*****************************************************************************
  975. #define GPTIMER_TBPS_PSS_M 0x0000FFFF // GPTM Timer B prescaler
  976. #define GPTIMER_TBPS_PSS_S 0
  977. //*****************************************************************************
  978. //
  979. // The following are defines for the bit fields in the GPTIMER_O_TAPV register.
  980. //
  981. //*****************************************************************************
  982. #define GPTIMER_TAPV_PSV_M 0x0000FFFF // GPTM Timer A prescaler value
  983. #define GPTIMER_TAPV_PSV_S 0
  984. //*****************************************************************************
  985. //
  986. // The following are defines for the bit fields in the GPTIMER_O_TBPV register.
  987. //
  988. //*****************************************************************************
  989. #define GPTIMER_TBPV_PSV_M 0x0000FFFF // GPTM Timer B prescaler value
  990. #define GPTIMER_TBPV_PSV_S 0
  991. //*****************************************************************************
  992. //
  993. // The following are defines for the bit fields in the GPTIMER_O_PP register.
  994. //
  995. //*****************************************************************************
  996. #define GPTIMER_PP_ALTCLK 0x00000040 // Alternate clock source 0: Timer
  997. // is not capable of using an
  998. // alternate clock. 1: Timer is
  999. // capable of using an alternate
  1000. // clock.
  1001. #define GPTIMER_PP_ALTCLK_M 0x00000040
  1002. #define GPTIMER_PP_ALTCLK_S 6
  1003. #define GPTIMER_PP_SYNCNT 0x00000020 // Synchronized start 0: Timer is
  1004. // not capable of synchronizing the
  1005. // count value with other timers.
  1006. // 1: Timer is capable of
  1007. // synchronizing the count value
  1008. // with other timers.
  1009. #define GPTIMER_PP_SYNCNT_M 0x00000020
  1010. #define GPTIMER_PP_SYNCNT_S 5
  1011. #define GPTIMER_PP_CHAIN 0x00000010 // Chain with other timers 0:
  1012. // Timer is not capable of chaining
  1013. // with previously numbered Timers.
  1014. // 1: Timer is capable of chaining
  1015. // with previously numbered timers.
  1016. #define GPTIMER_PP_CHAIN_M 0x00000010
  1017. #define GPTIMER_PP_CHAIN_S 4
  1018. #define GPTIMER_PP_SIZE_M 0x0000000F // Timer size 0: Timer A and Timer
  1019. // B are 16 bits wide with 8-bit
  1020. // prescale. 1: Timer A and Timer B
  1021. // are 32 bits wide with 16-bit
  1022. // prescale.
  1023. #define GPTIMER_PP_SIZE_S 0
  1024. #endif // __HW_GPTIMER_H__