1 /**************************************************************************//** 2 * @file i2c_reg.h 3 * @version V1.00 4 * @brief I2C register definition header file 5 * 6 * @copyright SPDX-License-Identifier: Apache-2.0 7 * @copyright Copyright (C) 2020 Nuvoton Technology Corp. All rights reserved. 8 *****************************************************************************/ 9 #ifndef __I2C_REG_H__ 10 #define __I2C_REG_H__ 11 12 /** @addtogroup REGISTER Control Register 13 14 @{ 15 16 */ 17 18 /*---------------------- Inter-IC Bus Controller -------------------------*/ 19 /** 20 @addtogroup I2C Inter-IC Bus Controller(I2C) 21 Memory Mapped Structure for I2C Controller 22 @{ 23 */ 24 25 typedef struct 26 { 27 28 29 /** 30 * @var I2C_T::CTL0 31 * Offset: 0x00 I2C Control Register 0 32 * --------------------------------------------------------------------------------------------------- 33 * |Bits |Field |Descriptions 34 * | :----: | :----: | :---- | 35 * |[2] |AA |Assert Acknowledge Control 36 * | | |When AA =1 prior to address or data is received, an acknowledged (low level to SDA) will be returned during the acknowledge clock pulse on the SCL line when 1.) A slave is acknowledging the address sent from master, 2.) The receiver devices are acknowledging the data sent by transmitter 37 * | | |When AA=0 prior to address or data received, a Not acknowledged (high level to SDA) will be returned during the acknowledge clock pulse on the SCL line 38 * |[3] |SI |I2C Interrupt Flag 39 * | | |When a new I2C state is present in the I2C_STATUS register, the SI flag is set by hardware 40 * | | |If bit INTEN (I2C_CTL [7]) is set, the I2C interrupt is requested 41 * | | |SI must be cleared by software 42 * | | |Clear SI by writing 1 to this bit. 43 * | | |For ACKMEN is set in slave read mode, the SI flag is set in 8th clock period for user to confirm the acknowledge bit and 9th clock period for user to read the data in the data buffer. 44 * |[4] |STO |I2C STOP Control 45 * | | |In Master mode, setting STO to transmit a STOP condition to bus then I2C controller will check the bus condition if a STOP condition is detected 46 * | | |This bit will be cleared by hardware automatically. 47 * |[5] |STA |I2C START Control 48 * | | |Setting STA to logic 1 to enter Master mode, the I2C hardware sends a START or repeat START condition to bus when the bus is free. 49 * |[6] |I2CEN |I2C Controller Enable Bit 50 * | | |Set to enable I2C serial function controller 51 * | | |When I2CEN=1 the I2C serial function enable 52 * | | |The multi-function pin function must set to SDA, and SCL of I2C function first. 53 * | | |0 = I2C controller Disabled. 54 * | | |1 = I2C controller Enabled. 55 * |[7] |INTEN |Enable Interrupt 56 * | | |0 = I2C interrupt Disabled. 57 * | | |1 = I2C interrupt Enabled. 58 * @var I2C_T::ADDR0 59 * Offset: 0x04 I2C Slave Address Register0 60 * --------------------------------------------------------------------------------------------------- 61 * |Bits |Field |Descriptions 62 * | :----: | :----: | :---- | 63 * |[0] |GC |General Call Function 64 * | | |0 = General Call Function Disabled. 65 * | | |1 = General Call Function Enabled. 66 * |[10:1] |ADDR |I2C Address 67 * | | |The content of this register is irrelevant when I2C is in Master mode 68 * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address 69 * | | |The I2C hardware will react if either of the address is matched. 70 * @var I2C_T::DAT 71 * Offset: 0x08 I2C Data Register 72 * --------------------------------------------------------------------------------------------------- 73 * |Bits |Field |Descriptions 74 * | :----: | :----: | :---- | 75 * |[7:0] |DAT |I2C Data 76 * | | |Bit [7:0] is located with the 8-bit transferred/received data of I2C serial port. 77 * @var I2C_T::STATUS0 78 * Offset: 0x0C I2C Status Register 0 79 * --------------------------------------------------------------------------------------------------- 80 * |Bits |Field |Descriptions 81 * | :----: | :----: | :---- | 82 * |[7:0] |STATUS |I2C Status 83 * | | |The three least significant bits are always 0 84 * | | |The five most significant bits contain the status code 85 * | | |There are 28 possible status codes 86 * | | |When the content of I2C_STATUS0 is F8H, no serial interrupt is requested 87 * | | |Others I2C_STATUS0 values correspond to defined I2C states 88 * | | |When each of these states is entered, a status interrupt is requested (SI = 1) 89 * | | |A valid status code is present in I2C_STATUS0 one cycle after SI is set by hardware and is still present one cycle after SI has been reset by software 90 * | | |In addition, states 00H stands for a Bus Error 91 * | | |A Bus Error occurs when a START or STOP condition is present at an illegal position in the formation frame 92 * | | |Example of illegal position are during the serial transfer of an address byte, a data byte or an acknowledge bit. 93 * @var I2C_T::CLKDIV 94 * Offset: 0x10 I2C Clock Divided Register 95 * --------------------------------------------------------------------------------------------------- 96 * |Bits |Field |Descriptions 97 * | :----: | :----: | :---- | 98 * |[9:0] |DIVIDER |I2C Clock Divided 99 * | | |Indicates the I2C clock rate: Data Baud Rate of I2C = (system clock) / (4x (I2C_CLKDIV+1)). 100 * | | |Note: The minimum value of I2C_CLKDIV is 4. 101 * @var I2C_T::TOCTL 102 * Offset: 0x14 I2C Time-out Control Register 103 * --------------------------------------------------------------------------------------------------- 104 * |Bits |Field |Descriptions 105 * | :----: | :----: | :---- | 106 * |[0] |TOIF |Time-out Flag 107 * | | |This bit is set by hardware when I2C time-out happened and it can interrupt CPU if I2C interrupt enable bit (INTEN) is set to 1. 108 * | | |Note: Software can write 1 to clear this bit. 109 * |[1] |TOCDIV4 |Time-out Counter Input Clock Divided by 4 110 * | | |When Enabled, The time-out period is extend 4 times. 111 * | | |0 = Time-out period is extend 4 times Disabled. 112 * | | |1 = Time-out period is extend 4 times Enabled. 113 * |[2] |TOCEN |Time-out Counter Enable Bit 114 * | | |When Enabled, the 14-bit time-out counter will start counting when SI is clear 115 * | | |Setting flag SI to u20181' will reset counter and re-start up counting after SI is cleared. 116 * | | |0 = Time-out counter Disabled. 117 * | | |1 = Time-out counter Enabled. 118 * @var I2C_T::ADDR1 119 * Offset: 0x18 I2C Slave Address Register1 120 * --------------------------------------------------------------------------------------------------- 121 * |Bits |Field |Descriptions 122 * | :----: | :----: | :---- | 123 * |[0] |GC |General Call Function 124 * | | |0 = General Call Function Disabled. 125 * | | |1 = General Call Function Enabled. 126 * |[10:1] |ADDR |I2C Address 127 * | | |The content of this register is irrelevant when I2C is in Master mode 128 * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address 129 * | | |The I2C hardware will react if either of the address is matched. 130 * @var I2C_T::ADDR2 131 * Offset: 0x1C I2C Slave Address Register2 132 * --------------------------------------------------------------------------------------------------- 133 * |Bits |Field |Descriptions 134 * | :----: | :----: | :---- | 135 * |[0] |GC |General Call Function 136 * | | |0 = General Call Function Disabled. 137 * | | |1 = General Call Function Enabled. 138 * |[10:1] |ADDR |I2C Address 139 * | | |The content of this register is irrelevant when I2C is in Master mode 140 * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address 141 * | | |The I2C hardware will react if either of the address is matched. 142 * @var I2C_T::ADDR3 143 * Offset: 0x20 I2C Slave Address Register3 144 * --------------------------------------------------------------------------------------------------- 145 * |Bits |Field |Descriptions 146 * | :----: | :----: | :---- | 147 * |[0] |GC |General Call Function 148 * | | |0 = General Call Function Disabled. 149 * | | |1 = General Call Function Enabled. 150 * |[10:1] |ADDR |I2C Address 151 * | | |The content of this register is irrelevant when I2C is in Master mode 152 * | | |In the slave mode, the seven most significant bits must be loaded with the chip's own address 153 * | | |The I2C hardware will react if either of the address is matched. 154 * @var I2C_T::ADDRMSK0 155 * Offset: 0x24 I2C Slave Address Mask Register0 156 * --------------------------------------------------------------------------------------------------- 157 * |Bits |Field |Descriptions 158 * | :----: | :----: | :---- | 159 * |[10:1] |ADDRMSK |I2C Address Mask 160 * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). 161 * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). 162 * | | |I2C bus controllers support multiple address recognition with four address mask register 163 * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care 164 * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. 165 * | | |Note: The wake-up function can not use address mask. 166 * @var I2C_T::ADDRMSK1 167 * Offset: 0x28 I2C Slave Address Mask Register1 168 * --------------------------------------------------------------------------------------------------- 169 * |Bits |Field |Descriptions 170 * | :----: | :----: | :---- | 171 * |[10:1] |ADDRMSK |I2C Address Mask 172 * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). 173 * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). 174 * | | |I2C bus controllers support multiple address recognition with four address mask register 175 * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care 176 * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. 177 * | | |Note: The wake-up function can not use address mask. 178 * @var I2C_T::ADDRMSK2 179 * Offset: 0x2C I2C Slave Address Mask Register2 180 * --------------------------------------------------------------------------------------------------- 181 * |Bits |Field |Descriptions 182 * | :----: | :----: | :---- | 183 * |[10:1] |ADDRMSK |I2C Address Mask 184 * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). 185 * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). 186 * | | |I2C bus controllers support multiple address recognition with four address mask register 187 * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care 188 * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. 189 * | | |Note: The wake-up function can not use address mask. 190 * @var I2C_T::ADDRMSK3 191 * Offset: 0x30 I2C Slave Address Mask Register3 192 * --------------------------------------------------------------------------------------------------- 193 * |Bits |Field |Descriptions 194 * | :----: | :----: | :---- | 195 * |[10:1] |ADDRMSK |I2C Address Mask 196 * | | |0 = Mask Disabled (the received corresponding register bit should be exact the same as address register.). 197 * | | |1 = Mask Enabled (the received corresponding address bit is don't care.). 198 * | | |I2C bus controllers support multiple address recognition with four address mask register 199 * | | |When the bit in the address mask register is set to one, it means the received corresponding address bit is don't-care 200 * | | |If the bit is set to zero, that means the received corresponding register bit should be exact the same as address register. 201 * | | |Note: The wake-up function can not use address mask. 202 * @var I2C_T::WKCTL 203 * Offset: 0x3C I2C Wake-up Control Register 204 * --------------------------------------------------------------------------------------------------- 205 * |Bits |Field |Descriptions 206 * | :----: | :----: | :---- | 207 * |[0] |WKEN |I2C Wake-up Enable Bit 208 * | | |0 = I2C wake-up function Disabled. 209 * | | |1= I2C wake-up function Enabled. 210 * |[7] |NHDBUSEN |I2C No Hold BUS Enable Bit 211 * | | |0 = I2C don't hold bus after wake-up disable. 212 * | | |1= I2C don't hold bus after wake-up enable. 213 * | | |Note: I2C controller could response when WKIF event is not clear, it may cause error data transmitted or received 214 * | | |If data transmitted or received when WKIF event is not clear, user must reset I2C controller and execute the original operation again. 215 * @var I2C_T::WKSTS 216 * Offset: 0x40 I2C Wake-up Status Register 217 * --------------------------------------------------------------------------------------------------- 218 * |Bits |Field |Descriptions 219 * | :----: | :----: | :---- | 220 * |[0] |WKIF |I2C Wake-up Flag 221 * | | |When chip is woken up from Power-down mode by I2C, this bit is set to 1 222 * | | |Software can write 1 to clear this bit. 223 * |[1] |WKAKDONE |Wakeup Address Frame Acknowledge Bit Done 224 * | | |0 = The ACK bit cycle of address match frame isn't done. 225 * | | |1 = The ACK bit cycle of address match frame is done in power-down. 226 * | | |Note: This bit can't release WKIF. Software can write 1 to clear this bit. 227 * |[2] |WRSTSWK |Read/Write Status Bit in Address Wakeup Frame 228 * | | |0 = Write command be record on the address match wakeup frame. 229 * | | |1 = Read command be record on the address match wakeup frame. 230 * | | |Note: This bit will be cleared when software can write 1 to WKAKDONE bit. 231 * @var I2C_T::CTL1 232 * Offset: 0x44 I2C Control Register 1 233 * --------------------------------------------------------------------------------------------------- 234 * |Bits |Field |Descriptions 235 * | :----: | :----: | :---- | 236 * |[0] |TXPDMAEN |PDMA Transmit Channel Available 237 * | | |0 = Transmit PDMA function disable. 238 * | | |1 = Transmit PDMA function enable. 239 * |[1] |RXPDMAEN |PDMA Receive Channel Available 240 * | | |0 = Receive PDMA function disable. 241 * | | |1 = Receive PDMA function enable. 242 * |[2] |PDMARST |PDMA Reset 243 * | | |0 = No effect. 244 * | | |1 = Reset the I2C request to PDMA. This bit will be cleared to 0 automatically. 245 * |[8] |PDMASTR |PDMA Stretch Bit 246 * | | |0 = I2C send STOP automatically after PDMA transfer done. (only master TX) 247 * | | |1 = I2C SCL bus is stretched by hardware after PDMA transfer done if the SI is not cleared 248 * | | |(only master TX) 249 * |[9] |ADDR10EN |Address 10-bit Function Enable 250 * | | |0 = Address match 10-bit function is disabled. 251 * | | |1 = Address match 10-bit function is enabled. 252 * @var I2C_T::STATUS1 253 * Offset: 0x48 I2C Status Register 1 254 * --------------------------------------------------------------------------------------------------- 255 * |Bits |Field |Descriptions 256 * | :----: | :----: | :---- | 257 * |[0] |ADMAT0 |I2C Address 0 Match Status Register 258 * | | |When address 0 is matched, hardware will inform which address used 259 * | | |This bit will set to 1, and software can write 1 to clear this bit. 260 * |[1] |ADMAT1 |I2C Address 1 Match Status Register 261 * | | |When address 1 is matched, hardware will inform which address used 262 * | | |This bit will set to 1, and software can write 1 to clear this bit. 263 * |[2] |ADMAT2 |I2C Address 2 Match Status Register 264 * | | |When address 2 is matched, hardware will inform which address used 265 * | | |This bit will set to 1, and software can write 1 to clear this bit. 266 * |[3] |ADMAT3 |I2C Address 3 Match Status Register 267 * | | |When address 3 is matched, hardware will inform which address used 268 * | | |This bit will set to 1, and software can write 1 to clear this bit. 269 * |[8] |ONBUSY |On Bus Busy 270 * | | |Indicates that a communication is in progress on the bus 271 * | | |It is set by hardware when a START condition is detected 272 * | | |It is cleared by hardware when a STOP condition is detected. 273 * | | |0 = The bus is IDLE (both SCLK and SDA High). 274 * | | |1 = The bus is busy. 275 * | | |Note:This bit is read only. 276 * @var I2C_T::TMCTL 277 * Offset: 0x4C I2C Timing Configure Control Register 278 * --------------------------------------------------------------------------------------------------- 279 * |Bits |Field |Descriptions 280 * | :----: | :----: | :---- | 281 * |[8:0] |STCTL |Setup Time Configure Control Register 282 * | | |This field is used to generate a delay timing between SDA falling edge and SCL rising edge in transmission mode. 283 * | | |The delay setup time is numbers of peripheral clock = STCTL x PCLK. 284 * | | |Note: Setup time setting should not make SCL output less than three PCLKs. 285 * |[24:16] |HTCTL |Hold Time Configure Control Register 286 * | | |This field is used to generate the delay timing between SCL falling edge and SDA rising edge in transmission mode. 287 * | | |The delay hold time is numbers of peripheral clock = HTCTL x PCLK. 288 * @var I2C_T::BUSCTL 289 * Offset: 0x50 I2C Bus Management Control Register 290 * --------------------------------------------------------------------------------------------------- 291 * |Bits |Field |Descriptions 292 * | :----: | :----: | :---- | 293 * |[0] |ACKMEN |Acknowledge Control by Manual 294 * | | |In order to allow ACK control in slave reception including the command and data, slave byte control mode must be enabled by setting the ACKMEN bit. 295 * | | |0 = Slave byte control Disabled. 296 * | | |1 = Slave byte control Enabled 297 * | | |The 9th bit can response the ACK or NACK according the received data by user 298 * | | |When the byte is received, stretching the SCLK signal low between the 8th and 9th SCLK pulse. 299 * | | |Note: If the BMDEN =1 and this bit is enabled, the information of I2C_STATUS will be fixed as 0xF0 in slave receive condition. 300 * |[1] |PECEN |Packet Error Checking Calculation Enable Bit 301 * | | |0 = Packet Error Checking Calculation Disabled. 302 * | | |1 = Packet Error Checking Calculation Enabled. 303 * | | |Note: When I2C enter power down mode, the bit should be enabled after wake-up if needed PEC calculation. 304 * |[2] |BMDEN |Bus Management Device Default Address Enable Bit 305 * | | |0 = Device default address Disable 306 * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses NACKed 307 * | | |1 = Device default address Enabled 308 * | | |When the address 0'b1100001x coming and the both of BMDEN and ACKMEN are enabled, the device responses ACKed. 309 * |[3] |BMHEN |Bus Management Host Enable Bit 310 * | | |0 = Host function Disabled. 311 * | | |1 = Host function Enabled. 312 * |[4] |ALERTEN |Bus Management Alert Enable Bit 313 * | | |Device Mode (BMHEN =0). 314 * | | |0 = Release the BM_ALERT pin high and Alert Response Header disabled: 0001100x followed by NACK if both of BMDEN and ACKMEN are enabled. 315 * | | |1 = Drive BM_ALERT pin low and Alert Response Address Header enables: 0001100x followed by ACK if both of BMDEN and ACKMEN are enabled. 316 * | | |Host Mode (BMHEN =1). 317 * | | |0 = BM_ALERT pin not supported. 318 * | | |1 = BM_ALERT pin supported. 319 * |[5] |SCTLOSTS |Suspend/Control Data Output Status 320 * | | |0 = The output of SUSCON pin is low. 321 * | | |1 = The output of SUSCON pin is high. 322 * |[6] |SCTLOEN |Suspend or Control Pin Output Enable Bit 323 * | | |0 = The SUSCON pin in input. 324 * | | |1 = The output enable is active on the SUSCON pin. 325 * |[7] |BUSEN |BUS Enable Bit 326 * | | |0 = The system management function is Disabled. 327 * | | |1 = The system management function is Enable. 328 * | | |Note: When the bit is enabled, the internal 14-bit counter is used to calculate the time out event of clock low condition. 329 * |[8] |PECTXEN |Packet Error Checking Byte Transmission/Reception 330 * | | |0 = No PEC transfer. 331 * | | |1 = PEC transmission is requested. 332 * | | |Note: 1.This bit has no effect in slave mode when ACKMEN =0. 333 * |[9] |TIDLE |Timer Check in Idle State 334 * | | |The BUSTOUT is used to calculate the time-out of clock low in bus active and the idle period in bus Idle 335 * | | |This bit is used to define which condition is enabled. 336 * | | |0 = The BUSTOUT is used to calculate the clock low period in bus active. 337 * | | |1 = The BUSTOUT is used to calculate the IDLE period in bus Idle. 338 * | | |Note: The BUSY (I2C_BUSSTS[0]) indicate the current bus state. 339 * |[10] |PECCLR |PEC Clear at Repeat Start 340 * | | |The calculation of PEC starts when PECEN is set to 1 and it is clear when the STA or STO bit is detected 341 * | | |This PECCLR bit is used to enable the condition of REPEAT START can clear the PEC calculation. 342 * | | |0 = The PEC calculation is cleared by Repeat Start function is Disabled. 343 * | | |1 = The PEC calculation is cleared by Repeat Start function is Enabled. 344 * |[11] |ACKM9SI |Acknowledge Manual Enable Extra SI Interrupt 345 * | | |0 = There is no SI interrupt in the 9th clock cycle when the BUSEN =1 and ACKMEN =1. 346 * | | |1 = There is SI interrupt in the 9th clock cycle when the BUSEN =1 and ACKMEN =1. 347 * |[12] |BCDIEN |Packet Error Checking Byte Count Done Interrupt Enable Bit 348 * | | |0 = Indicates the byte count done interrupt is Disabled. 349 * | | |1 = Indicates the byte count done interrupt is Enabled. 350 * | | |Note: This bit is used in PECEN =1. 351 * |[13] |PECDIEN |Packet Error Checking Byte Transfer Done Interrupt Enable Bit 352 * | | |0 = Indicates the PEC transfer done interrupt is Disabled. 353 * | | |1 = Indicates the PEC transfer done interrupt is Enabled. 354 * | | |Note: This bit is used in PECEN =1. 355 * @var I2C_T::BUSTCTL 356 * Offset: 0x54 I2C Bus Management Timer Control Register 357 * --------------------------------------------------------------------------------------------------- 358 * |Bits |Field |Descriptions 359 * | :----: | :----: | :---- | 360 * |[0] |BUSTOEN |Bus Time Out Enable Bit 361 * | | |0 = Indicates the bus clock low time-out detection is Disabled. 362 * | | |1 = Indicates the bus clock low time-out detection is Enabled (bus clock is low for more than Time-out (in BIDLE=0) or high more than Time-out(in BIDLE =1) 363 * |[1] |CLKTOEN |Cumulative Clock Low Time Out Enable Bit 364 * | | |0 = Indicates the cumulative clock low time-out detection is Disabled. 365 * | | |1 = Indicates the cumulative clock low time-out detection is Enabled. 366 * | | |For Master, it calculates the period from START to ACK 367 * | | |For Slave, it calculates the period from START to STOP 368 * |[2] |BUSTOIEN |Time-out Interrupt Enable Bit 369 * | | |BUSY =1. 370 * | | |0 = Indicates the SCLK low time-out interrupt is Disabled. 371 * | | |1 = Indicates the SCLK low time-out interrupt is Enabled. 372 * | | |BUSY =0. 373 * | | |0 = Indicates the bus IDLE time-out interrupt is Disabled. 374 * | | |1 = Indicates the bus IDLE time-out interrupt is Enabled. 375 * |[3] |CLKTOIEN |Extended Clock Time Out Interrupt Enable Bit 376 * | | |0 = Indicates the clock time out interrupt is Disabled. 377 * | | |1 = Indicates the clock time out interrupt is Enabled. 378 * |[4] |TORSTEN |Time Out Reset Enable Bit 379 * | | |0 = Indicates the I2C state machine reset is Disable. 380 * | | |1 = Indicates the I2C state machine reset is Enable. (The clock and data bus will be released to high) 381 * @var I2C_T::BUSSTS 382 * Offset: 0x58 I2C Bus Management Status Register 383 * --------------------------------------------------------------------------------------------------- 384 * |Bits |Field |Descriptions 385 * | :----: | :----: | :---- | 386 * |[0] |BUSY |Bus Busy 387 * | | |Indicates that a communication is in progress on the bus 388 * | | |It is set by hardware when a START condition is detected 389 * | | |It is cleared by hardware when a STOP condition is detected 390 * | | |0 = The bus is IDLE (both SCLK and SDA High). 391 * | | |1 = The bus is busy. 392 * |[1] |BCDONE |Byte Count Transmission/Receive Done 393 * | | |0 = Indicates the byte count transmission/ receive is not finished when the PECEN is set. 394 * | | |1 = Indicates the byte count transmission/ receive is finished when the PECEN is set. 395 * | | |Note: Software can write 1 to clear this bit. 396 * |[2] |PECERR |PEC Error in Reception 397 * | | |0 = Indicates the PEC value equal the received PEC data packet. 398 * | | |1 = Indicates the PEC value doesn't match the receive PEC data packet. 399 * | | |Note: Software can write 1 to clear this bit. 400 * |[3] |ALERT |SMBus Alert Status 401 * | | |Device Mode (BMHEN =0). 402 * | | |0 = Indicates SMBALERT pin state is low. 403 * | | |1 = Indicates SMBALERT pin state is high. 404 * | | |Host Mode (BMHEN =1). 405 * | | |0 = No SMBALERT event. 406 * | | |1 = Indicates there is SMBALERT event (falling edge) is detected in SMALERT pin when the BMHEN = 1 (SMBus host configuration) and the ALERTEN = 1. 407 * | | |Note: 1 408 * | | |The SMBALERT pin is an open-drain pin, the pull-high resistor is must in the system 409 * | | |2 410 * | | |Software can write 1 to clear this bit. 411 * |[4] |SCTLDIN |Bus Suspend or Control Signal Input Status 412 * | | |0 = The input status of SUSCON pin is 0. 413 * | | |1 = The input status of SUSCON pin is 1. 414 * |[5] |BUSTO |Bus Time-out Status 415 * | | |0 = Indicates that there is no any time-out or external clock time-out. 416 * | | |1 = Indicates that a time-out or external clock time-out occurred. 417 * | | |In bus busy, the bit indicates the total clock low time-out event occurred otherwise, it indicates the bus idle time-out event occurred. 418 * | | |Note: Software can write 1 to clear this bit. 419 * |[6] |CLKTO |Clock Low Accumulate Time-out Status 420 * | | |0 = Indicates that the cumulative clock low is no any time-out. 421 * | | |1 = Indicates that the cumulative clock low time-out occurred. 422 * | | |Note: Software can write 1 to clear this bit. 423 * |[7] |PECDONE |PEC Byte Transmission/Receive Done 424 * | | |0 = Indicates the PEC transmission/ receive is not finished when the PECEN is set. 425 * | | |1 = Indicates the PEC transmission/ receive is finished when the PECEN is set. 426 * | | |Note: Software can write 1 to clear this bit. 427 * @var I2C_T::PKTSIZE 428 * Offset: 0x5C I2C Packet Error Checking Byte Number Register 429 * --------------------------------------------------------------------------------------------------- 430 * |Bits |Field |Descriptions 431 * | :----: | :----: | :---- | 432 * |[8:0] |PLDSIZE |Transfer Byte Number 433 * | | |The transmission or receive byte number in one transaction when the PECEN is set 434 * | | |The maximum transaction or receive byte is 256 Bytes. 435 * | | |Notice: The byte number counting includes address, command code, and data frame. 436 * @var I2C_T::PKTCRC 437 * Offset: 0x60 I2C Packet Error Checking Byte Value Register 438 * --------------------------------------------------------------------------------------------------- 439 * |Bits |Field |Descriptions 440 * | :----: | :----: | :---- | 441 * |[7:0] |PECCRC |Packet Error Checking Byte Value 442 * | | |This byte indicates the packet error checking content after transmission or receive byte count by using the C(x) = X8 + X2 + X + 1 443 * | | |It is read only. 444 * @var I2C_T::BUSTOUT 445 * Offset: 0x64 I2C Bus Management Timer Register 446 * --------------------------------------------------------------------------------------------------- 447 * |Bits |Field |Descriptions 448 * | :----: | :----: | :---- | 449 * |[7:0] |BUSTO |Bus Management Time-out Value 450 * | | |Indicate the bus time-out value in bus is IDLE or SCLK low. 451 * | | |Note: If the user wants to revise the value of BUSTOUT, the TORSTEN (I2C_BUSTCTL[4]) bit shall be set to 1 and clear to 0 first in the BUSEN(I2C_BUSCTL[7]) is set. 452 * @var I2C_T::CLKTOUT 453 * Offset: 0x68 I2C Bus Management Clock Low Timer Register 454 * --------------------------------------------------------------------------------------------------- 455 * |Bits |Field |Descriptions 456 * | :----: | :----: | :---- | 457 * |[7:0] |CLKTO |Bus Clock Low Timer 458 * | | |The field is used to configure the cumulative clock extension time-out. 459 * | | |Note: If the user wants to revise the value of CLKLTOUT, the TORSTEN bit shall be set to 1 and clear to 0 first in the BUSEN is set. 460 */ 461 __IO uint32_t CTL0; /*!< [0x0000] I2C Control Register 0 */ 462 __IO uint32_t ADDR0; /*!< [0x0004] I2C Slave Address Register0 */ 463 __IO uint32_t DAT; /*!< [0x0008] I2C Data Register */ 464 __I uint32_t STATUS0; /*!< [0x000c] I2C Status Register 0 */ 465 __IO uint32_t CLKDIV; /*!< [0x0010] I2C Clock Divided Register */ 466 __IO uint32_t TOCTL; /*!< [0x0014] I2C Time-out Control Register */ 467 __IO uint32_t ADDR1; /*!< [0x0018] I2C Slave Address Register1 */ 468 __IO uint32_t ADDR2; /*!< [0x001c] I2C Slave Address Register2 */ 469 __IO uint32_t ADDR3; /*!< [0x0020] I2C Slave Address Register3 */ 470 __IO uint32_t ADDRMSK0; /*!< [0x0024] I2C Slave Address Mask Register0 */ 471 __IO uint32_t ADDRMSK1; /*!< [0x0028] I2C Slave Address Mask Register1 */ 472 __IO uint32_t ADDRMSK2; /*!< [0x002c] I2C Slave Address Mask Register2 */ 473 __IO uint32_t ADDRMSK3; /*!< [0x0030] I2C Slave Address Mask Register3 */ 474 __I uint32_t RESERVE0[2]; 475 __IO uint32_t WKCTL; /*!< [0x003c] I2C Wake-up Control Register */ 476 __IO uint32_t WKSTS; /*!< [0x0040] I2C Wake-up Status Register */ 477 __IO uint32_t CTL1; /*!< [0x0044] I2C Control Register 1 */ 478 __IO uint32_t STATUS1; /*!< [0x0048] I2C Status Register 1 */ 479 __IO uint32_t TMCTL; /*!< [0x004c] I2C Timing Configure Control Register */ 480 __IO uint32_t BUSCTL; /*!< [0x0050] I2C Bus Management Control Register */ 481 __IO uint32_t BUSTCTL; /*!< [0x0054] I2C Bus Management Timer Control Register */ 482 __IO uint32_t BUSSTS; /*!< [0x0058] I2C Bus Management Status Register */ 483 __IO uint32_t PKTSIZE; /*!< [0x005c] I2C Packet Error Checking Byte Number Register */ 484 __I uint32_t PKTCRC; /*!< [0x0060] I2C Packet Error Checking Byte Value Register */ 485 __IO uint32_t BUSTOUT; /*!< [0x0064] I2C Bus Management Timer Register */ 486 __IO uint32_t CLKTOUT; /*!< [0x0068] I2C Bus Management Clock Low Timer Register */ 487 488 } I2C_T; 489 490 /** 491 @addtogroup I2C_CONST I2C Bit Field Definition 492 Constant Definitions for I2C Controller 493 @{ 494 */ 495 496 #define I2C_CTL0_AA_Pos (2) /*!< I2C_T::CTL0: AA Position */ 497 #define I2C_CTL0_AA_Msk (0x1ul << I2C_CTL0_AA_Pos) /*!< I2C_T::CTL0: AA Mask */ 498 499 #define I2C_CTL0_SI_Pos (3) /*!< I2C_T::CTL0: SI Position */ 500 #define I2C_CTL0_SI_Msk (0x1ul << I2C_CTL0_SI_Pos) /*!< I2C_T::CTL0: SI Mask */ 501 502 #define I2C_CTL0_STO_Pos (4) /*!< I2C_T::CTL0: STO Position */ 503 #define I2C_CTL0_STO_Msk (0x1ul << I2C_CTL0_STO_Pos) /*!< I2C_T::CTL0: STO Mask */ 504 505 #define I2C_CTL0_STA_Pos (5) /*!< I2C_T::CTL0: STA Position */ 506 #define I2C_CTL0_STA_Msk (0x1ul << I2C_CTL0_STA_Pos) /*!< I2C_T::CTL0: STA Mask */ 507 508 #define I2C_CTL0_I2CEN_Pos (6) /*!< I2C_T::CTL0: I2CEN Position */ 509 #define I2C_CTL0_I2CEN_Msk (0x1ul << I2C_CTL0_I2CEN_Pos) /*!< I2C_T::CTL0: I2CEN Mask */ 510 511 #define I2C_CTL0_INTEN_Pos (7) /*!< I2C_T::CTL0: INTEN Position */ 512 #define I2C_CTL0_INTEN_Msk (0x1ul << I2C_CTL0_INTEN_Pos) /*!< I2C_T::CTL0: INTEN Mask */ 513 514 #define I2C_ADDR0_GC_Pos (0) /*!< I2C_T::ADDR0: GC Position */ 515 #define I2C_ADDR0_GC_Msk (0x1ul << I2C_ADDR0_GC_Pos) /*!< I2C_T::ADDR0: GC Mask */ 516 517 #define I2C_ADDR0_ADDR_Pos (1) /*!< I2C_T::ADDR0: ADDR Position */ 518 #define I2C_ADDR0_ADDR_Msk (0x3fful << I2C_ADDR0_ADDR_Pos) /*!< I2C_T::ADDR0: ADDR Mask */ 519 520 #define I2C_DAT_DAT_Pos (0) /*!< I2C_T::DAT: DAT Position */ 521 #define I2C_DAT_DAT_Msk (0xfful << I2C_DAT_DAT_Pos) /*!< I2C_T::DAT: DAT Mask */ 522 523 #define I2C_STATUS0_STATUS_Pos (0) /*!< I2C_T::STATUS0: STATUS Position */ 524 #define I2C_STATUS0_STATUS_Msk (0xfful << I2C_STATUS0_STATUS_Pos) /*!< I2C_T::STATUS0: STATUS Mask */ 525 526 #define I2C_CLKDIV_DIVIDER_Pos (0) /*!< I2C_T::CLKDIV: DIVIDER Position */ 527 #define I2C_CLKDIV_DIVIDER_Msk (0x3fful << I2C_CLKDIV_DIVIDER_Pos) /*!< I2C_T::CLKDIV: DIVIDER Mask */ 528 529 #define I2C_TOCTL_TOIF_Pos (0) /*!< I2C_T::TOCTL: TOIF Position */ 530 #define I2C_TOCTL_TOIF_Msk (0x1ul << I2C_TOCTL_TOIF_Pos) /*!< I2C_T::TOCTL: TOIF Mask */ 531 532 #define I2C_TOCTL_TOCDIV4_Pos (1) /*!< I2C_T::TOCTL: TOCDIV4 Position */ 533 #define I2C_TOCTL_TOCDIV4_Msk (0x1ul << I2C_TOCTL_TOCDIV4_Pos) /*!< I2C_T::TOCTL: TOCDIV4 Mask */ 534 535 #define I2C_TOCTL_TOCEN_Pos (2) /*!< I2C_T::TOCTL: TOCEN Position */ 536 #define I2C_TOCTL_TOCEN_Msk (0x1ul << I2C_TOCTL_TOCEN_Pos) /*!< I2C_T::TOCTL: TOCEN Mask */ 537 538 #define I2C_ADDR1_GC_Pos (0) /*!< I2C_T::ADDR1: GC Position */ 539 #define I2C_ADDR1_GC_Msk (0x1ul << I2C_ADDR1_GC_Pos) /*!< I2C_T::ADDR1: GC Mask */ 540 541 #define I2C_ADDR1_ADDR_Pos (1) /*!< I2C_T::ADDR1: ADDR Position */ 542 #define I2C_ADDR1_ADDR_Msk (0x3fful << I2C_ADDR1_ADDR_Pos) /*!< I2C_T::ADDR1: ADDR Mask */ 543 544 #define I2C_ADDR2_GC_Pos (0) /*!< I2C_T::ADDR2: GC Position */ 545 #define I2C_ADDR2_GC_Msk (0x1ul << I2C_ADDR2_GC_Pos) /*!< I2C_T::ADDR2: GC Mask */ 546 547 #define I2C_ADDR2_ADDR_Pos (1) /*!< I2C_T::ADDR2: ADDR Position */ 548 #define I2C_ADDR2_ADDR_Msk (0x3fful << I2C_ADDR2_ADDR_Pos) /*!< I2C_T::ADDR2: ADDR Mask */ 549 550 #define I2C_ADDR3_GC_Pos (0) /*!< I2C_T::ADDR3: GC Position */ 551 #define I2C_ADDR3_GC_Msk (0x1ul << I2C_ADDR3_GC_Pos) /*!< I2C_T::ADDR3: GC Mask */ 552 553 #define I2C_ADDR3_ADDR_Pos (1) /*!< I2C_T::ADDR3: ADDR Position */ 554 #define I2C_ADDR3_ADDR_Msk (0x3fful << I2C_ADDR3_ADDR_Pos) /*!< I2C_T::ADDR3: ADDR Mask */ 555 556 #define I2C_ADDRMSK0_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK0: ADDRMSK Position */ 557 #define I2C_ADDRMSK0_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK0_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK0: ADDRMSK Mask */ 558 559 #define I2C_ADDRMSK1_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK1: ADDRMSK Position */ 560 #define I2C_ADDRMSK1_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK1_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK1: ADDRMSK Mask */ 561 562 #define I2C_ADDRMSK2_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK2: ADDRMSK Position */ 563 #define I2C_ADDRMSK2_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK2_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK2: ADDRMSK Mask */ 564 565 #define I2C_ADDRMSK3_ADDRMSK_Pos (1) /*!< I2C_T::ADDRMSK3: ADDRMSK Position */ 566 #define I2C_ADDRMSK3_ADDRMSK_Msk (0x3fful << I2C_ADDRMSK3_ADDRMSK_Pos) /*!< I2C_T::ADDRMSK3: ADDRMSK Mask */ 567 568 #define I2C_WKCTL_WKEN_Pos (0) /*!< I2C_T::WKCTL: WKEN Position */ 569 #define I2C_WKCTL_WKEN_Msk (0x1ul << I2C_WKCTL_WKEN_Pos) /*!< I2C_T::WKCTL: WKEN Mask */ 570 571 #define I2C_WKCTL_NHDBUSEN_Pos (7) /*!< I2C_T::WKCTL: NHDBUSEN Position */ 572 #define I2C_WKCTL_NHDBUSEN_Msk (0x1ul << I2C_WKCTL_NHDBUSEN_Pos) /*!< I2C_T::WKCTL: NHDBUSEN Mask */ 573 574 #define I2C_WKSTS_WKIF_Pos (0) /*!< I2C_T::WKSTS: WKIF Position */ 575 #define I2C_WKSTS_WKIF_Msk (0x1ul << I2C_WKSTS_WKIF_Pos) /*!< I2C_T::WKSTS: WKIF Mask */ 576 577 #define I2C_WKSTS_WKAKDONE_Pos (1) /*!< I2C_T::WKSTS: WKAKDONE Position */ 578 #define I2C_WKSTS_WKAKDONE_Msk (0x1ul << I2C_WKSTS_WKAKDONE_Pos) /*!< I2C_T::WKSTS: WKAKDONE Mask */ 579 580 #define I2C_WKSTS_WRSTSWK_Pos (2) /*!< I2C_T::WKSTS: WRSTSWK Position */ 581 #define I2C_WKSTS_WRSTSWK_Msk (0x1ul << I2C_WKSTS_WRSTSWK_Pos) /*!< I2C_T::WKSTS: WRSTSWK Mask */ 582 583 #define I2C_CTL1_TXPDMAEN_Pos (0) /*!< I2C_T::CTL1: TXPDMAEN Position */ 584 #define I2C_CTL1_TXPDMAEN_Msk (0x1ul << I2C_CTL1_TXPDMAEN_Pos) /*!< I2C_T::CTL1: TXPDMAEN Mask */ 585 586 #define I2C_CTL1_RXPDMAEN_Pos (1) /*!< I2C_T::CTL1: RXPDMAEN Position */ 587 #define I2C_CTL1_RXPDMAEN_Msk (0x1ul << I2C_CTL1_RXPDMAEN_Pos) /*!< I2C_T::CTL1: RXPDMAEN Mask */ 588 589 #define I2C_CTL1_PDMARST_Pos (2) /*!< I2C_T::CTL1: PDMARST Position */ 590 #define I2C_CTL1_PDMARST_Msk (0x1ul << I2C_CTL1_PDMARST_Pos) /*!< I2C_T::CTL1: PDMARST Mask */ 591 592 #define I2C_CTL1_PDMASTR_Pos (8) /*!< I2C_T::CTL1: PDMASTR Position */ 593 #define I2C_CTL1_PDMASTR_Msk (0x1ul << I2C_CTL1_PDMASTR_Pos) /*!< I2C_T::CTL1: PDMASTR Mask */ 594 595 #define I2C_CTL1_ADDR10EN_Pos (9) /*!< I2C_T::CTL1: ADDR10EN Position */ 596 #define I2C_CTL1_ADDR10EN_Msk (0x1ul << I2C_CTL1_ADDR10EN_Pos) /*!< I2C_T::CTL1: ADDR10EN Mask */ 597 598 #define I2C_STATUS1_ADMAT0_Pos (0) /*!< I2C_T::STATUS1: ADMAT0 Position */ 599 #define I2C_STATUS1_ADMAT0_Msk (0x1ul << I2C_STATUS1_ADMAT0_Pos) /*!< I2C_T::STATUS1: ADMAT0 Mask */ 600 601 #define I2C_STATUS1_ADMAT1_Pos (1) /*!< I2C_T::STATUS1: ADMAT1 Position */ 602 #define I2C_STATUS1_ADMAT1_Msk (0x1ul << I2C_STATUS1_ADMAT1_Pos) /*!< I2C_T::STATUS1: ADMAT1 Mask */ 603 604 #define I2C_STATUS1_ADMAT2_Pos (2) /*!< I2C_T::STATUS1: ADMAT2 Position */ 605 #define I2C_STATUS1_ADMAT2_Msk (0x1ul << I2C_STATUS1_ADMAT2_Pos) /*!< I2C_T::STATUS1: ADMAT2 Mask */ 606 607 #define I2C_STATUS1_ADMAT3_Pos (3) /*!< I2C_T::STATUS1: ADMAT3 Position */ 608 #define I2C_STATUS1_ADMAT3_Msk (0x1ul << I2C_STATUS1_ADMAT3_Pos) /*!< I2C_T::STATUS1: ADMAT3 Mask */ 609 610 #define I2C_STATUS1_ONBUSY_Pos (8) /*!< I2C_T::STATUS1: ONBUSY Position */ 611 #define I2C_STATUS1_ONBUSY_Msk (0x1ul << I2C_STATUS1_ONBUSY_Pos) /*!< I2C_T::STATUS1: ONBUSY Mask */ 612 613 #define I2C_TMCTL_STCTL_Pos (0) /*!< I2C_T::TMCTL: STCTL Position */ 614 #define I2C_TMCTL_STCTL_Msk (0x1fful << I2C_TMCTL_STCTL_Pos) /*!< I2C_T::TMCTL: STCTL Mask */ 615 616 #define I2C_TMCTL_HTCTL_Pos (16) /*!< I2C_T::TMCTL: HTCTL Position */ 617 #define I2C_TMCTL_HTCTL_Msk (0x1fful << I2C_TMCTL_HTCTL_Pos) /*!< I2C_T::TMCTL: HTCTL Mask */ 618 619 #define I2C_BUSCTL_ACKMEN_Pos (0) /*!< I2C_T::BUSCTL: ACKMEN Position */ 620 #define I2C_BUSCTL_ACKMEN_Msk (0x1ul << I2C_BUSCTL_ACKMEN_Pos) /*!< I2C_T::BUSCTL: ACKMEN Mask */ 621 622 #define I2C_BUSCTL_PECEN_Pos (1) /*!< I2C_T::BUSCTL: PECEN Position */ 623 #define I2C_BUSCTL_PECEN_Msk (0x1ul << I2C_BUSCTL_PECEN_Pos) /*!< I2C_T::BUSCTL: PECEN Mask */ 624 625 #define I2C_BUSCTL_BMDEN_Pos (2) /*!< I2C_T::BUSCTL: BMDEN Position */ 626 #define I2C_BUSCTL_BMDEN_Msk (0x1ul << I2C_BUSCTL_BMDEN_Pos) /*!< I2C_T::BUSCTL: BMDEN Mask */ 627 628 #define I2C_BUSCTL_BMHEN_Pos (3) /*!< I2C_T::BUSCTL: BMHEN Position */ 629 #define I2C_BUSCTL_BMHEN_Msk (0x1ul << I2C_BUSCTL_BMHEN_Pos) /*!< I2C_T::BUSCTL: BMHEN Mask */ 630 631 #define I2C_BUSCTL_ALERTEN_Pos (4) /*!< I2C_T::BUSCTL: ALERTEN Position */ 632 #define I2C_BUSCTL_ALERTEN_Msk (0x1ul << I2C_BUSCTL_ALERTEN_Pos) /*!< I2C_T::BUSCTL: ALERTEN Mask */ 633 634 #define I2C_BUSCTL_SCTLOSTS_Pos (5) /*!< I2C_T::BUSCTL: SCTLOSTS Position */ 635 #define I2C_BUSCTL_SCTLOSTS_Msk (0x1ul << I2C_BUSCTL_SCTLOSTS_Pos) /*!< I2C_T::BUSCTL: SCTLOSTS Mask */ 636 637 #define I2C_BUSCTL_SCTLOEN_Pos (6) /*!< I2C_T::BUSCTL: SCTLOEN Position */ 638 #define I2C_BUSCTL_SCTLOEN_Msk (0x1ul << I2C_BUSCTL_SCTLOEN_Pos) /*!< I2C_T::BUSCTL: SCTLOEN Mask */ 639 640 #define I2C_BUSCTL_BUSEN_Pos (7) /*!< I2C_T::BUSCTL: BUSEN Position */ 641 #define I2C_BUSCTL_BUSEN_Msk (0x1ul << I2C_BUSCTL_BUSEN_Pos) /*!< I2C_T::BUSCTL: BUSEN Mask */ 642 643 #define I2C_BUSCTL_PECTXEN_Pos (8) /*!< I2C_T::BUSCTL: PECTXEN Position */ 644 #define I2C_BUSCTL_PECTXEN_Msk (0x1ul << I2C_BUSCTL_PECTXEN_Pos) /*!< I2C_T::BUSCTL: PECTXEN Mask */ 645 646 #define I2C_BUSCTL_TIDLE_Pos (9) /*!< I2C_T::BUSCTL: TIDLE Position */ 647 #define I2C_BUSCTL_TIDLE_Msk (0x1ul << I2C_BUSCTL_TIDLE_Pos) /*!< I2C_T::BUSCTL: TIDLE Mask */ 648 649 #define I2C_BUSCTL_PECCLR_Pos (10) /*!< I2C_T::BUSCTL: PECCLR Position */ 650 #define I2C_BUSCTL_PECCLR_Msk (0x1ul << I2C_BUSCTL_PECCLR_Pos) /*!< I2C_T::BUSCTL: PECCLR Mask */ 651 652 #define I2C_BUSCTL_ACKM9SI_Pos (11) /*!< I2C_T::BUSCTL: ACKM9SI Position */ 653 #define I2C_BUSCTL_ACKM9SI_Msk (0x1ul << I2C_BUSCTL_ACKM9SI_Pos) /*!< I2C_T::BUSCTL: ACKM9SI Mask */ 654 655 #define I2C_BUSCTL_BCDIEN_Pos (12) /*!< I2C_T::BUSCTL: BCDIEN Position */ 656 #define I2C_BUSCTL_BCDIEN_Msk (0x1ul << I2C_BUSCTL_BCDIEN_Pos) /*!< I2C_T::BUSCTL: BCDIEN Mask */ 657 658 #define I2C_BUSCTL_PECDIEN_Pos (13) /*!< I2C_T::BUSCTL: PECDIEN Position */ 659 #define I2C_BUSCTL_PECDIEN_Msk (0x1ul << I2C_BUSCTL_PECDIEN_Pos) /*!< I2C_T::BUSCTL: PECDIEN Mask */ 660 661 #define I2C_BUSTCTL_BUSTOEN_Pos (0) /*!< I2C_T::BUSTCTL: BUSTOEN Position */ 662 #define I2C_BUSTCTL_BUSTOEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOEN Mask */ 663 664 #define I2C_BUSTCTL_CLKTOEN_Pos (1) /*!< I2C_T::BUSTCTL: CLKTOEN Position */ 665 #define I2C_BUSTCTL_CLKTOEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOEN Mask */ 666 667 #define I2C_BUSTCTL_BUSTOIEN_Pos (2) /*!< I2C_T::BUSTCTL: BUSTOIEN Position */ 668 #define I2C_BUSTCTL_BUSTOIEN_Msk (0x1ul << I2C_BUSTCTL_BUSTOIEN_Pos) /*!< I2C_T::BUSTCTL: BUSTOIEN Mask */ 669 670 #define I2C_BUSTCTL_CLKTOIEN_Pos (3) /*!< I2C_T::BUSTCTL: CLKTOIEN Position */ 671 #define I2C_BUSTCTL_CLKTOIEN_Msk (0x1ul << I2C_BUSTCTL_CLKTOIEN_Pos) /*!< I2C_T::BUSTCTL: CLKTOIEN Mask */ 672 673 #define I2C_BUSTCTL_TORSTEN_Pos (4) /*!< I2C_T::BUSTCTL: TORSTEN Position */ 674 #define I2C_BUSTCTL_TORSTEN_Msk (0x1ul << I2C_BUSTCTL_TORSTEN_Pos) /*!< I2C_T::BUSTCTL: TORSTEN Mask */ 675 676 #define I2C_BUSSTS_BUSY_Pos (0) /*!< I2C_T::BUSSTS: BUSY Position */ 677 #define I2C_BUSSTS_BUSY_Msk (0x1ul << I2C_BUSSTS_BUSY_Pos) /*!< I2C_T::BUSSTS: BUSY Mask */ 678 679 #define I2C_BUSSTS_BCDONE_Pos (1) /*!< I2C_T::BUSSTS: BCDONE Position */ 680 #define I2C_BUSSTS_BCDONE_Msk (0x1ul << I2C_BUSSTS_BCDONE_Pos) /*!< I2C_T::BUSSTS: BCDONE Mask */ 681 682 #define I2C_BUSSTS_PECERR_Pos (2) /*!< I2C_T::BUSSTS: PECERR Position */ 683 #define I2C_BUSSTS_PECERR_Msk (0x1ul << I2C_BUSSTS_PECERR_Pos) /*!< I2C_T::BUSSTS: PECERR Mask */ 684 685 #define I2C_BUSSTS_ALERT_Pos (3) /*!< I2C_T::BUSSTS: ALERT Position */ 686 #define I2C_BUSSTS_ALERT_Msk (0x1ul << I2C_BUSSTS_ALERT_Pos) /*!< I2C_T::BUSSTS: ALERT Mask */ 687 688 #define I2C_BUSSTS_SCTLDIN_Pos (4) /*!< I2C_T::BUSSTS: SCTLDIN Position */ 689 #define I2C_BUSSTS_SCTLDIN_Msk (0x1ul << I2C_BUSSTS_SCTLDIN_Pos) /*!< I2C_T::BUSSTS: SCTLDIN Mask */ 690 691 #define I2C_BUSSTS_BUSTO_Pos (5) /*!< I2C_T::BUSSTS: BUSTO Position */ 692 #define I2C_BUSSTS_BUSTO_Msk (0x1ul << I2C_BUSSTS_BUSTO_Pos) /*!< I2C_T::BUSSTS: BUSTO Mask */ 693 694 #define I2C_BUSSTS_CLKTO_Pos (6) /*!< I2C_T::BUSSTS: CLKTO Position */ 695 #define I2C_BUSSTS_CLKTO_Msk (0x1ul << I2C_BUSSTS_CLKTO_Pos) /*!< I2C_T::BUSSTS: CLKTO Mask */ 696 697 #define I2C_BUSSTS_PECDONE_Pos (7) /*!< I2C_T::BUSSTS: PECDONE Position */ 698 #define I2C_BUSSTS_PECDONE_Msk (0x1ul << I2C_BUSSTS_PECDONE_Pos) /*!< I2C_T::BUSSTS: PECDONE Mask */ 699 700 #define I2C_PKTSIZE_PLDSIZE_Pos (0) /*!< I2C_T::PKTSIZE: PLDSIZE Position */ 701 #define I2C_PKTSIZE_PLDSIZE_Msk (0x1fful << I2C_PKTSIZE_PLDSIZE_Pos) /*!< I2C_T::PKTSIZE: PLDSIZE Mask */ 702 703 #define I2C_PKTCRC_PECCRC_Pos (0) /*!< I2C_T::PKTCRC: PECCRC Position */ 704 #define I2C_PKTCRC_PECCRC_Msk (0xfful << I2C_PKTCRC_PECCRC_Pos) /*!< I2C_T::PKTCRC: PECCRC Mask */ 705 706 #define I2C_BUSTOUT_BUSTO_Pos (0) /*!< I2C_T::BUSTOUT: BUSTO Position */ 707 #define I2C_BUSTOUT_BUSTO_Msk (0xfful << I2C_BUSTOUT_BUSTO_Pos) /*!< I2C_T::BUSTOUT: BUSTO Mask */ 708 709 #define I2C_CLKTOUT_CLKTO_Pos (0) /*!< I2C_T::CLKTOUT: CLKTO Position */ 710 #define I2C_CLKTOUT_CLKTO_Msk (0xfful << I2C_CLKTOUT_CLKTO_Pos) /*!< I2C_T::CLKTOUT: CLKTO Mask */ 711 712 /**@}*/ /* I2C_CONST */ 713 /**@}*/ /* end of I2C register group */ 714 /**@}*/ /* end of REGISTER group */ 715 716 717 #endif /* __I2C_REG_H__ */ 718