Hello,
I copy code from the daisy field to initialise I2C_1 Peripheral. So far, this is working great :
I2CHandle i2c_led;
static constexpr I2CHandle::Config i2c_led_config
= {I2CHandle::Config::Peripheral::I2C_1,
{{DSY_GPIOB, 8}, {DSY_GPIOB, 9}},
I2CHandle::Config::Speed::I2C_1MHZ};
i2c_led.Init(i2c_led_config);
I can communicate with my device using ReadDataAtAddress and WriteDataAtAddress function :
if(i2c_led.ReadDataAtAddress(136, 2, 1, kb_data, 1, 10) == I2CHandle::Result::OK) {…
But when I try to replicate this using other I2C peripheral (I2C_3 and I2C_4), the communication with the device did not work.
I tried :
static constexpr I2CHandle::Config i2c_kb1_config
= {I2CHandle::Config::Peripheral::I2C_3,
{{DSY_GPIOB, 12}, {DSY_GPIOC, 9}},
I2CHandle::Config::Speed::I2C_400KHZ};
i2c_kb1.Init(i2c_kb1_config);
static constexpr I2CHandle::Config i2c_kb2_config
= {I2CHandle::Config::Peripheral::I2C_4,
{{DSY_GPIOB, 6}, {DSY_GPIOB, 7}},
I2CHandle::Config::Speed::I2C_400KHZ};
i2c_kb2.Init(i2c_kb2_config);
but I’m not sure about this : {{DSY_GPIOB, 12}, {DSY_GPIOC, 9}} (I get the information in the daisy_seed.cpp file.)
Does anyone have a working example on how to use other I2C peripheral?
thanks!