i2c_reg.h 56 KB

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