![Geehy SEMICONDUCTOR APM32F030x4x6x8xC Скачать руководство пользователя страница 278](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f030x4x6x8xc/apm32f030x4x6x8xc_user-manual_573629278.webp)
www.geehy.com Page 277
22.5.4.1
Slave mode
Transmitt in slave mode
After the master sends the start signal and address, the addressing is successful,
the ADDRMFLG bit is cleared, and the transmitter will transmit the data to be
transmitted from I2C_TXDATA register to SDA line by internal shift register.
Every time the slave sends a byte, it will wait for the master's acknowledge signal
(ACK) and repeat this process until the master wants to stop receiving data and
returns a non-acknowledge signal (NACK) to the slave. At this time, the slave will
stop data transmission.
Receive in slave mode
After receiving the address of the master, ADDRMFLG bit will be cleared, and
the data received by the slave from the SDA line through the internal shift
register are stored in I2C_RXDATA register.
After the slave receives a byte, it will send an acknowledge signal (ACK) to the
master and when the master sends a stop signal, the transmission is over.
Extension of slave clock
In default mode, I2C slave will pull down SCL clock in the following situations:
The received address matches the enabled slave address, and SCL
clock is pulled down and will be released when ADDRMFLG flag is
cleared by software. ADDRMFLG flag bit can be cleared by setting
ADDRMCLR bit to 1.
When transmitting, if the previous data have been transmitted and no
new data are written to I2C_TXDATA register, or ADDRMFLG flag is
cleared, and no byte is written to I2C_TXDATA register, the SCL clock
will be pulled down and when data are written to I2C_TXDATA register,
the SCL clock will be released.
When receiving, if the content of I2C_RXDATA register is not read and
new data are received, the SCL clock will be pulled down and when
I2C_RXDATA register is read, the SCL clock will be released.
22.5.4.2
Master mode
Master transmitting
I2C interface sends the start signal and sends the address to the SDA line
through the internal shift register. The transmission direction is write, waiting for
the slave to respond. After the slave responds, the master will send bytes from
I2C_TXDATA register to SDA line through the internal shift register and wait for
the acknowledge signal (ACK) transmitted by slave, and so forth. When
I2C_TXDATA register writes the last byte, the stop bit is set to generate a stop
signal.