4 #define TWI_CR_START BIT(0) /* Send a Start Condition */
5 #define TWI_CR_MSEN BIT(2) /* Master Transfer Enable */
6 #define TWI_CR_STOP BIT(1) /* Send a Stop Condition */
7 #define TWI_CR_SVDIS BIT(5) /* Slave Transfer Disable */
8 #define TWI_CR_SWRST BIT(7) /* Software Reset */
9 #define TWI_CR_ACMEN BIT(16) /* Alternative Command Mode Enable */
10 #define TWI_CR_ACMDIS BIT(17) /* Alternative Command Mode Disable */
11 #define TWI_CR_LOCKCLR BIT(26) /* Lock Clear */
13 #define TWI_MMR_MREAD BIT(12) /* Master Read Direction */
14 #define TWI_MMR_IADRSZ_1 BIT(8) /* Internal Device Address Size */
16 #define TWI_SR_TXCOMP BIT(0) /* Transmission Complete */
17 #define TWI_SR_RXRDY BIT(1) /* Receive Holding Register Ready */
18 #define TWI_SR_TXRDY BIT(2) /* Transmit Holding Register Ready */
19 #define TWI_SR_OVRE BIT(6) /* Overrun Error */
20 #define TWI_SR_UNRE BIT(7) /* Underrun Error */
21 #define TWI_SR_NACK BIT(8) /* Not Acknowledged */
22 #define TWI_SR_LOCK BIT(23) /* TWI Lock due to Frame Errors */
24 #define TWI_ACR_DATAL(len) ((len) & 0xff)
25 #define TWI_ACR_DIR_READ BIT(8)
27 #define TWI_CWGR_HOLD_MAX 0x1f
28 #define TWI_CWGR_HOLD(x) (((x) & TWI_CWGR_HOLD_MAX) << 24)
30 struct at91_i2c_regs {
62 struct at91_i2c_pdata {
68 struct at91_i2c_regs *regs;
74 const struct at91_i2c_pdata *pdata;