ecap_reg.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. /**************************************************************************//**
  2. * @file ecap_reg.h
  3. * @version V1.00
  4. * @brief ECAP register definition header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef __ECAP_REG_H__
  10. #define __ECAP_REG_H__
  11. #if defined ( __CC_ARM )
  12. #pragma anon_unions
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup ECAP Enhanced Input Capture Timer(ECAP)
  20. Memory Mapped Structure for ECAP Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var ECAP_T::CNT
  26. * Offset: 0x00 Input Capture Counter (24-bit up counter)
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[23:0] |CNT |Input Capture Timer/Counter
  31. * | | |The input Capture Timer/Counter is a 24-bit up-counting counter
  32. * | | |The clock source for the counter is from the clock divider
  33. * @var ECAP_T::HLD0
  34. * Offset: 0x04 Input Capture Hold Register 0
  35. * ---------------------------------------------------------------------------------------------------
  36. * |Bits |Field |Descriptions
  37. * | :----: | :----: | :---- |
  38. * |[23:0] |HOLD |Input Capture Counter Hold Register
  39. * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register
  40. * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively.
  41. * @var ECAP_T::HLD1
  42. * Offset: 0x08 Input Capture Hold Register 1
  43. * ---------------------------------------------------------------------------------------------------
  44. * |Bits |Field |Descriptions
  45. * | :----: | :----: | :---- |
  46. * |[23:0] |HOLD |Input Capture Counter Hold Register
  47. * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register
  48. * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively.
  49. * @var ECAP_T::HLD2
  50. * Offset: 0x0C Input Capture Hold Register 2
  51. * ---------------------------------------------------------------------------------------------------
  52. * |Bits |Field |Descriptions
  53. * | :----: | :----: | :---- |
  54. * |[23:0] |HOLD |Input Capture Counter Hold Register
  55. * | | |When an active input capture channel detects a valid edge signal change, the ECAPCNT value is latched into the corresponding holding register
  56. * | | |Each input channel has its own holding register named by ECAP_HLDx where x is from 0 to 2 to indicate inputs from IC0 to IC2, respectively.
  57. * @var ECAP_T::CNTCMP
  58. * Offset: 0x10 Input Capture Compare Register
  59. * ---------------------------------------------------------------------------------------------------
  60. * |Bits |Field |Descriptions
  61. * | :----: | :----: | :---- |
  62. * |[23:0] |CNTCMP |Input Capture Counter Compare Register
  63. * | | |If the compare function is enabled (CMPEN = 1), this register (ECAP_CNTCMP) is used to compare with the capture counter (ECAP_CNT).
  64. * | | |If the reload control is enabled (RLDEN[n] = 1, n=0~3), an overflow event or capture events will trigger the hardware to load the value of this register (ECAP_CNTCMP) into ECAP_CNT.
  65. * @var ECAP_T::CTL0
  66. * Offset: 0x14 Input Capture Control Register 0
  67. * ---------------------------------------------------------------------------------------------------
  68. * |Bits |Field |Descriptions
  69. * | :----: | :----: | :---- |
  70. * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection
  71. * | | |To determine the sampling frequency of the Noise Filter clock
  72. * | | |000 = CAP_CLK.
  73. * | | |001 = CAP_CLK/2.
  74. * | | |010 = CAP_CLK/4.
  75. * | | |011 = CAP_CLK/16.
  76. * | | |100 = CAP_CLK/32.
  77. * | | |101 = CAP_CLK/64.
  78. * |[3] |CAPNFDIS |Input Capture Noise Filter Disable Control
  79. * | | |0 = Noise filter of Input Capture Enabled.
  80. * | | |1 = Noise filter of Input Capture Disabled (Bypass).
  81. * |[4] |IC0EN |Port Pin IC0 Input to Input Capture Unit Enable Control
  82. * | | |0 = IC0 input to Input Capture Unit Disabled.
  83. * | | |1 = IC0 input to Input Capture Unit Enabled.
  84. * |[5] |IC1EN |Port Pin IC1 Input to Input Capture Unit Enable Control
  85. * | | |0 = IC1 input to Input Capture Unit Disabled.
  86. * | | |1 = IC1 input to Input Capture Unit Enabled.
  87. * |[6] |IC2EN |Port Pin IC2 Input to Input Capture Unit Enable Control
  88. * | | |0 = IC2 input to Input Capture Unit Disabled.
  89. * | | |1 = IC2 input to Input Capture Unit Enabled.
  90. * |[9:8] |CAPSEL0 |CAP0 Input Source Selection
  91. * | | |00 = CAP0 input is from port pin ICAP0.
  92. * | | |01 = Reserved.
  93. * | | |10 = CAP0 input is from signal CHA of QEI controller unit n.
  94. * | | |11 = Reserved.
  95. * | | |Note: Input capture unit n matches QEIn, where n = 0~1.
  96. * |[11:10] |CAPSEL1 |CAP1 Input Source Selection
  97. * | | |00 = CAP1 input is from port pin ICAP1.
  98. * | | |01 = Reserved.
  99. * | | |10 = CAP1 input is from signal CHB of QEI controller unit n.
  100. * | | |11 = Reserved.
  101. * | | |Note: Input capture unit n matches QEIn, where n = 0~1.
  102. * |[13:12] |CAPSEL2 |CAP2 Input Source Selection
  103. * | | |00 = CAP2 input is from port pin ICAP2.
  104. * | | |01 = Reserved.
  105. * | | |10 = CAP2 input is from signal CHX of QEI controller unit n.
  106. * | | |11 = Reserved.
  107. * | | |Note: Input capture unit n matches QEIn, where n = 0~1.
  108. * |[16] |CAPIEN0 |Input Capture Channel 0 Interrupt Enable Control
  109. * | | |0 = The flag CAPTF0 can trigger Input Capture interrupt Disabled.
  110. * | | |1 = The flag CAPTF0 can trigger Input Capture interrupt Enabled.
  111. * |[17] |CAPIEN1 |Input Capture Channel 1 Interrupt Enable Control
  112. * | | |0 = The flag CAPTF1 can trigger Input Capture interrupt Disabled.
  113. * | | |1 = The flag CAPTF1 can trigger Input Capture interrupt Enabled.
  114. * |[18] |CAPIEN2 |Input Capture Channel 2 Interrupt Enable Control
  115. * | | |0 = The flag CAPTF2 can trigger Input Capture interrupt Disabled.
  116. * | | |1 = The flag CAPTF2 can trigger Input Capture interrupt Enabled.
  117. * |[20] |OVIEN |CAPOVF Trigger Input Capture Interrupt Enable Control
  118. * | | |0 = The flag CAPOVF can trigger Input Capture interrupt Disabled.
  119. * | | |1 = The flag CAPOVF can trigger Input Capture interrupt Enabled.
  120. * |[21] |CMPIEN |CAPCMPF Trigger Input Capture Interrupt Enable Control
  121. * | | |0 = The flag CAPCMPF can trigger Input Capture interrupt Disabled.
  122. * | | |1 = The flag CAPCMPF can trigger Input Capture interrupt Enabled.
  123. * |[24] |CNTEN |Input Capture Counter Start Counting Control
  124. * | | |Setting this bit to 1, the capture counter (ECAP_CNT) starts up-counting synchronously with the clock from the .
  125. * | | |0 = ECAP_CNT stop counting.
  126. * | | |1 = ECAP_CNT starts up-counting.
  127. * |[25] |CMPCLREN |Input Capture Counter Cleared by Compare-match Control
  128. * | | |If this bit is set to 1, the capture counter (ECAP_CNT) will be cleared to 0 when the compare-match event (CAPCMPF = 1) occurs.
  129. * | | |0 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Disabled.
  130. * | | |1 = Compare-match event (CAPCMPF) can clear capture counter (ECAP_CNT) Enabled.
  131. * |[28] |CMPEN |Compare Function Enable Control
  132. * | | |The compare function in input capture timer/counter is to compare the dynamic counting ECAP_CNT with the compare register ECAP_CNTCMP, if ECAP_CNT value reaches ECAP_CNTCMP, the flag CAPCMPF will be set.
  133. * | | |0 = The compare function Disabled.
  134. * | | |1 = The compare function Enabled.
  135. * |[29] |CAPEN |Input Capture Timer/Counter Enable Control
  136. * | | |0 = Input Capture function Disabled.
  137. * | | |1 = Input Capture function Enabled.
  138. * @var ECAP_T::CTL1
  139. * Offset: 0x18 Input Capture Control Register 1
  140. * ---------------------------------------------------------------------------------------------------
  141. * |Bits |Field |Descriptions
  142. * | :----: | :----: | :---- |
  143. * |[1:0] |EDGESEL0 |Channel 0 Captured Edge Selection
  144. * | | |Input capture0 can detect falling edge change only, rising edge change only or both edge change
  145. * | | |00 = Detect rising edge only.
  146. * | | |01 = Detect falling edge only.
  147. * | | |1x = Detect both rising and falling edge.
  148. * |[3:2] |EDGESEL1 |Channel 1 Captured Edge Selection
  149. * | | |Input capture1 can detect falling edge change only, rising edge change only or both edge change
  150. * | | |00 = Detect rising edge only.
  151. * | | |01 = Detect falling edge only.
  152. * | | |1x = Detect both rising and falling edge.
  153. * |[5:4] |EDGESEL2 |Channel 2 Captured Edge Selection
  154. * | | |Input capture2 can detect falling edge change only, rising edge change only or both edge changes
  155. * | | |00 = Detect rising edge only.
  156. * | | |01 = Detect falling edge only.
  157. * | | |1x = Detect both rising and falling edge.
  158. * |[8] |CAP0RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE0 Enable Bit
  159. * | | |0 = The reload triggered by Event CAPTE0 Disabled.
  160. * | | |1 = The reload triggered by Event CAPTE0 Enabled.
  161. * |[9] |CAP1RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE1 Enable Bit
  162. * | | |0 = The reload triggered by Event CAPTE1 Disabled.
  163. * | | |1 = The reload triggered by Event CAPTE1 Enabled.
  164. * |[10] |CAP2RLDEN |Capture Counteru2019s Reload Function Triggered by Event CAPTE2 Enable Bit
  165. * | | |0 = The reload triggered by Event CAPTE2 Disabled.
  166. * | | |1 = The reload triggered by Event CAPTE2 Enabled.
  167. * |[11] |OVRLDEN |Capture Counteru2019s Reload Function Triggered by Overflow Enable Bit
  168. * | | |0 = The reload triggered by CAPOV Disabled.
  169. * | | |1 = The reload triggered by CAPOV Enabled.
  170. * |[14:12] |CLKSEL |Capture Timer Clock Divide Selection
  171. * | | |The capture timer clock has a pre-divider with eight divided options controlled by CLKSEL[2:0].
  172. * | | |000 = CAP_CLK/1.
  173. * | | |001 = CAP_CLK/4.
  174. * | | |010 = CAP_CLK/16.
  175. * | | |011 = CAP_CLK/32.
  176. * | | |100 = CAP_CLK/64.
  177. * | | |101 = CAP_CLK/96.
  178. * | | |110 = CAP_CLK/112.
  179. * | | |111 = CAP_CLK/128.
  180. * |[17:16] |CNTSRCSEL |Capture Timer/Counter Clock Source Selection
  181. * | | |Select the capture timer/counter clock source.
  182. * | | |00 = CAP_CLK (default).
  183. * | | |01 = CAP0.
  184. * | | |10 = CAP1.
  185. * | | |11 = CAP2.
  186. * |[20] |CAP0CLREN |Capture Counter Cleared by Capture Event0 Control
  187. * | | |0 = Event CAPTE0 can clear capture counter (ECAP_CNT) Disabled.
  188. * | | |1 = Event CAPTE0 can clear capture counter (ECAP_CNT) Enabled.
  189. * |[21] |CAP1CLREN |Capture Counter Cleared by Capture Event1 Control
  190. * | | |0 = Event CAPTE1 can clear capture counter (ECAP_CNT) Disabled.
  191. * | | |1 = Event CAPTE1 can clear capture counter (ECAP_CNT) Enabled.
  192. * |[22] |CAP2CLREN |Capture Counter Cleared by Capture Event2 Control
  193. * | | |0 = Event CAPTE2 can clear capture counter (ECAP_CNT) Disabled.
  194. * | | |1 = Event CAPTE2 can clear capture counter (ECAP_CNT) Enabled.
  195. * @var ECAP_T::STATUS
  196. * Offset: 0x1C Input Capture Status Register
  197. * ---------------------------------------------------------------------------------------------------
  198. * |Bits |Field |Descriptions
  199. * | :----: | :----: | :---- |
  200. * |[0] |CAPTF0 |Input Capture Channel 0 Triggered Flag
  201. * | | |When the input capture channel 0 detects a valid edge change at CAP0 input, it will set flag CAPTF0 to high.
  202. * | | |0 = No valid edge change has been detected at CAP0 input since last clear.
  203. * | | |1 = At least a valid edge change has been detected at CAP0 input since last clear.
  204. * | | |Note: This bit is only cleared by writing 1 to it.
  205. * |[1] |CAPTF1 |Input Capture Channel 1 Triggered Flag
  206. * | | |When the input capture channel 1 detects a valid edge change at CAP1 input, it will set flag CAPTF1 to high.
  207. * | | |0 = No valid edge change has been detected at CAP1 input since last clear.
  208. * | | |1 = At least a valid edge change has been detected at CAP1 input since last clear.
  209. * | | |Note: This bit is only cleared by writing 1 to it.
  210. * |[2] |CAPTF2 |Input Capture Channel 2 Triggered Flag
  211. * | | |When the input capture channel 2 detects a valid edge change at CAP2 input, it will set flag CAPTF2 to high.
  212. * | | |0 = No valid edge change has been detected at CAP2 input since last clear.
  213. * | | |1 = At least a valid edge change has been detected at CAP2 input since last clear.
  214. * | | |Note: This bit is only cleared by writing 1 to it.
  215. * |[4] |CAPCMPF |Input Capture Compare-match Flag
  216. * | | |If the input capture compare function is enabled, the flag is set by hardware when capture counter (ECAP_CNT) up counts and reaches the ECAP_CNTCMP value.
  217. * | | |0 = ECAP_CNT has not matched ECAP_CNTCMP value since last clear.
  218. * | | |1 = ECAP_CNT has matched ECAP_CNTCMP value at least once since last clear.
  219. * | | |Note: This bit is only cleared by writing 1 to it.
  220. * |[5] |CAPOVF |Input Capture Counter Overflow Flag
  221. * | | |Flag is set by hardware when counter (ECAP_CNT) overflows from 0x00FF_FFFF to zero.
  222. * | | |0 = No overflow event has occurred since last clear.
  223. * | | |1 = Overflow event(s) has/have occurred since last clear.
  224. * | | |Note: This bit is only cleared by writing 1 to it.
  225. * |[6] |CAP0 |Value of Input Channel 0, CAP0 (Read Only)
  226. * | | |Reflecting the value of input channel 0, CAP0
  227. * | | |(The bit is read only and write is ignored)
  228. * |[7] |CAP1 |Value of Input Channel 1, CAP1 (Read Only)
  229. * | | |Reflecting the value of input channel 1, CAP1
  230. * | | |(The bit is read only and write is ignored)
  231. * |[8] |CAP2 |Value of Input Channel 2, CAP2 (Read Only)
  232. * | | |Reflecting the value of input channel 2, CAP2.
  233. * | | |(The bit is read only and write is ignored)
  234. */
  235. __IO uint32_t CNT; /*!< [0x0000] Input Capture Counter */
  236. __IO uint32_t HLD0; /*!< [0x0004] Input Capture Hold Register 0 */
  237. __IO uint32_t HLD1; /*!< [0x0008] Input Capture Hold Register 1 */
  238. __IO uint32_t HLD2; /*!< [0x000c] Input Capture Hold Register 2 */
  239. __IO uint32_t CNTCMP; /*!< [0x0010] Input Capture Compare Register */
  240. __IO uint32_t CTL0; /*!< [0x0014] Input Capture Control Register 0 */
  241. __IO uint32_t CTL1; /*!< [0x0018] Input Capture Control Register 1 */
  242. __IO uint32_t STATUS; /*!< [0x001c] Input Capture Status Register */
  243. } ECAP_T;
  244. /**
  245. @addtogroup ECAP_CONST ECAP Bit Field Definition
  246. Constant Definitions for ECAP Controller
  247. @{ */
  248. #define ECAP_CNT_CNT_Pos (0) /*!< ECAP_T::CNT: CNT Position */
  249. #define ECAP_CNT_CNT_Msk (0xfffffful << ECAP_CNT_CNT_Pos) /*!< ECAP_T::CNT: CNT Mask */
  250. #define ECAP_HLD0_HOLD_Pos (0) /*!< ECAP_T::HLD0: HOLD Position */
  251. #define ECAP_HLD0_HOLD_Msk (0xfffffful << ECAP_HLD0_HOLD_Pos) /*!< ECAP_T::HLD0: HOLD Mask */
  252. #define ECAP_HLD1_HOLD_Pos (0) /*!< ECAP_T::HLD1: HOLD Position */
  253. #define ECAP_HLD1_HOLD_Msk (0xfffffful << ECAP_HLD1_HOLD_Pos) /*!< ECAP_T::HLD1: HOLD Mask */
  254. #define ECAP_HLD2_HOLD_Pos (0) /*!< ECAP_T::HLD2: HOLD Position */
  255. #define ECAP_HLD2_HOLD_Msk (0xfffffful << ECAP_HLD2_HOLD_Pos) /*!< ECAP_T::HLD2: HOLD Mask */
  256. #define ECAP_CNTCMP_CNTCMP_Pos (0) /*!< ECAP_T::CNTCMP: CNTCMP Position */
  257. #define ECAP_CNTCMP_CNTCMP_Msk (0xfffffful << ECAP_CNTCMP_CNTCMP_Pos) /*!< ECAP_T::CNTCMP: CNTCMP Mask */
  258. #define ECAP_CTL0_NFCLKSEL_Pos (0) /*!< ECAP_T::CTL0: NFCLKSEL Position */
  259. #define ECAP_CTL0_NFCLKSEL_Msk (0x7ul << ECAP_CTL0_NFCLKSEL_Pos) /*!< ECAP_T::CTL0: NFCLKSEL Mask */
  260. #define ECAP_CTL0_CAPNFDIS_Pos (3) /*!< ECAP_T::CTL0: CAPNFDIS Position */
  261. #define ECAP_CTL0_CAPNFDIS_Msk (0x1ul << ECAP_CTL0_CAPNFDIS_Pos) /*!< ECAP_T::CTL0: CAPNFDIS Mask */
  262. #define ECAP_CTL0_IC0EN_Pos (4) /*!< ECAP_T::CTL0: IC0EN Position */
  263. #define ECAP_CTL0_IC0EN_Msk (0x1ul << ECAP_CTL0_IC0EN_Pos) /*!< ECAP_T::CTL0: IC0EN Mask */
  264. #define ECAP_CTL0_IC1EN_Pos (5) /*!< ECAP_T::CTL0: IC1EN Position */
  265. #define ECAP_CTL0_IC1EN_Msk (0x1ul << ECAP_CTL0_IC1EN_Pos) /*!< ECAP_T::CTL0: IC1EN Mask */
  266. #define ECAP_CTL0_IC2EN_Pos (6) /*!< ECAP_T::CTL0: IC2EN Position */
  267. #define ECAP_CTL0_IC2EN_Msk (0x1ul << ECAP_CTL0_IC2EN_Pos) /*!< ECAP_T::CTL0: IC2EN Mask */
  268. #define ECAP_CTL0_CAPSEL0_Pos (8) /*!< ECAP_T::CTL0: CAPSEL0 Position */
  269. #define ECAP_CTL0_CAPSEL0_Msk (0x3ul << ECAP_CTL0_CAPSEL0_Pos) /*!< ECAP_T::CTL0: CAPSEL0 Mask */
  270. #define ECAP_CTL0_CAPSEL1_Pos (10) /*!< ECAP_T::CTL0: CAPSEL1 Position */
  271. #define ECAP_CTL0_CAPSEL1_Msk (0x3ul << ECAP_CTL0_CAPSEL1_Pos) /*!< ECAP_T::CTL0: CAPSEL1 Mask */
  272. #define ECAP_CTL0_CAPSEL2_Pos (12) /*!< ECAP_T::CTL0: CAPSEL2 Position */
  273. #define ECAP_CTL0_CAPSEL2_Msk (0x3ul << ECAP_CTL0_CAPSEL2_Pos) /*!< ECAP_T::CTL0: CAPSEL2 Mask */
  274. #define ECAP_CTL0_CAPIEN0_Pos (16) /*!< ECAP_T::CTL0: CAPIEN0 Position */
  275. #define ECAP_CTL0_CAPIEN0_Msk (0x1ul << ECAP_CTL0_CAPIEN0_Pos) /*!< ECAP_T::CTL0: CAPIEN0 Mask */
  276. #define ECAP_CTL0_CAPIEN1_Pos (17) /*!< ECAP_T::CTL0: CAPIEN1 Position */
  277. #define ECAP_CTL0_CAPIEN1_Msk (0x1ul << ECAP_CTL0_CAPIEN1_Pos) /*!< ECAP_T::CTL0: CAPIEN1 Mask */
  278. #define ECAP_CTL0_CAPIEN2_Pos (18) /*!< ECAP_T::CTL0: CAPIEN2 Position */
  279. #define ECAP_CTL0_CAPIEN2_Msk (0x1ul << ECAP_CTL0_CAPIEN2_Pos) /*!< ECAP_T::CTL0: CAPIEN2 Mask */
  280. #define ECAP_CTL0_OVIEN_Pos (20) /*!< ECAP_T::CTL0: OVIEN Position */
  281. #define ECAP_CTL0_OVIEN_Msk (0x1ul << ECAP_CTL0_OVIEN_Pos) /*!< ECAP_T::CTL0: OVIEN Mask */
  282. #define ECAP_CTL0_CMPIEN_Pos (21) /*!< ECAP_T::CTL0: CMPIEN Position */
  283. #define ECAP_CTL0_CMPIEN_Msk (0x1ul << ECAP_CTL0_CMPIEN_Pos) /*!< ECAP_T::CTL0: CMPIEN Mask */
  284. #define ECAP_CTL0_CNTEN_Pos (24) /*!< ECAP_T::CTL0: CNTEN Position */
  285. #define ECAP_CTL0_CNTEN_Msk (0x1ul << ECAP_CTL0_CNTEN_Pos) /*!< ECAP_T::CTL0: CNTEN Mask */
  286. #define ECAP_CTL0_CMPCLREN_Pos (25) /*!< ECAP_T::CTL0: CMPCLREN Position */
  287. #define ECAP_CTL0_CMPCLREN_Msk (0x1ul << ECAP_CTL0_CMPCLREN_Pos) /*!< ECAP_T::CTL0: CMPCLREN Mask */
  288. #define ECAP_CTL0_CMPEN_Pos (28) /*!< ECAP_T::CTL0: CMPEN Position */
  289. #define ECAP_CTL0_CMPEN_Msk (0x1ul << ECAP_CTL0_CMPEN_Pos) /*!< ECAP_T::CTL0: CMPEN Mask */
  290. #define ECAP_CTL0_CAPEN_Pos (29) /*!< ECAP_T::CTL0: CAPEN Position */
  291. #define ECAP_CTL0_CAPEN_Msk (0x1ul << ECAP_CTL0_CAPEN_Pos) /*!< ECAP_T::CTL0: CAPEN Mask */
  292. #define ECAP_CTL1_EDGESEL0_Pos (0) /*!< ECAP_T::CTL1: EDGESEL0 Position */
  293. #define ECAP_CTL1_EDGESEL0_Msk (0x3ul << ECAP_CTL1_EDGESEL0_Pos) /*!< ECAP_T::CTL1: EDGESEL0 Mask */
  294. #define ECAP_CTL1_EDGESEL1_Pos (2) /*!< ECAP_T::CTL1: EDGESEL1 Position */
  295. #define ECAP_CTL1_EDGESEL1_Msk (0x3ul << ECAP_CTL1_EDGESEL1_Pos) /*!< ECAP_T::CTL1: EDGESEL1 Mask */
  296. #define ECAP_CTL1_EDGESEL2_Pos (4) /*!< ECAP_T::CTL1: EDGESEL2 Position */
  297. #define ECAP_CTL1_EDGESEL2_Msk (0x3ul << ECAP_CTL1_EDGESEL2_Pos) /*!< ECAP_T::CTL1: EDGESEL2 Mask */
  298. #define ECAP_CTL1_CAP0RLDEN_Pos (8) /*!< ECAP_T::CTL1: CAP0RLDEN Position */
  299. #define ECAP_CTL1_CAP0RLDEN_Msk (0x1ul << ECAP_CTL1_CAP0RLDEN_Pos) /*!< ECAP_T::CTL1: CAP0RLDEN Mask */
  300. #define ECAP_CTL1_CAP1RLDEN_Pos (9) /*!< ECAP_T::CTL1: CAP1RLDEN Position */
  301. #define ECAP_CTL1_CAP1RLDEN_Msk (0x1ul << ECAP_CTL1_CAP1RLDEN_Pos) /*!< ECAP_T::CTL1: CAP1RLDEN Mask */
  302. #define ECAP_CTL1_CAP2RLDEN_Pos (10) /*!< ECAP_T::CTL1: CAP2RLDEN Position */
  303. #define ECAP_CTL1_CAP2RLDEN_Msk (0x1ul << ECAP_CTL1_CAP2RLDEN_Pos) /*!< ECAP_T::CTL1: CAP2RLDEN Mask */
  304. #define ECAP_CTL1_OVRLDEN_Pos (11) /*!< ECAP_T::CTL1: OVRLDEN Position */
  305. #define ECAP_CTL1_OVRLDEN_Msk (0x1ul << ECAP_CTL1_OVRLDEN_Pos) /*!< ECAP_T::CTL1: OVRLDEN Mask */
  306. #define ECAP_CTL1_CLKSEL_Pos (12) /*!< ECAP_T::CTL1: CLKSEL Position */
  307. #define ECAP_CTL1_CLKSEL_Msk (0x7ul << ECAP_CTL1_CLKSEL_Pos) /*!< ECAP_T::CTL1: CLKSEL Mask */
  308. #define ECAP_CTL1_CNTSRCSEL_Pos (16) /*!< ECAP_T::CTL1: CNTSRCSEL Position */
  309. #define ECAP_CTL1_CNTSRCSEL_Msk (0x3ul << ECAP_CTL1_CNTSRCSEL_Pos) /*!< ECAP_T::CTL1: CNTSRCSEL Mask */
  310. #define ECAP_CTL1_CAP0CLREN_Pos (20) /*!< ECAP_T::CTL1: CAP0CLREN Position */
  311. #define ECAP_CTL1_CAP0CLREN_Msk (0x1ul << ECAP_CTL1_CAP0CLREN_Pos) /*!< ECAP_T::CTL1: CAP0CLREN Mask */
  312. #define ECAP_CTL1_CAP1CLREN_Pos (21) /*!< ECAP_T::CTL1: CAP1CLREN Position */
  313. #define ECAP_CTL1_CAP1CLREN_Msk (0x1ul << ECAP_CTL1_CAP1CLREN_Pos) /*!< ECAP_T::CTL1: CAP1CLREN Mask */
  314. #define ECAP_CTL1_CAP2CLREN_Pos (22) /*!< ECAP_T::CTL1: CAP2CLREN Position */
  315. #define ECAP_CTL1_CAP2CLREN_Msk (0x1ul << ECAP_CTL1_CAP2CLREN_Pos) /*!< ECAP_T::CTL1: CAP2CLREN Mask */
  316. #define ECAP_STATUS_CAPTF0_Pos (0) /*!< ECAP_T::STATUS: CAPTF0 Position */
  317. #define ECAP_STATUS_CAPTF0_Msk (0x1ul << ECAP_STATUS_CAPTF0_Pos) /*!< ECAP_T::STATUS: CAPTF0 Mask */
  318. #define ECAP_STATUS_CAPTF1_Pos (1) /*!< ECAP_T::STATUS: CAPTF1 Position */
  319. #define ECAP_STATUS_CAPTF1_Msk (0x1ul << ECAP_STATUS_CAPTF1_Pos) /*!< ECAP_T::STATUS: CAPTF1 Mask */
  320. #define ECAP_STATUS_CAPTF2_Pos (2) /*!< ECAP_T::STATUS: CAPTF2 Position */
  321. #define ECAP_STATUS_CAPTF2_Msk (0x1ul << ECAP_STATUS_CAPTF2_Pos) /*!< ECAP_T::STATUS: CAPTF2 Mask */
  322. #define ECAP_STATUS_CAPCMPF_Pos (4) /*!< ECAP_T::STATUS: CAPCMPF Position */
  323. #define ECAP_STATUS_CAPCMPF_Msk (0x1ul << ECAP_STATUS_CAPCMPF_Pos) /*!< ECAP_T::STATUS: CAPCMPF Mask */
  324. #define ECAP_STATUS_CAPOVF_Pos (5) /*!< ECAP_T::STATUS: CAPOVF Position */
  325. #define ECAP_STATUS_CAPOVF_Msk (0x1ul << ECAP_STATUS_CAPOVF_Pos) /*!< ECAP_T::STATUS: CAPOVF Mask */
  326. #define ECAP_STATUS_CAP0_Pos (8) /*!< ECAP_T::STATUS: CAP0 Position */
  327. #define ECAP_STATUS_CAP0_Msk (0x1ul << ECAP_STATUS_CAP0_Pos) /*!< ECAP_T::STATUS: CAP0 Mask */
  328. #define ECAP_STATUS_CAP1_Pos (9) /*!< ECAP_T::STATUS: CAP1 Position */
  329. #define ECAP_STATUS_CAP1_Msk (0x1ul << ECAP_STATUS_CAP1_Pos) /*!< ECAP_T::STATUS: CAP1 Mask */
  330. #define ECAP_STATUS_CAP2_Pos (10) /*!< ECAP_T::STATUS: CAP2 Position */
  331. #define ECAP_STATUS_CAP2_Msk (0x1ul << ECAP_STATUS_CAP2_Pos) /*!< ECAP_T::STATUS: CAP2 Mask */
  332. /**@}*/ /* ECAP_CONST */
  333. /**@}*/ /* end of ECAP register group */
  334. /**@}*/ /* end of REGISTER group */
  335. #if defined ( __CC_ARM )
  336. #pragma no_anon_unions
  337. #endif
  338. #endif /* __ECAP_REG_H__ */