1 /**************************************************************************//** 2 * @file eqei_reg.h 3 * @version V1.00 4 * @brief EQEI 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 __EQEI_REG_H__ 10 #define __EQEI_REG_H__ 11 12 #if defined ( __CC_ARM ) 13 #pragma anon_unions 14 #endif 15 16 /** 17 @addtogroup REGISTER Control Register 18 @{ 19 */ 20 21 /*---------------------- Enhanced Quadrature Encoder Interface(EQEI) -------------------------*/ 22 /** 23 @addtogroup EQEI Enhanced Quadrature Encoder Interface(EQEI) 24 Memory Mapped Structure for EQEI Controller 25 @{ */ 26 27 typedef struct 28 { 29 30 31 /** 32 * @var EQEI_T::CNT 33 * Offset: 0x00 EQEI Counter Register 34 * --------------------------------------------------------------------------------------------------- 35 * |Bits |Field |Descriptions 36 * | :----: | :----: | :---- | 37 * |[31:0] |CNT |Enhanced Quadrature Encoder Interface Counter 38 * | | |A 32-bit up/down counter 39 * | | |When an effective phase pulse is detected, this counter is increased by one if the bit DIRF (EQEI_STATUS[8]) is one or decreased by one if the bit DIRF(EQEI_STATUS[8]) is 0 40 * | | |This register performs an integrator which count value is proportional to the encoder position 41 * | | |The pulse counter may be initialized to a predetermined value when one of the following events occur: 42 * | | |1. Software is written if EQEIEN (EQEI_CTL[29]) = 0. 43 * | | |2. Compare-match event if EQEIEN(EQEI_CTL[29])=1 and EQEI is in compare-counting mode. 44 * | | |3. Index signal change if EQEIEN(EQEI_CTL[29])=1 and IDXRLDEN (EQEI_CTL[27])=1. 45 * @var EQEI_T::CNTHOLD 46 * Offset: 0x04 EQEI Counter Hold Register 47 * --------------------------------------------------------------------------------------------------- 48 * |Bits |Field |Descriptions 49 * | :----: | :----: | :---- | 50 * |[31:0] |CNTHOLD |Enhanced Quadrature Encoder Interface Counter Hold 51 * | | |When the bit HOLDCNT (EQEI_CTL[24]) goes from low to high, the CNT(EQEI_CNT[31:0]) is copied into CNTHOLD (EQEI_CNTHOLD[31:0]) register. 52 * @var EQEI_T::CNTLATCH 53 * Offset: 0x08 EQEI Counter Index Latch Register 54 * --------------------------------------------------------------------------------------------------- 55 * |Bits |Field |Descriptions 56 * | :----: | :----: | :---- | 57 * |[31:0] |CNTLATCH |Enhanced Quadrature Encoder Interface Counter Index Latch 58 * | | |When the IDXF (EQEI_STATUS[0]) bit is set, the CNT(EQEI_CNT[31:0]) is copied into CNTLATCH (EQEI_CNTLATCH[31:0]) register. 59 * @var EQEI_T::CNTCMP 60 * Offset: 0x0C EQEI Counter Compare Register 61 * --------------------------------------------------------------------------------------------------- 62 * |Bits |Field |Descriptions 63 * | :----: | :----: | :---- | 64 * |[31:0] |CNTCMP |Enhanced Quadrature Encoder Interface Counter Compare 65 * | | |If the EQEI controller is in the compare-counting mode CMPEN (EQEI_CTL[28]) =1, when the value of CNT(EQEI_CNT[31:0]) matches CNTCMP(EQEI_CNTCMP[31:0]), CMPF will be set 66 * | | |This register is software writable. 67 * @var EQEI_T::CNTMAX 68 * Offset: 0x14 EQEI Pre-set Maximum Count Register 69 * --------------------------------------------------------------------------------------------------- 70 * |Bits |Field |Descriptions 71 * | :----: | :----: | :---- | 72 * |[31:0] |CNTMAX |Enhanced Quadrature Encoder Interface Preset Maximum Count 73 * | | |This register value determined by user stores the maximum value which may be the number of the EQEI counter for the EQEI controller compare-counting mode 74 * @var EQEI_T::CTL 75 * Offset: 0x18 EQEI Controller Control Register 76 * --------------------------------------------------------------------------------------------------- 77 * |Bits |Field |Descriptions 78 * | :----: | :----: | :---- | 79 * |[2:0] |NFCLKSEL |Noise Filter Clock Pre-divide Selection 80 * | | |To determine the sampling frequency of the Noise Filter clock. 81 * | | |000 = EQEI_CLK. 82 * | | |001 = EQEI_CLK/2. 83 * | | |010 = EQEI_CLK/4. 84 * | | |011 = EQEI_CLK/16. 85 * | | |100 = EQEI_CLK/32. 86 * | | |101 = EQEI_CLK/64. 87 * | | |110 = reserved. 88 * | | |111 = reserved. 89 * |[3] |NFDIS |EQEI Controller Input Noise Filter Disable Bit 90 * | | |0 = The noise filter of EQEI controller Enabled. 91 * | | |1 = The noise filter of EQEI controller Disabled. 92 * |[4] |CHAEN |QEA Input to EQEI Controller Enable Bit 93 * | | |0 = QEA input to EQEI Controller Disabled. 94 * | | |1 = QEA input to EQEI Controller Enabled. 95 * |[5] |CHBEN |QEB Input to EQEI Controller Enable Bit 96 * | | |0 = QEB input to EQEI Controller Disabled. 97 * | | |1 = QEB input to EQEI Controller Enabled. 98 * |[6] |IDXEN |IDX Input to EQEI Controller Enable Bit 99 * | | |0 = IDX input to EQEI Controller Disabled. 100 * | | |1 = IDX input to EQEI Controller Enabled. 101 * |[7] |IDXRSTEN |IDX Reset EQEI Position Counter Enable Bit 102 * | | |0 = Reset EQEI position counter in every time IDX signal. 103 * | | |1 = Reset EQEI position counter in first time IDX signal. 104 * | | |Note: IDXRLDEN(EQEI_CTL[27]) should be set 1. 105 * |[10:8] |MODE |EQEI Counting Mode Selection 106 * | | |There are seven quadrature encoder pulse counter operation modes. 107 * | | |000 = X4 Free-counting Mode. 108 * | | |001 = X2 Free-counting Mode. 109 * | | |010 = X4 Compare-counting Mode. 110 * | | |011 = X2 Compare-counting Mode. 111 * | | |100 = Phase Counting Mode Type 1. (PCMT1). 112 * | | |101 = Phase Counting Mode Type 2. (PCMT2). 113 * | | |110 = Directional Counting Mode. 114 * | | |111 = Reserved. 115 * | | |Note: User needs to set DIRSRC(EQEI_CTL2[5:4]) when MODE(EQEI_CTL[10:8]) selects to directional counting mode 116 * |[12] |CHAINV |Inverse QEA Input Polarity 117 * | | |0 = Not inverse QEA input polarity. 118 * | | |1 = QEA input polarity is inversed to EQEI controller. 119 * |[13] |CHBINV |Inverse QEB Input Polarity 120 * | | |0 = Not inverse QEB input polarity. 121 * | | |1 = QEB input polarity is inversed to EQEI controller. 122 * |[14] |IDXINV |Inverse IDX Input Polarity 123 * | | |0 = Not inverse IDX input polarity. 124 * | | |1 = IDX input polarity is inversed to EQEI controller. 125 * |[15] |IDXRSTEV |IDX Signal Resets Enable Bit in First IDX Reset Event (Write Only) 126 * | | |0 = The next IDX level high signal reset function Disabled. 127 * | | |1 = The next IDX level high signal reset function Eenabled. 128 * | | |Note: This bit is only effective when IDXRSTEN (EQEI_CTL[7])=1 and IDXRLDEN (EQEI_CTL[27]) = 1. 129 * |[16] |OVUNIEN |OVUNF Trigger EQEI Interrupt Enable Bit 130 * | | |0 = OVUNF can trigger EQEI controller interrupt Disabled. 131 * | | |1 = OVUNF can trigger EQEI controller interrupt Enabled. 132 * |[17] |DIRIEN |DIRCHGF Trigger EQEI Interrupt Enable Bit 133 * | | |0 = DIRCHGF can trigger EQEI controller interrupt Disabled. 134 * | | |1 = DIRCHGF can trigger EQEI controller interrupt Enabled. 135 * |[18] |CMPIEN |CMPF Trigger EQEI Interrupt Enable Bit 136 * | | |0 = CMPF can trigger EQEI controller interrupt Disabled. 137 * | | |1 = CMPF can trigger EQEI controller interrupt Enabled. 138 * |[19] |IDXIEN |IDXF Trigger EQEI Interrupt Enable Bit 139 * | | |0 = The IDXF can trigger EQEI interrupt Disabled. 140 * | | |1 = The IDXF can trigger EQEI interrupt Enabled. 141 * |[20] |HOLDTMR0 |Hold EQEI_CNT by Timer 0 142 * | | |0 = TIF (TIMER0_INTSTS[0]) has no effect on HOLDCNT. 143 * | | |1 = A rising edge of bit TIF(TIMER0_INTSTS[0]) in timer 0 sets HOLDCNT to 1. 144 * |[21] |HOLDTMR1 |Hold EQEI_CNT by Timer 1 145 * | | |0 = TIF(TIMER1_INTSTS[0]) has no effect on HOLDCNT. 146 * | | |1 = A rising edge of bit TIF (TIMER1_INTSTS[0]) in timer 1 sets HOLDCNT to 1. 147 * |[22] |HOLDTMR2 |Hold EQEI_CNT by Timer 2 148 * | | |0 = TIF(TIMER2_INTSTS[0]) has no effect on HOLDCNT. 149 * | | |1 = A rising edge of bit TIF(TIMER2_INTSTS[0]) in timer 2 sets HOLDCNT to 1. 150 * |[23] |HOLDTMR3 |Hold EQEI_CNT by Timer 3 151 * | | |0 = TIF (TIMER3_INTSTS[0]) has no effect on HOLDCNT. 152 * | | |1 = A rising edge of bit TIF(TIMER3_INTSTS[0]) in timer 3 sets HOLDCNT to 1. 153 * |[24] |HOLDCNT |Hold EQEI_CNT Control 154 * | | |When this bit is set from low to high, the CNT(EQEI_CNT[31:0]) is copied into CNTHOLD(EQEI_CNTHOLD[31:0]) 155 * | | |This bit may be set by writing 1 to it or Timer0~Timer3 interrupt flag TIF (TIMERx_INTSTS[0]). 156 * | | |0 = No operation. 157 * | | |1 = EQEI_CNT content is captured and stored in CNTHOLD(EQEI_CNTHOLD[31:0]). 158 * | | |Note: This bit is automatically cleared after EQEI_CNTHOLD holds EQEI_CNT value. 159 * |[25] |IDXLATEN |Index Latch EQEI_CNT Enable Bit 160 * | | |If this bit is set to high, the CNT(EQEI_CNT[31:0]) content will be latched into CNTLATCH (EQEI_CNTLATCH[31:0]) at every rising on signal CHX. 161 * | | |0 = The index signal latch EQEI counter function Disabled. 162 * | | |1 = The index signal latch EQEI counter function Enabled. 163 * |[27] |IDXRLDEN |Index Trigger EQEI_CNT Reload Enable Bit 164 * | | |When this bit is high and a rising edge comes on signal CHX, the CNT(EQEI_CNT[31:0]) will be reset to 0 if the counter is in up-counting type (DIRF(EQEI_STATUS[8]) = 1); while the CNT(EQEI_CNT[31:0]) will be reloaded with CNTMAX (EQEI_CNTMAX[31:0]) content if the counter is in down-counting type (DIRF(EQEI_STATUS[8]) = 0). 165 * | | |0 = Reload function Disabled. 166 * | | |1 = EQEI_CNT re-initialized by Index signal Enabled. 167 * |[28] |CMPEN |The Compare Function Enable Bit 168 * | | |The compare function in EQEI controller is to compare the dynamic counting EQEI_CNT with the compare register CNTCMP( EQEI_CNTCMP[31:0]), if CNT(EQEI_CNT[31:0]) reaches CNTCMP( EQEI_CNTCMP[31:0]), the flag CMPF will be set. 169 * | | |0 = Compare function Disabled. 170 * | | |1 = Compare function Enabled. 171 * |[29] |EQEIEN |Enhanced Quadrature Encoder Interface Controller Enable Bit 172 * | | |0 = EQEI controller function Disabled. 173 * | | |1 = EQEI controller function Enabled. 174 * @var EQEI_T::CTL2 175 * Offset: 0x1C EQEI Controller Control Register2 176 * --------------------------------------------------------------------------------------------------- 177 * |Bits |Field |Descriptions 178 * | :----: | :----: | :---- | 179 * |[0] |SWAPEN |Swap Function Enable Bit 180 * | | |0 = EQEI swap function Disabled. 181 * | | |1 = EQEI swap function Enabled. 182 * |[2:1] |CRS |Clock Rate Setting without Quadrature Mode 183 * | | |00 = EQEI counter only counts the falling edge. 184 * | | |01 = EQEI counter only counts the rising edge. 185 * | | |10 = EQEI counter counts the rising and falling edge. 186 * | | |11 = reserved. 187 * |[5:4] |DIRSRC |Direction Signal Source Select 188 * | | |00 = Direction signal is determined from EQEI system calculation. 189 * | | |01 = reserved. 190 * | | |10 = Direction signal is tied 1 only for direction up count mode. 191 * | | |11 = Direction signal is tied 0 only for down count mode. 192 * |[8] |UTEN |Unit Timer Function Enable Bit 193 * | | |0 = EQEI unit timer function Disabled. 194 * | | |1 = EQEI unit timer function Enabled. 195 * |[9] |UTHOLDEN |Unit Timer Counter Hold Enable Bit 196 * | | |0 = No operation. 197 * | | |1 = EQEI_CNT content is captured and stored in CNTHOLD(EQEI_CNTHOLD[31:0]) when UTCNT matches UTCMP(EQEI_UTCMP[31:0]). 198 * |[10] |UTEVTRST |Enable Bit to Reset EQEI Position Counter by Unit Timer Event 199 * | | |0 = Reset EQEI position counter feature when unit timer counter event occurs Disabled. 200 * | | |1 = Reset EQEI position counter feature when unit timer counter event occurs Enabled. 201 * |[11] |IDXRSTUTS |IDX Resets Unit Timer Select Bit 202 * | | |0 = Unit timer will not be reset when IDX reset event happens. 203 * | | |1 = Resets unit timer or not will follow EQEI_CNT when IDX reset event happens. 204 * |[16] |PHEIEN |PHEF Trigger EQEI Interrupt Enable Bit 205 * | | |0 = PHEF can trigger EQEI controller interrupt Disabled. 206 * | | |1 = PHEF can trigger EQEI controller interrupt Enabled. 207 * |[17] |UTIEIEN |UTIEF Trigger EQEI Interrupt Enable Bit 208 * | | |0 = UTIEF can trigger EQEI controller interrupt Disabled. 209 * | | |1 = UTIEF can trigger EQEI controller interrupt Enabled. 210 * @var EQEI_T::UTCNT 211 * Offset: 0x20 EQEI Unit Timer Counter Register 212 * --------------------------------------------------------------------------------------------------- 213 * |Bits |Field |Descriptions 214 * | :----: | :----: | :---- | 215 * |[31:0] |UTCNT |Unit Timer Counter 216 * | | |A 32-bit unit timer counter which may be reset to an initial value when any of the following events occur: 217 * | | |1. Software is written if UTEN (EQEI_CTL2[8]) = 0. 218 * | | |2. UT_EN (EQEI_CTL2[8]) =1, and the unit timer counter value matches UTCMP(EQEI_UTCMP[31:0]). 219 * | | |3. IDXRLDEN(EQEI_CTL[27]) =1 and IDXRSTUTS(EQEI_CTL2[11]=1, determine the unit timer to be reset or not will follow EQEI_CNT when IDX reset event happens. 220 * @var EQEI_T::UTCMP 221 * Offset: 0x24 EQEI Unit Timer Compare Register 222 * --------------------------------------------------------------------------------------------------- 223 * |Bits |Field |Descriptions 224 * | :----: | :----: | :---- | 225 * |[31:0] |UTCMP |Unit Timer Counter Compare 226 * | | |If the EQEI unit timer is enabled (EQEI_CTL2[8]) =1, and the unit timer counter value also matches UTCMP(EQEI_UTCMP[31:0]), then UTIEF (EQEI_STATUS[10]) will be set 227 * | | |This register is software writable. 228 * @var EQEI_T::STATUS 229 * Offset: 0x2C EQEI Controller Status Register 230 * --------------------------------------------------------------------------------------------------- 231 * |Bits |Field |Descriptions 232 * | :----: | :----: | :---- | 233 * |[0] |IDXF |IDX Detected Flag 234 * | | |When the EQEI controller detects a rising edge on signal CHX it will set flag IDXF to high. 235 * | | |0 = No rising edge detected on signal CHX. 236 * | | |1 = A rising edge occurs on signal CHX. 237 * | | |Note: This bit is only cleared by writing 1 to it. 238 * |[1] |CMPF |Compare-match Flag 239 * | | |If the EQEI compare function is enabled, the flag is set by hardware while EQEI counter up or down counts and reach to the CNTCMP(EQEI_CNTCMP[31:0]). 240 * | | |0 = EQEI counter does not match with CNTCMP(EQEI_CNTCMP[31:0]). 241 * | | |1 = EQEI counter counts to the same as CNTCMP(EQEI_CNTCMP[31:0]). 242 * | | |Note: This bit is only cleared by writing 1 to it. 243 * |[2] |OVUNF |EQEI Counter Overflow or Underflow Flag 244 * | | |Flag is set by hardware while CNT(EQEI_CNT[31:0]) overflows from 0xFFFF_FFFF to 0 in free-counting mode or from the CNTMAX (EQEI_CNTMAX[31:0]) to 0 in compare-counting mode 245 * | | |Similarly, the flag is set while EQEI counter underflows from 0 to 0xFFFF_FFFF or CNTMAX (EQEI_CNTMAX[31:0]). 246 * | | |0 = No overflow or underflow occurs in EQEI counter. 247 * | | |1 = EQEI counter occurs counting overflow or underflow. 248 * | | |Note: This bit is only cleared by writing 1 to it. 249 * |[3] |DIRCHGF |Direction Change Flag 250 * | | |Flag is set by hardware while EQEI counter counting direction is changed 251 * | | |Software can clear this bit by writing 1 to it. 252 * | | |0 = No change in EQEI counter counting direction. 253 * | | |1 = EQEI counter counting direction is changed. 254 * | | |Note: This bit is only cleared by writing 1 to it. 255 * |[8] |DIRF |EQEI Counter Counting Direction Indication 256 * | | |0 = EQEI Counter is in down-counting. 257 * | | |1 = EQEI Counter is in up-counting. 258 * | | |Note: This bit is set/reset by hardware according to the phase detection between CHA and CHB. 259 * |[9] |FIDXEF |First IDX Signal Reset Event Flag (Read Only) 260 * | | |0 = The first IDX reset event has not happened yet. 261 * | | |1 = The first IDX reset event has happened. 262 * | | |Note: This bit only effective when IDXRSTEN (EQEI_CTL[7])=1 and IDXRLDEN (EQEI_CTL[27])=1. 263 * |[16] |PHEF |EQEI Phase Error Flag 264 * | | |0 = No Phase error occurs in EQEI CHA and CHB. 265 * | | |1 = Phase error occurs in EQEI CHA and CHB. 266 * | | |Note: This bit is only cleared by writing 1 to it. 267 * |[17] |UTIEF |EQEI Unit Timer Event Flag 268 * | | |0 = No timer event occurs in EQEI unit timer counter. 269 * | | |1 = Unit timer event occurs in EQEI unit timer counter. 270 * | | |Note: This bit is only cleared by writing 1 to it. 271 */ 272 __IO uint32_t CNT; /*!< [0x0000] EQEI Counter Register */ 273 __IO uint32_t CNTHOLD; /*!< [0x0004] EQEI Counter Hold Register */ 274 __IO uint32_t CNTLATCH; /*!< [0x0008] EQEI Counter Index Latch Register */ 275 __IO uint32_t CNTCMP; /*!< [0x000c] EQEI Counter Compare Register */ 276 __I uint32_t RESERVE0[1]; 277 __IO uint32_t CNTMAX; /*!< [0x0014] EQEI Pre-set Maximum Count Register */ 278 __IO uint32_t CTL; /*!< [0x0018] EQEI Controller Control Register */ 279 __IO uint32_t CTL2; /*!< [0x001c] EQEI Controller Control Register2 */ 280 __IO uint32_t UTCNT; /*!< [0x0020] EQEI Unit Timer Counter Register */ 281 __IO uint32_t UTCMP; /*!< [0x0024] EQEI Unit Timer Compare Register */ 282 __I uint32_t RESERVE1[1]; 283 __IO uint32_t STATUS; /*!< [0x002c] EQEI Controller Status Register */ 284 285 } EQEI_T; 286 287 /** 288 @addtogroup EQEI_CONST EQEI Bit Field Definition 289 Constant Definitions for EQEI Controller 290 @{ */ 291 292 #define EQEI_CNT_CNT_Pos (0) /*!< EQEI_T::CNT: CNT Position */ 293 #define EQEI_CNT_CNT_Msk (0xfffffffful << EQEI_CNT_CNT_Pos) /*!< EQEI_T::CNT: CNT Mask */ 294 295 #define EQEI_CNTHOLD_CNTHOLD_Pos (0) /*!< EQEI_T::CNTHOLD: CNTHOLD Position */ 296 #define EQEI_CNTHOLD_CNTHOLD_Msk (0xfffffffful << EQEI_CNTHOLD_CNTHOLD_Pos) /*!< EQEI_T::CNTHOLD: CNTHOLD Mask */ 297 298 #define EQEI_CNTLATCH_CNTLATCH_Pos (0) /*!< EQEI_T::CNTLATCH: CNTLATCH Position */ 299 #define EQEI_CNTLATCH_CNTLATCH_Msk (0xfffffffful << EQEI_CNTLATCH_CNTLATCH_Pos) /*!< EQEI_T::CNTLATCH: CNTLATCH Mask */ 300 301 #define EQEI_CNTCMP_CNTCMP_Pos (0) /*!< EQEI_T::CNTCMP: CNTCMP Position */ 302 #define EQEI_CNTCMP_CNTCMP_Msk (0xfffffffful << EQEI_CNTCMP_CNTCMP_Pos) /*!< EQEI_T::CNTCMP: CNTCMP Mask */ 303 304 #define EQEI_CNTMAX_CNTMAX_Pos (0) /*!< EQEI_T::CNTMAX: CNTMAX Position */ 305 #define EQEI_CNTMAX_CNTMAX_Msk (0xfffffffful << EQEI_CNTMAX_CNTMAX_Pos) /*!< EQEI_T::CNTMAX: CNTMAX Mask */ 306 307 #define EQEI_CTL_NFCLKSEL_Pos (0) /*!< EQEI_T::CTL: NFCLKSEL Position */ 308 #define EQEI_CTL_NFCLKSEL_Msk (0x7ul << EQEI_CTL_NFCLKSEL_Pos) /*!< EQEI_T::CTL: NFCLKSEL Mask */ 309 310 #define EQEI_CTL_NFDIS_Pos (3) /*!< EQEI_T::CTL: NFDIS Position */ 311 #define EQEI_CTL_NFDIS_Msk (0x1ul << EQEI_CTL_NFDIS_Pos) /*!< EQEI_T::CTL: NFDIS Mask */ 312 313 #define EQEI_CTL_CHAEN_Pos (4) /*!< EQEI_T::CTL: CHAEN Position */ 314 #define EQEI_CTL_CHAEN_Msk (0x1ul << EQEI_CTL_CHAEN_Pos) /*!< EQEI_T::CTL: CHAEN Mask */ 315 316 #define EQEI_CTL_CHBEN_Pos (5) /*!< EQEI_T::CTL: CHBEN Position */ 317 #define EQEI_CTL_CHBEN_Msk (0x1ul << EQEI_CTL_CHBEN_Pos) /*!< EQEI_T::CTL: CHBEN Mask */ 318 319 #define EQEI_CTL_IDXEN_Pos (6) /*!< EQEI_T::CTL: IDXEN Position */ 320 #define EQEI_CTL_IDXEN_Msk (0x1ul << EQEI_CTL_IDXEN_Pos) /*!< EQEI_T::CTL: IDXEN Mask */ 321 322 #define EQEI_CTL_IDXRSTEN_Pos (7) /*!< EQEI_T::CTL: IDXRSTEN Position */ 323 #define EQEI_CTL_IDXRSTEN_Msk (0x1ul << EQEI_CTL_IDXRSTEN_Pos) /*!< EQEI_T::CTL: IDXRSTEN Mask */ 324 325 #define EQEI_CTL_MODE_Pos (8) /*!< EQEI_T::CTL: MODE Position */ 326 #define EQEI_CTL_MODE_Msk (0x7ul << EQEI_CTL_MODE_Pos) /*!< EQEI_T::CTL: MODE Mask */ 327 328 #define EQEI_CTL_CHAINV_Pos (12) /*!< EQEI_T::CTL: CHAINV Position */ 329 #define EQEI_CTL_CHAINV_Msk (0x1ul << EQEI_CTL_CHAINV_Pos) /*!< EQEI_T::CTL: CHAINV Mask */ 330 331 #define EQEI_CTL_CHBINV_Pos (13) /*!< EQEI_T::CTL: CHBINV Position */ 332 #define EQEI_CTL_CHBINV_Msk (0x1ul << EQEI_CTL_CHBINV_Pos) /*!< EQEI_T::CTL: CHBINV Mask */ 333 334 #define EQEI_CTL_IDXINV_Pos (14) /*!< EQEI_T::CTL: IDXINV Position */ 335 #define EQEI_CTL_IDXINV_Msk (0x1ul << EQEI_CTL_IDXINV_Pos) /*!< EQEI_T::CTL: IDXINV Mask */ 336 337 #define EQEI_CTL_IDXRSTEV_Pos (15) /*!< EQEI_T::CTL: IDXRSTEV Position */ 338 #define EQEI_CTL_IDXRSTEV_Msk (0x1ul << EQEI_CTL_IDXRSTEV_Pos) /*!< EQEI_T::CTL: IDXRSTEV Mask */ 339 340 #define EQEI_CTL_OVUNIEN_Pos (16) /*!< EQEI_T::CTL: OVUNIEN Position */ 341 #define EQEI_CTL_OVUNIEN_Msk (0x1ul << EQEI_CTL_OVUNIEN_Pos) /*!< EQEI_T::CTL: OVUNIEN Mask */ 342 343 #define EQEI_CTL_DIRIEN_Pos (17) /*!< EQEI_T::CTL: DIRIEN Position */ 344 #define EQEI_CTL_DIRIEN_Msk (0x1ul << EQEI_CTL_DIRIEN_Pos) /*!< EQEI_T::CTL: DIRIEN Mask */ 345 346 #define EQEI_CTL_CMPIEN_Pos (18) /*!< EQEI_T::CTL: CMPIEN Position */ 347 #define EQEI_CTL_CMPIEN_Msk (0x1ul << EQEI_CTL_CMPIEN_Pos) /*!< EQEI_T::CTL: CMPIEN Mask */ 348 349 #define EQEI_CTL_IDXIEN_Pos (19) /*!< EQEI_T::CTL: IDXIEN Position */ 350 #define EQEI_CTL_IDXIEN_Msk (0x1ul << EQEI_CTL_IDXIEN_Pos) /*!< EQEI_T::CTL: IDXIEN Mask */ 351 352 #define EQEI_CTL_HOLDTMR0_Pos (20) /*!< EQEI_T::CTL: HOLDTMR0 Position */ 353 #define EQEI_CTL_HOLDTMR0_Msk (0x1ul << EQEI_CTL_HOLDTMR0_Pos) /*!< EQEI_T::CTL: HOLDTMR0 Mask */ 354 355 #define EQEI_CTL_HOLDTMR1_Pos (21) /*!< EQEI_T::CTL: HOLDTMR1 Position */ 356 #define EQEI_CTL_HOLDTMR1_Msk (0x1ul << EQEI_CTL_HOLDTMR1_Pos) /*!< EQEI_T::CTL: HOLDTMR1 Mask */ 357 358 #define EQEI_CTL_HOLDTMR2_Pos (22) /*!< EQEI_T::CTL: HOLDTMR2 Position */ 359 #define EQEI_CTL_HOLDTMR2_Msk (0x1ul << EQEI_CTL_HOLDTMR2_Pos) /*!< EQEI_T::CTL: HOLDTMR2 Mask */ 360 361 #define EQEI_CTL_HOLDTMR3_Pos (23) /*!< EQEI_T::CTL: HOLDTMR3 Position */ 362 #define EQEI_CTL_HOLDTMR3_Msk (0x1ul << EQEI_CTL_HOLDTMR3_Pos) /*!< EQEI_T::CTL: HOLDTMR3 Mask */ 363 364 #define EQEI_CTL_HOLDCNT_Pos (24) /*!< EQEI_T::CTL: HOLDCNT Position */ 365 #define EQEI_CTL_HOLDCNT_Msk (0x1ul << EQEI_CTL_HOLDCNT_Pos) /*!< EQEI_T::CTL: HOLDCNT Mask */ 366 367 #define EQEI_CTL_IDXLATEN_Pos (25) /*!< EQEI_T::CTL: IDXLATEN Position */ 368 #define EQEI_CTL_IDXLATEN_Msk (0x1ul << EQEI_CTL_IDXLATEN_Pos) /*!< EQEI_T::CTL: IDXLATEN Mask */ 369 370 #define EQEI_CTL_IDXRLDEN_Pos (27) /*!< EQEI_T::CTL: IDXRLDEN Position */ 371 #define EQEI_CTL_IDXRLDEN_Msk (0x1ul << EQEI_CTL_IDXRLDEN_Pos) /*!< EQEI_T::CTL: IDXRLDEN Mask */ 372 373 #define EQEI_CTL_CMPEN_Pos (28) /*!< EQEI_T::CTL: CMPEN Position */ 374 #define EQEI_CTL_CMPEN_Msk (0x1ul << EQEI_CTL_CMPEN_Pos) /*!< EQEI_T::CTL: CMPEN Mask */ 375 376 #define EQEI_CTL_EQEIEN_Pos (29) /*!< EQEI_T::CTL: EQEIEN Position */ 377 #define EQEI_CTL_EQEIEN_Msk (0x1ul << EQEI_CTL_EQEIEN_Pos) /*!< EQEI_T::CTL: EQEIEN Mask */ 378 379 #define EQEI_CTL2_SWAPEN_Pos (0) /*!< EQEI_T::CTL2: SWAPEN Position */ 380 #define EQEI_CTL2_SWAPEN_Msk (0x1ul << EQEI_CTL2_SWAPEN_Pos) /*!< EQEI_T::CTL2: SWAPEN Mask */ 381 382 #define EQEI_CTL2_CRS_Pos (1) /*!< EQEI_T::CTL2: CRS Position */ 383 #define EQEI_CTL2_CRS_Msk (0x3ul << EQEI_CTL2_CRS_Pos) /*!< EQEI_T::CTL2: CRS Mask */ 384 385 #define EQEI_CTL2_DIRSRC_Pos (4) /*!< EQEI_T::CTL2: DIRSRC Position */ 386 #define EQEI_CTL2_DIRSRC_Msk (0x3ul << EQEI_CTL2_DIRSRC_Pos) /*!< EQEI_T::CTL2: DIRSRC Mask */ 387 388 #define EQEI_CTL2_UTEN_Pos (8) /*!< EQEI_T::CTL2: UTEN Position */ 389 #define EQEI_CTL2_UTEN_Msk (0x1ul << EQEI_CTL2_UTEN_Pos) /*!< EQEI_T::CTL2: UTEN Mask */ 390 391 #define EQEI_CTL2_UTHOLDEN_Pos (9) /*!< EQEI_T::CTL2: UTHOLDEN Position */ 392 #define EQEI_CTL2_UTHOLDEN_Msk (0x1ul << EQEI_CTL2_UTHOLDEN_Pos) /*!< EQEI_T::CTL2: UTHOLDEN Mask */ 393 394 #define EQEI_CTL2_UTEVTRST_Pos (10) /*!< EQEI_T::CTL2: UTEVTRST Position */ 395 #define EQEI_CTL2_UTEVTRST_Msk (0x1ul << EQEI_CTL2_UTEVTRST_Pos) /*!< EQEI_T::CTL2: UTEVTRST Mask */ 396 397 #define EQEI_CTL2_IDXRSTUTS_Pos (11) /*!< EQEI_T::CTL2: IDXRSTUTS Position */ 398 #define EQEI_CTL2_IDXRSTUTS_Msk (0x1ul << EQEI_CTL2_IDXRSTUTS_Pos) /*!< EQEI_T::CTL2: IDXRSTUTS Mask */ 399 400 #define EQEI_CTL2_PHEIEN_Pos (16) /*!< EQEI_T::CTL2: PHEIEN Position */ 401 #define EQEI_CTL2_PHEIEN_Msk (0x1ul << EQEI_CTL2_PHEIEN_Pos) /*!< EQEI_T::CTL2: PHEIEN Mask */ 402 403 #define EQEI_CTL2_UTIEIEN_Pos (17) /*!< EQEI_T::CTL2: UTIEIEN Position */ 404 #define EQEI_CTL2_UTIEIEN_Msk (0x1ul << EQEI_CTL2_UTIEIEN_Pos) /*!< EQEI_T::CTL2: UTIEIEN Mask */ 405 406 #define EQEI_UTCNT_UTCNT_Pos (0) /*!< EQEI_T::UTCNT: UTCNT Position */ 407 #define EQEI_UTCNT_UTCNT_Msk (0xfffffffful << EQEI_UTCNT_UTCNT_Pos) /*!< EQEI_T::UTCNT: UTCNT Mask */ 408 409 #define EQEI_UTCMP_UTCMP_Pos (0) /*!< EQEI_T::UTCMP: UTCMP Position */ 410 #define EQEI_UTCMP_UTCMP_Msk (0xfffffffful << EQEI_UTCMP_UTCMP_Pos) /*!< EQEI_T::UTCMP: UTCMP Mask */ 411 412 #define EQEI_STATUS_IDXF_Pos (0) /*!< EQEI_T::STATUS: IDXF Position */ 413 #define EQEI_STATUS_IDXF_Msk (0x1ul << EQEI_STATUS_IDXF_Pos) /*!< EQEI_T::STATUS: IDXF Mask */ 414 415 #define EQEI_STATUS_CMPF_Pos (1) /*!< EQEI_T::STATUS: CMPF Position */ 416 #define EQEI_STATUS_CMPF_Msk (0x1ul << EQEI_STATUS_CMPF_Pos) /*!< EQEI_T::STATUS: CMPF Mask */ 417 418 #define EQEI_STATUS_OVUNF_Pos (2) /*!< EQEI_T::STATUS: OVUNF Position */ 419 #define EQEI_STATUS_OVUNF_Msk (0x1ul << EQEI_STATUS_OVUNF_Pos) /*!< EQEI_T::STATUS: OVUNF Mask */ 420 421 #define EQEI_STATUS_DIRCHGF_Pos (3) /*!< EQEI_T::STATUS: DIRCHGF Position */ 422 #define EQEI_STATUS_DIRCHGF_Msk (0x1ul << EQEI_STATUS_DIRCHGF_Pos) /*!< EQEI_T::STATUS: DIRCHGF Mask */ 423 424 #define EQEI_STATUS_DIRF_Pos (8) /*!< EQEI_T::STATUS: DIRF Position */ 425 #define EQEI_STATUS_DIRF_Msk (0x1ul << EQEI_STATUS_DIRF_Pos) /*!< EQEI_T::STATUS: DIRF Mask */ 426 427 #define EQEI_STATUS_FIDXEF_Pos (9) /*!< EQEI_T::STATUS: FIDXEF Position */ 428 #define EQEI_STATUS_FIDXEF_Msk (0x1ul << EQEI_STATUS_FIDXEF_Pos) /*!< EQEI_T::STATUS: FIDXEF Mask */ 429 430 #define EQEI_STATUS_PHEF_Pos (16) /*!< EQEI_T::STATUS: PHEF Position */ 431 #define EQEI_STATUS_PHEF_Msk (0x1ul << EQEI_STATUS_PHEF_Pos) /*!< EQEI_T::STATUS: PHEF Mask */ 432 433 #define EQEI_STATUS_UTIEF_Pos (17) /*!< EQEI_T::STATUS: UTIEF Position */ 434 #define EQEI_STATUS_UTIEF_Msk (0x1ul << EQEI_STATUS_UTIEF_Pos) /*!< EQEI_T::STATUS: UTIEF Mask */ 435 436 437 /**@}*/ /* EQEI_CONST */ 438 /**@}*/ /* end of EQEI register group */ 439 /**@}*/ /* end of REGISTER group */ 440 441 #if defined ( __CC_ARM ) 442 #pragma no_anon_unions 443 #endif 444 445 #endif /* __EQEI_REG_H__ */ 446