7.5.11 I2C User Guide
The S100 MCU provides a standard I2C bus. The I2C bus controller transfers information between devices connected to the bus through the serial data line (SDA) and serial clock line (SCL). Each device has a unique address. The main function of the I2C subsystem is to implement serial communication between the microcontroller and peripherals. It can drive MIPI daughter cards, PMIC chips, and other common peripherals.
The S600 MCU provides a standard I2C bus. The I2C bus controller transfers information between devices connected to the bus through the serial data line (SDA) and serial clock line (SCL). Each device has a unique address. The main function of the I2C subsystem is to implement serial communication between the microcontroller and peripherals. It can drive MIPI daughter cards, PMIC chips, and other common peripherals.
I2C Controller
The I2C controller supports the following features:
- Three speed mode options (the driver currently does not support HIGH SPEED mode)
- Standard Mode: 0~100 Kb/s
- Fast Mode & Fast Mode Plus:
- Fast Mode: 0~400 Kb/s
- Fast Mode Plus: 0~1000 Kb/s
- High-Speed Mode: 0~3.4 Mb/s
- Master/slave mode configuration
- 7-bit and 10-bit addressing modes
The S100 MCU provides 4 I2C controllers (I2C6~9) in total, with Fast Mode Plus as the default speed.
Code Paths
McalCdd/Common/Register/inc/I2c_Register.h: Register definitionsMcalCdd/I2c/src/I2c.c: Driver source codeMcalCdd/I2c/src/I2c_Lld.c: Low-level driver source codeMcalCdd/I2c/inc/I2c.h: Driver header fileMcalCdd/I2c/inc/I2c_Lld.h: Low-level driver header fileConfig/McalCdd/gen_s100_sip_B_mcu1/I2c/src/I2c_PBcfg.c: PB configuration fileConfig/McalCdd/gen_s100_sip_B_mcu1/I2c/inc/I2c_PBcfg.h: PB configuration header fileConfig/McalCdd/gen_s100_sip_B_mcu1/I2c/inc/I2c_Board.h: I2C board-level configuration filesamples/I2c/src/I2c_Cmd.c: I2C sample
Initialization and Scheduling
General-purpose I/O pin initialization is outside the scope of the I2C driver. The PORT driver should initialize I/O first (Port_Init(NULL);), and then the I2C driver can be used. The I2C driver initialization function is I2c_Init(NULL).