111: if(p_cb->rdat_num == 0) {
112: out_w(I2C_CR1(unit), I2C_CR1_PE);
113: p_cb->state = I2C_STS_STOP;
115: } else {
116: out_w(I2C_CR1(unit), I2C_CR1_PE | I2C_CR1_TCIE | I2C_CR1_RXIE | I2C_CR1_NACKIE | I2C_CR1_ERRIE );
117: }
120: } else if( i2c_st & I2C_ISR_TC) { /* Transfer complete */
121: out_w(I2C_CR1(unit), I2C_CR1_PE | I2C_CR1_RXIE | I2C_CR1_NACKIE | I2C_CR1_ERRIE );
122: p_cb->state = I2C_STS_START;
127: if(--(p_cb->rdat_num) <= 0) { /* final data ? */
128: out_w(I2C_CR1(unit), I2C_CR1_PE);
129: p_cb->state = I2C_STS_STOP;
132: } else { /* Error */
133: out_w(I2C_CR1(unit), I2C_CR1_PE);
134: p_cb->ioerr = E_IO;
167:
168: out_w(I2C_CR1(unit), I2C_CR1_PE);
169:
189: /* I2C Device enable */
190: out_w(I2C_CR1(unit), I2C_CR1_PE | I2C_CR1_TXIE | I2C_CR1_RXIE | I2C_CR1_NACKIE | I2C_CR1_ERRIE );
191:
227:
228: out_w(I2C_CR1(unit), 0); /* I2C Device disable */
229: