timer_reg.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. /**************************************************************************//**
  2. * @file timer_reg.h
  3. * @version V1.00
  4. * @brief TIMER register definition header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef __TIMER_REG_H__
  10. #define __TIMER_REG_H__
  11. #if defined ( __CC_ARM )
  12. #pragma anon_unions
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup TIMER Timer Controller (TIMER)
  20. Memory Mapped Structure for TIMER Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var TIMER_T::CTL
  26. * Offset: 0x00/0x20 Timer0~3 Control Register
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[7:0] |PSC |Prescale Counter
  31. * | | |Timer input clock or event source is divided by (PSC+1) before it is fed to the timer up counter. If this field is 0 (PSC = 0), then there is no scaling.
  32. * | | |Note: Update prescale counter value will reset internal 8-bit prescale counter and 24-bit up counter value.
  33. * |[8] |TRGPDMA |Trigger PDMA Enable Bit
  34. * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger PDMA.
  35. * | | |0 = Timer interrupt trigger PDMA Disabled.
  36. * | | |1 = Timer interrupt trigger PDMA Enabled.
  37. * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger PDMA. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger PDMA.
  38. * |[9] |TRGBPWM |Trigger BPWM Enable Bit
  39. * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger BPWM.
  40. * | | |0 = Timer interrupt trigger BPWM Disabled.
  41. * | | |1 = Timer interrupt trigger BPWM Enabled.
  42. * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger BPWM. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger BPWM.
  43. * |[10] |INTRGEN |Inter-timer Trigger Mode Enable Bit
  44. * | | |Setting this bit will enable the inter-timer trigger capture function.
  45. * | | |The Timer0/2 will be in event counter mode and counting with external clock source or event. Also, Timer1/3 will be in trigger-counting mode of capture function.
  46. * | | |0 = Inter-Timer Trigger mode Disabled.
  47. * | | |1 = Inter-Timer Trigger mode Enabled.
  48. * | | |Note: For Timer1/3, this bit is ignored and the read back value is always 0.
  49. * |[16] |CAPSRC |Capture Pin Source Selection
  50. * | | |0 = Capture Function source is from TMx_EXT (x= 0~3) pin.
  51. * | | |1 = Capture Function source is from internal ACMP output signal or LIRC. User can set INTERCAPSEL (TIMERx_EXTCTL[10:8]) to decide which internal ACMP output signal or LIRC as timer capture source.
  52. * |[18] |TRGSSEL |Trigger Source Select Bit
  53. * | | |This bit is used to select trigger source is from Timer time-out interrupt signal or capture interrupt signal.
  54. * | | |0 = Timer time-out interrupt signal is used to trigger PWM, ADC and PDMA.
  55. * | | |1 = Capture interrupt signal is used to trigger PWM, ADC and PDMA.
  56. * |[19] |TRGPWM |Trigger PWM Enable Bit
  57. * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger PWM.
  58. * | | |0 = Timer interrupt trigger PWM Disabled.
  59. * | | |1 = Timer interrupt trigger PWM Enabled.
  60. * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger PWM. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger PWM.
  61. * |[21] |TRGADC |Trigger ADC Enable Bit
  62. * | | |If this bit is set to 1, timer time-out interrupt or capture interrupt can trigger ADC.
  63. * | | |0 = Timer interrupt trigger ADC Disabled.
  64. * | | |1 = Timer interrupt trigger ADC Enabled.
  65. * | | |Note: If TRGSSEL (TIMERx_CTL[18]) = 0, time-out interrupt signal will trigger ADC. If TRGSSEL (TIMERx_CTL[18]) = 1, capture interrupt signal will trigger ADC.
  66. * |[22] |TGLPINSEL |Toggle-output Pin Select
  67. * | | |0 = Toggle mode output to Tx (Timer Event Counter Pin).
  68. * | | |1 = Toggle mode output to Tx_EXT (Timer External Capture Pin).
  69. * |[23] |WKEN |Wake-up Function Enable Bit
  70. * | | |If this bit is set to 1, while timer interrupt flag TIF (TIMERx_INTSTS[0]) is 1 and INTEN (TIMERx_CTL[29]) is enabled, the timer interrupt signal will generate a wake-up trigger event to CPU.
  71. * | | |0 = Wake-up function Disabled if timer interrupt signal generated.
  72. * | | |1 = Wake-up function Enabled if timer interrupt signal generated.
  73. * |[24] |EXTCNTEN |Event Counter Mode Enable Bit
  74. * | | |This bit is for external counting pin function enabled.
  75. * | | |0 = Event counter mode Disabled.
  76. * | | |1 = Event counter mode Enabled.
  77. * | | |Note1: When timer is used as an event counter, this bit should be set to 1 and select PCLKx (x=0~1) as timer clock source.
  78. * | | |Note2: When TMR0/TMR2 INTRGEN is set to 1, this bit is forced to 1. When INTRGEN is 1 and TMR1/TMR3 CAPIF (TIMERx_EINTSTS[0]) is 1, this bit is forced to 0.
  79. * |[25] |ACTSTS |Timer Active Status Bit (Read Only)
  80. * | | |This bit indicates the 24-bit up counter status.
  81. * | | |0 = 24-bit up counter is not active.
  82. * | | |1 = 24-bit up counter is active.
  83. * | | |Note: This bit may active when CNT 0 transition to CNT 1.
  84. * |[26] |RSTCNT |Timer Counter Reset Bit
  85. * | | |Setting this bit will reset the 24-bit up counter value CNT (TIMERx_CNT[23:0]) and also force CNTEN (TIMERx_CTL[30]) to 0 if ACTSTS (TIMERx_CTL[25]) is 1.
  86. * | | |0 = No effect.
  87. * | | |1 = Reset internal 8-bit prescale counter, 24-bit up counter value and CNTEN bit.
  88. * | | |Note: This bit will be auto cleared.
  89. * |[28:27] |OPMODE |Timer Counting Mode Select
  90. * | | |00 = The timer controller is operated in One-shot mode.
  91. * | | |01 = The timer controller is operated in Periodic mode.
  92. * | | |10 = The timer controller is operated in Toggle-output mode.
  93. * | | |11 = The timer controller is operated in Continuous Counting mode.
  94. * |[29] |INTEN |Timer Interrupt Enable Bit
  95. * | | |0 = Timer time-out interrupt Disabled.
  96. * | | |1 = Timer time-out interrupt Enabled.
  97. * | | |Note: If this bit is enabled, when the timer time-out interrupt flag TIF is set to 1, the timer interrupt signal is generated and inform to CPU.
  98. * |[30] |CNTEN |Timer Counting Enable Bit
  99. * | | |0 = Stops/Suspends counting.
  100. * | | |1 = Starts counting.
  101. * | | |Note1: In stop status, and then set CNTEN to 1 will enable the 24-bit up counter to keep counting from the last stop counting value.
  102. * | | |Note2: This bit is auto-cleared by hardware in one-shot mode (TIMER_CTL[28:27] = 00) when the timer time-out interrupt flag TIF (TIMERx_INTSTS[0]) is generated.
  103. * | | |Note3: Set enable/disable this bit needs 2 * TMR_CLK period to become active, user can read ACTSTS (TIMERx_CTL[25]) to check enable/disable command is completed or not.
  104. * |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Bit (Write Protect)
  105. * | | |0 = ICE debug mode acknowledgement effects TIMER counting.
  106. * | | |TIMER counter will be held while CPU is held by ICE.
  107. * | | |1 = ICE debug mode acknowledgement Disabled.
  108. * | | |TIMER counter will keep going no matter CPU is held by ICE or not.
  109. * | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
  110. * @var TIMER_T::CMP
  111. * Offset: 0x04/0x24 Timer0~3 Comparator Register
  112. * ---------------------------------------------------------------------------------------------------
  113. * |Bits |Field |Descriptions
  114. * | :----: | :----: | :---- |
  115. * |[23:0] |CMPDAT |Timer Comparator Value
  116. * | | |CMPDAT is a 24-bit compared value register
  117. * | | |When the internal 24-bit up counter value is equal to CMPDAT value, the TIF (TIMERx_INTSTS[0] Timer Interrupt Flag) will set to 1.
  118. * | | |Time-out period = (Period of timer clock input) * (8-bit PSC + 1) * (24-bit CMPDAT).
  119. * | | |Note1: Never write 0x0 or 0x1 in CMPDAT field, or the core will run into unknown state.
  120. * | | |Note2: When timer is operating at continuous counting mode, the 24-bit up counter will keep counting continuously even if user writes a new value into CMPDAT field. But if timer is operating at other modes, the 24-bit up counter will restart counting from 0 and using newest CMPDAT value to be the timer compared value while user writes a new value into CMPDAT field.
  121. * @var TIMER_T::INTSTS
  122. * Offset: 0x08/0x28 Timer0~3 Interrupt Status Register
  123. * ---------------------------------------------------------------------------------------------------
  124. * |Bits |Field |Descriptions
  125. * | :----: | :----: | :---- |
  126. * |[0] |TIF |Timer Interrupt Flag
  127. * | | |This bit indicates the interrupt flag status of Timer while 24-bit timer up counter CNT (TIMERx_CNT[23:0]) value reaches to CMPDAT (TIMERx_CMP[23:0]) value.
  128. * | | |0 = No effect.
  129. * | | |1 = CNT value matches the CMPDAT value.
  130. * | | |Note: This bit is cleared by writing 1 to it.
  131. * |[1] |TWKF |Timer Wake-up Flag
  132. * | | |This bit indicates the interrupt wake-up flag status of timer.
  133. * | | |0 = Timer does not cause CPU wake-up.
  134. * | | |1 = CPU wake-up from Idle or Power-down mode if timer time-out interrupt signal generated.
  135. * | | |Note: This bit is cleared by writing 1 to it.
  136. * @var TIMER_T::CNT
  137. * Offset: 0x0C/0x2C Timer0~3 Data Register
  138. * ---------------------------------------------------------------------------------------------------
  139. * |Bits |Field |Descriptions
  140. * | :----: | :----: | :---- |
  141. * |[23:0] |CNT |Timer Data Register
  142. * | | |Read this register to get CNT value. For example:
  143. * | | |If EXTCNTEN (TIMERx_CTL[24]) is 0, user can read CNT value for getting current 24-bit counter value.
  144. * | | |If EXTCNTEN (TIMERx_CTL[24]) is 1, user can read CNT value for getting current 24-bit event input counter value.
  145. * @var TIMER_T::CAP
  146. * Offset: 0x10/0x30 Timer0~3 Capture Data Register
  147. * ---------------------------------------------------------------------------------------------------
  148. * |Bits |Field |Descriptions
  149. * | :----: | :----: | :---- |
  150. * |[23:0] |CAPDAT |Timer Capture Data Register
  151. * | | |When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on TMx_EXT pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, CAPIF (TIMERx_EINTSTS[0]) will set to 1 and the current timer counter value CNT (TIMERx_CNT[23:0]) will be auto-loaded into this CAPDAT field.
  152. * @var TIMER_T::EXTCTL
  153. * Offset: 0x14/0x34 Timer0~3 External Control Register
  154. * ---------------------------------------------------------------------------------------------------
  155. * |Bits |Field |Descriptions
  156. * | :----: | :----: | :---- |
  157. * |[0] |CNTPHASE |Timer External Count Phase
  158. * | | |This bit indicates the detection phase of external counting pin TMx (x= 0~3).
  159. * | | |0 = A falling edge of external counting pin will be counted.
  160. * | | |1 = A rising edge of external counting pin will be counted.
  161. * |[2:1] |CAPEDGE |Timer External Capture Pin Edge Detect
  162. * | | |00 = A Falling edge on Tx_EXT (x= 0~3) pin, LIRC or ACMPx (x=0~1) will be detected.
  163. * | | |01 = A Rising edge on Tx_EXT (x= 0~3) pin, LIRC or ACMPx (x=0~1) will be detected.
  164. * | | |10 = Either Rising or Falling edge on Tx_EXT (x= 0~3) pin, LIRC or ACMPx (x=0~1) will be detected.
  165. * | | |11 = Reserved.
  166. * |[3] |CAPEN |Timer Capture Enable Bit
  167. * | | |This bit enables the capture input function.
  168. * | | |0 =Capture source Disabled.
  169. * | | |1 =Capture source Enabled.
  170. * | | |Note: TMR1/TMR3 CAPEN will be forced to 1 when TMR0/TMR2 INTRGEN is enabled.
  171. * |[4] |CAPFUNCS |Capture Function Selection
  172. * | | |0 = External Capture Mode Enabled.
  173. * | | |1 = External Reset Mode Enabled.
  174. * | | |Note1: When CAPFUNCS is 0, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field.
  175. * | | |Note2: When CAPFUNCS is 1, transition on TMx_EXT (x= 0~3) pin is using to save current 24-bit timer counter value (CNT value) to CAPDAT field then CNT value will be reset immediately.
  176. * |[5] |CAPIEN |Timer External Capture Interrupt Enable Bit
  177. * | | |0 = TMx_EXT (x= 0~3) pin, LIRC, or ACMP detection Interrupt Disabled.
  178. * | | |1 = TMx_EXT (x= 0~3) pin, LIRC, or ACMP detection Interrupt Enabled.
  179. * | | |Note: CAPIEN is used to enable timer external interrupt
  180. * | | |If CAPIEN enabled, timer will rise an interrupt when CAPIF (TIMERx_EINTSTS[0]) is 1.
  181. * | | |For example, while CAPIEN = 1, CAPEN = 1, and CAPEDGE = 00, a 1 to 0 transition on the Tx_EXT (x= 0~3) pin, or ACMP will cause the CAPIF to be set then the interrupt signal is generated and sent to NVIC to inform CPU.
  182. * |[6] |CAPDBEN |Timer External Capture Pin De-bounce Enable Bit
  183. * | | |0 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Disabled.
  184. * | | |1 = TMx_EXT (x= 0~3) pin de-bounce or ACMP output de-bounce Enabled.
  185. * | | |Note: If this bit is enabled, the edge detection of TMx_EXT pin or ACMP output is detected with de-bounce circuit.
  186. * |[7] |CNTDBEN |Timer Counter Pin De-bounce Enable Bit
  187. * | | |0 = TMx (x= 0~3) pin de-bounce Disabled.
  188. * | | |1 = TMx (x= 0~3) pin de-bounce Enabled.
  189. * | | |Note: If this bit is enabled, the edge detection of TMx pin is detected with de-bounce circuit.
  190. * |[10:8] |INTERCAPSEL|Internal Capture Source Selection to Trigger Capture Function
  191. * | | |000 = Capture Function source is from internal ACMP0 output signal.
  192. * | | |001 = Capture Function source is from internal ACMP1 output signal.
  193. * | | |101 = Capture Function source is from LIRC.
  194. * | | |Others = Reserved.
  195. * | | |Note: these bits only available when CAPSRC (TIMERx_CTL[16]) is 1.
  196. * |[16] |ECNTSSEL |Event Counter Source Selection to Trigger Event Counter Function
  197. * | | |0 = Event Counter input source is from TMx (x= 0~3) pin.
  198. * | | |1 = Event Counter input source is from USB internal SOF output signal.
  199. * @var TIMER_T::EINTSTS
  200. * Offset: 0x18/0x38 Timer0~3 External Interrupt Status Register
  201. * ---------------------------------------------------------------------------------------------------
  202. * |Bits |Field |Descriptions
  203. * | :----: | :----: | :---- |
  204. * |[0] |CAPIF |Timer External Capture Interrupt Flag
  205. * | | |This bit indicates the timer external capture interrupt flag status.
  206. * | | |0 = TMx_EXT (x= 0~3) pin interrupt did not occur.
  207. * | | |1 = TMx_EXT (x= 0~3) pin interrupt occurred.
  208. * | | |Note1: This bit is cleared by writing 1 to it.
  209. * | | |Note2: When CAPEN (TIMERx_EXTCTL[3]) bit is set, CAPFUNCS (TIMERx_EXTCTL[4]) bit is 0, and a transition on Tx_EXT (x= 0~3) pin matched the CAPEDGE (TIMERx_EXTCTL[2:1]) setting, this bit will set to 1 by hardware.
  210. * | | |Note3: There is a new incoming capture event detected before CPU clearing the CAPIF status. If the above condition occurred, the Timer will keep register TIMERx_CAP unchanged and drop the new capture value.
  211. */
  212. __IO uint32_t CTL; /*!< [0x0000] Timer0 Control Register */
  213. __IO uint32_t CMP; /*!< [0x0004] Timer0 Comparator Register */
  214. __IO uint32_t INTSTS; /*!< [0x0008] Timer0 Interrupt Status Register */
  215. __I uint32_t CNT; /*!< [0x000c] Timer0 Data Register */
  216. __I uint32_t CAP; /*!< [0x0010] Timer0 Capture Data Register */
  217. __IO uint32_t EXTCTL; /*!< [0x0014] Timer0 External Control Register */
  218. __IO uint32_t EINTSTS; /*!< [0x0018] Timer0 External Interrupt Status Register */
  219. } TIMER_T;
  220. /**
  221. @addtogroup TIMER_CONST TIMER Bit Field Definition
  222. Constant Definitions for TIMER Controller
  223. @{ */
  224. #define TIMER_CTL_PSC_Pos (0) /*!< TIMER_T::CTL: PSC Position */
  225. #define TIMER_CTL_PSC_Msk (0xfful << TIMER_CTL_PSC_Pos) /*!< TIMER_T::CTL: PSC Mask */
  226. #define TIMER_CTL_TRGPDMA_Pos (8) /*!< TIMER_T::CTL: TRGPDMA Position */
  227. #define TIMER_CTL_TRGPDMA_Msk (0x1ul << TIMER_CTL_TRGPDMA_Pos) /*!< TIMER_T::CTL: TRGPDMA Mask */
  228. #define TIMER_CTL_TRGBPWM_Pos (9) /*!< TIMER_T::CTL: TRGBPWM Position */
  229. #define TIMER_CTL_TRGBPWM_Msk (0x1ul << TIMER_CTL_TRGBPWM_Pos) /*!< TIMER_T::CTL: TRGBPWM Mask */
  230. #define TIMER_CTL_INTRGEN_Pos (10) /*!< TIMER_T::CTL: INTRGEN Position */
  231. #define TIMER_CTL_INTRGEN_Msk (0x1ul << TIMER_CTL_INTRGEN_Pos) /*!< TIMER_T::CTL: INTRGEN Mask */
  232. #define TIMER_CTL_CAPSRC_Pos (16) /*!< TIMER_T::CTL: CAPSRC Position */
  233. #define TIMER_CTL_CAPSRC_Msk (0x1ul << TIMER_CTL_CAPSRC_Pos) /*!< TIMER_T::CTL: CAPSRC Mask */
  234. #define TIMER_CTL_TRGSSEL_Pos (18) /*!< TIMER_T::CTL: TRGSSEL Position */
  235. #define TIMER_CTL_TRGSSEL_Msk (0x1ul << TIMER_CTL_TRGSSEL_Pos) /*!< TIMER_T::CTL: TRGSSEL Mask */
  236. #define TIMER_CTL_TRGPWM_Pos (19) /*!< TIMER_T::CTL: TRGPWM Position */
  237. #define TIMER_CTL_TRGPWM_Msk (0x1ul << TIMER_CTL_TRGPWM_Pos) /*!< TIMER_T::CTL: TRGPWM Mask */
  238. #define TIMER_CTL_TRGADC_Pos (21) /*!< TIMER_T::CTL: TRGADC Position */
  239. #define TIMER_CTL_TRGADC_Msk (0x1ul << TIMER_CTL_TRGADC_Pos) /*!< TIMER_T::CTL: TRGADC Mask */
  240. #define TIMER_CTL_TGLPINSEL_Pos (22) /*!< TIMER_T::CTL: TGLPINSEL Position */
  241. #define TIMER_CTL_TGLPINSEL_Msk (0x1ul << TIMER_CTL_TGLPINSEL_Pos) /*!< TIMER_T::CTL: TGLPINSEL Mask */
  242. #define TIMER_CTL_WKEN_Pos (23) /*!< TIMER_T::CTL: WKEN Position */
  243. #define TIMER_CTL_WKEN_Msk (0x1ul << TIMER_CTL_WKEN_Pos) /*!< TIMER_T::CTL: WKEN Mask */
  244. #define TIMER_CTL_EXTCNTEN_Pos (24) /*!< TIMER_T::CTL: EXTCNTEN Position */
  245. #define TIMER_CTL_EXTCNTEN_Msk (0x1ul << TIMER_CTL_EXTCNTEN_Pos) /*!< TIMER_T::CTL: EXTCNTEN Mask */
  246. #define TIMER_CTL_ACTSTS_Pos (25) /*!< TIMER_T::CTL: ACTSTS Position */
  247. #define TIMER_CTL_ACTSTS_Msk (0x1ul << TIMER_CTL_ACTSTS_Pos) /*!< TIMER_T::CTL: ACTSTS Mask */
  248. #define TIMER_CTL_RSTCNT_Pos (26) /*!< TIMER_T::CTL: RSTCNT Position */
  249. #define TIMER_CTL_RSTCNT_Msk (0x1ul << TIMER_CTL_RSTCNT_Pos) /*!< TIMER_T::CTL: RSTCNT Mask */
  250. #define TIMER_CTL_OPMODE_Pos (27) /*!< TIMER_T::CTL: OPMODE Position */
  251. #define TIMER_CTL_OPMODE_Msk (0x3ul << TIMER_CTL_OPMODE_Pos) /*!< TIMER_T::CTL: OPMODE Mask */
  252. #define TIMER_CTL_INTEN_Pos (29) /*!< TIMER_T::CTL: INTEN Position */
  253. #define TIMER_CTL_INTEN_Msk (0x1ul << TIMER_CTL_INTEN_Pos) /*!< TIMER_T::CTL: INTEN Mask */
  254. #define TIMER_CTL_CNTEN_Pos (30) /*!< TIMER_T::CTL: CNTEN Position */
  255. #define TIMER_CTL_CNTEN_Msk (0x1ul << TIMER_CTL_CNTEN_Pos) /*!< TIMER_T::CTL: CNTEN Mask */
  256. #define TIMER_CTL_ICEDEBUG_Pos (31) /*!< TIMER_T::CTL: ICEDEBUG Position */
  257. #define TIMER_CTL_ICEDEBUG_Msk (0x1ul << TIMER_CTL_ICEDEBUG_Pos) /*!< TIMER_T::CTL: ICEDEBUG Mask */
  258. #define TIMER_CMP_CMPDAT_Pos (0) /*!< TIMER_T::CMP: CMPDAT Position */
  259. #define TIMER_CMP_CMPDAT_Msk (0xfffffful << TIMER_CMP_CMPDAT_Pos) /*!< TIMER_T::CMP: CMPDAT Mask */
  260. #define TIMER_INTSTS_TIF_Pos (0) /*!< TIMER_T::INTSTS: TIF Position */
  261. #define TIMER_INTSTS_TIF_Msk (0x1ul << TIMER_INTSTS_TIF_Pos) /*!< TIMER_T::INTSTS: TIF Mask */
  262. #define TIMER_INTSTS_TWKF_Pos (1) /*!< TIMER_T::INTSTS: TWKF Position */
  263. #define TIMER_INTSTS_TWKF_Msk (0x1ul << TIMER_INTSTS_TWKF_Pos) /*!< TIMER_T::INTSTS: TWKF Mask */
  264. #define TIMER_CNT_CNT_Pos (0) /*!< TIMER_T::CNT: CNT Position */
  265. #define TIMER_CNT_CNT_Msk (0xfffffful << TIMER_CNT_CNT_Pos) /*!< TIMER_T::CNT: CNT Mask */
  266. #define TIMER_CAP_CAPDAT_Pos (0) /*!< TIMER_T::CAP: CAPDAT Position */
  267. #define TIMER_CAP_CAPDAT_Msk (0xfffffful << TIMER_CAP_CAPDAT_Pos) /*!< TIMER_T::CAP: CAPDAT Mask */
  268. #define TIMER_EXTCTL_CNTPHASE_Pos (0) /*!< TIMER_T::EXTCTL: CNTPHASE Position */
  269. #define TIMER_EXTCTL_CNTPHASE_Msk (0x1ul << TIMER_EXTCTL_CNTPHASE_Pos) /*!< TIMER_T::EXTCTL: CNTPHASE Mask */
  270. #define TIMER_EXTCTL_CAPEDGE_Pos (1) /*!< TIMER_T::EXTCTL: CAPEDGE Position */
  271. #define TIMER_EXTCTL_CAPEDGE_Msk (0x3ul << TIMER_EXTCTL_CAPEDGE_Pos) /*!< TIMER_T::EXTCTL: CAPEDGE Mask */
  272. #define TIMER_EXTCTL_CAPEN_Pos (3) /*!< TIMER_T::EXTCTL: CAPEN Position */
  273. #define TIMER_EXTCTL_CAPEN_Msk (0x1ul << TIMER_EXTCTL_CAPEN_Pos) /*!< TIMER_T::EXTCTL: CAPEN Mask */
  274. #define TIMER_EXTCTL_CAPFUNCS_Pos (4) /*!< TIMER_T::EXTCTL: CAPFUNCS Position */
  275. #define TIMER_EXTCTL_CAPFUNCS_Msk (0x1ul << TIMER_EXTCTL_CAPFUNCS_Pos) /*!< TIMER_T::EXTCTL: CAPFUNCS Mask */
  276. #define TIMER_EXTCTL_CAPIEN_Pos (5) /*!< TIMER_T::EXTCTL: CAPIEN Position */
  277. #define TIMER_EXTCTL_CAPIEN_Msk (0x1ul << TIMER_EXTCTL_CAPIEN_Pos) /*!< TIMER_T::EXTCTL: CAPIEN Mask */
  278. #define TIMER_EXTCTL_CAPDBEN_Pos (6) /*!< TIMER_T::EXTCTL: CAPDBEN Position */
  279. #define TIMER_EXTCTL_CAPDBEN_Msk (0x1ul << TIMER_EXTCTL_CAPDBEN_Pos) /*!< TIMER_T::EXTCTL: CAPDBEN Mask */
  280. #define TIMER_EXTCTL_CNTDBEN_Pos (7) /*!< TIMER_T::EXTCTL: CNTDBEN Position */
  281. #define TIMER_EXTCTL_CNTDBEN_Msk (0x1ul << TIMER_EXTCTL_CNTDBEN_Pos) /*!< TIMER_T::EXTCTL: CNTDBEN Mask */
  282. #define TIMER_EXTCTL_INTERCAPSEL_Pos (8) /*!< TIMER_T::EXTCTL: INTERCAPSEL Position */
  283. #define TIMER_EXTCTL_INTERCAPSEL_Msk (0x7ul << TIMER_EXTCTL_INTERCAPSEL_Pos) /*!< TIMER_T::EXTCTL: INTERCAPSEL Mask */
  284. #define TIMER_EXTCTL_ECNTSSEL_Pos (16) /*!< TIMER_T::EXTCTL: ECNTSSEL Position */
  285. #define TIMER_EXTCTL_ECNTSSEL_Msk (0x1ul << TIMER_EXTCTL_ECNTSSEL_Pos) /*!< TIMER_T::EXTCTL: ECNTSSEL Mask */
  286. #define TIMER_EINTSTS_CAPIF_Pos (0) /*!< TIMER_T::EINTSTS: CAPIF Position */
  287. #define TIMER_EINTSTS_CAPIF_Msk (0x1ul << TIMER_EINTSTS_CAPIF_Pos) /*!< TIMER_T::EINTSTS: CAPIF Mask */
  288. /**@}*/ /* TIMER_CONST */
  289. /**@}*/ /* end of TIMER register group */
  290. /**@}*/ /* end of REGISTER group */
  291. #if defined ( __CC_ARM )
  292. #pragma no_anon_unions
  293. #endif
  294. #endif /* __TIMER_REG_H__ */