
CH32V003
Reference Manual
V1.3
151
hardware after the PE has been cleared.
1: ACK bit controls the ACK or NAK of the next
byte received in the shift register. The next byte
received in the PEC shift register is the PEC.
0: The ACK bit controls the ACK or NAK of the
byte currently being accepted in the shift register.
the PEC bit indicates that the byte in the shift
register before the current bit is PEC.
Note: The POS bit is used in 2-byte data reception
as follows: it must be configured before reception.
In order to NACK the 2nd byte, the ACK bit must
be cleared immediately after clearing the ADDR
bit; in order to detect the PEC of the second byte,
the PEC bit must be set after the ADDR event and
after configuring the POS bit.
10
ACK
RW
Acknowledge enable,
This bit is set and cleared
by software and cleared by hardware when PE=0.
1
:
Acknowledge returned after a byte is received.
0
:
No acknowledge returned.
0
9
STOP
RW
Stop generation bit.
This bit is set and cleared by
software, cleared by hardware when a Stop
condition is detected, set by hardware when a
timeout error is detected.
In Master mode:
1
:
Stop generation after the current byte transfer
or after the current Start condition is sent.
0
:
No Stop generation.
In Slave mode:
1
:
Release the SCL and SDA lines after the
current byte transfer.
0
:
No Stop generation.
0
8
START
RW
Start generation. This bit is set and cleared by
software and cleared by hardware when start is
sent or PE=0.
In Master mode:
1
:
Repeated start generation
0
:
No Start generation
In Slave mode:
1
:
Start generation when the bus is free
0
:
No Start generation
0
7
NOSTRETCH
RW
Clock stretching disable bit. This bit is used to
disable clock stretching in slave mode when
ADDR or BTF flag is set, until it is reset by
software.
1
:
Clock stretching disabled.
0
:
Clock stretching enabled.
0
6
ENGC
RW
General call enable bit.
Set this bit to enable
broadcast call and answer broadcast address 00h.
0
5
ENPEC
RW
PEC enable bit, set this bit to enable PEC
calculation.
0
[4:1]
Reserved
RO
Reserved
0
0
PE
RW
I2C peripheral enable bit.
1: Enable the I2C module.
0: Disable the I2C module.
0