class I2CTarget – I2C slave device
- class machine.I2CTarget(scl, sda, address, *, freq=400000)
Construct an I2C slave device object.
scl is the SCL pin. sda is the SDA pin. address is the I2C device address. freq is the I2C bus frequency, defaulting to 400kHz.
- init(scl, sda, address, *, freq=400000)
Initialize the I2C slave device.
scl is the SCL pin. sda is the SDA pin. address is the I2C device address. freq is the I2C bus frequency, defaulting to 400kHz.
- deinit()
Deinitialize the I2C slave device.
- read(buf)
Read data from the I2C controller into the buffer.
buf is the buffer to read data into.
- write(buf)
Write data to the I2C controller.
buf is the data buffer to write.