SN32F260 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 100
Version 1.5
9.7 I2C REGISTERS
Base Address: 0x4001 8000 (I2C0)
9.7.1 I2C n Control register (I2Cn_CTRL) (n=0)
Address Offset: 0x00
Setting of the bits in this register controls operation of the I2C interface.
When STA =1 and the I2C interface is not already in master mode, it enters master mode, checks the bus and
generates a START condition if the bus is free. If the bus is not free, it waits for a STOP condition (which will free the
bus) and generates a START condition after a delay of a half clock period of the internal clock generator. If the I2C
interface is already in master mode and data has been transmitted or received, it transmits a Repeated START
condition. STA may be set at any time, including when the I2C interface is in an addressed slave mode.
When STO = 1 in master mode, a STOP condition is transmitted on the I2C bus. When the bus detects the STOP
condition, STO is cleared automatically. In slave mode, setting STO bit can recover from an error condition. In this case,
no STOP condition is transmitted to the bus. The HW behaves as if a STOP condition has been received and it
switches to “not addressed” slave receiver mode.
If STA and STO are both set, then a STOP condition is transmitted on the I2C bus if it the interface is in master mode,
and transmits a START condition thereafter. If the I2C interface is in slave mode, an internal STOP condition is
generated, but is not transmitted on the bus.
Note:
1. I2CEN shall be set at last.
2. HW will assign SCL0/SCL1 and SDA0/SDA1 pins as output pins with open-drain function instead
of GPIO automatically.
3.
ACK and NACK bits can’t both be “1” when receiving data.
4. User has to write 1 to ACK or NACK bit in Master mode to continue next RX process.
Bit
Name
Description
Attribute
Reset
31:9
Reserved
R
0
8
I2CEN
I2C Interface enable bit.
0: Disable. T
he STO bit is forced to “0”.
1: Enable.
I2EN shall not be used to temporarily release the I2C bus since the bus
status is lost when I2CEN resets. The ACK flag should be used instead.
R/W
0
7
MODE
I2C mode selection bit.
0: Standard/Fast mode.
1: Reserved.
R
0
6
Reserved
5
STA
START bit..
0: No START condition or Repeated START condition will be generated.
1: Cause the I2C interface to enter master mode and transmit a START
or a Repeated START condition. Automatically cleared by HW.
R/W
0
4
STO
STOP flag.
0: Stop condition idle.
1: Cause the I2C interface to transmit a STOP condition in master mode,
or recover from an error condition in slave mode.
Automatically cleared by HW.
R/W
0
3
Reserved
R
0
2
ACK
Assert ACK (Low level to SDA) flag.
0: Master mode
No function.
Slave mode
Return a NACK after receiving address or data.
1: An ACK will be returned during the acknowledge clock pulse on SCLn.
when
R/W
0