To create an I2C device, first callDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wokwi/wokwi-docs/llms.txt
Use this file to discover all available pages before exploring further.
i2c_init, passing in an i2c_config_t struct. This struct defines the SCL/SDA pins, the I2C device address, and the connect/read/write/disconnect callbacks.
i2c_init
config argument defines the pins, address, and callbacks for the I2C device. It contains the following fields:
Listen for requests matching the given I2C address (7-bit). To listen for all requests, set to
0The SDA pin
The SCL pin
Called when the chip is addressed on the I2C bus
Called when the microcontroller wants to read a byte of data from your chip
Called when the microcontroller writes a byte to your chip
Called when the microcontroller disconnects from your chip
Data that will be passed in the first argument of the callbacks
connect, read, write, disconnect) are optional. They all use the user_data pointer as their first argument.