I2C write,read
Overview
After the application starts, perform the following operations:
Initialize I2C controller drive
Write a 16 byte string from EEPROM internal offset 0
Read a page of 16 bytes from EEPROM internal offset 0 and print it out
Requirements
Demo uses EVB board, eeprom model is NV24C02, and I2C address on this board is 0x52; When using other models, note that the address and other parameters should be modified to match.
I2C API reads and writes eeprom. How to use I2C API. When actually reading and writing eeprom, it is more convenient to use the device driver API of eeprom.
Building and flashing
Example location: examples/peripheral/i2c
Other exampleexamples/peripheral/eeprom
For operations such as compiling and burning, please refer to: [Quick Start] (../../../../get_started/index. html # build function)