1, I²c mode selection
The interface has 4 modes: from the device transmission mode, from the device receiving mode, the main device sending mode, the main device receiving mode
。
By default, the I²c module works in slave mode. The interface automatically switches from slave mode to main mode after the starting condition is generated
When the quorum fails or when a stop signal is sent, the switch from mode to slave mode.
2. Communication process
In main mode, the I²c interface initiates data transfer and generates a clock signal. Serial data transfer always starts with the starting condition and
Ends with a stop condition. Both the start condition and the stop condition are generated by software control in the main mode.
Related function Registers
1, i²c Control register 1 (I2C_CR1)
2, I²c control Register 2 (I2C_CR2)
3, I²c frequency register (I2C_FREQR)
allowable clock range in 1-24mhz
4, I²c self address Register LSB (I2C_OARL)
5, I²c self-address register MSB (I2c_oarh)
6, I²C Data Register (I2C_DR)
7, i²c Status Register 1 (I2C_SR1)
8, i²c Status Register 2 (I2C_SR2)
9, i²c Status Register 3 (I2C_SR3)
10. I2c_itr I²c Interrupt Register
11, I²c clock Control register low part (I2C_CCRL)
12, I²c clock Control Register high part (I2C_CCRH)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.