Open sigmafx opened 2 years ago
note #1049 which also deals with I2C functions - perhaps we need an additional config
this is also very useful for driving OLED displays, where the frame data needs to be preceded by a single 0x40 byte.
@sigmafx 's function needs the following after the for loop to wait for the STOP bit to actually be generated:
while (!(i2c->hw->raw_intr_stat & I2C_IC_RAW_INTR_STAT_STOP_DET_BITS)) tight_loop_contents();
Does #1495 fix this, or is that a different problem entirely?
Whilst writing to an I2C EEPROM it's necessary to write eeprom memory address followed by the data to write without a STOP between the address and the data. A typical write function would accept a memory address and data as separate parameters. This is best written to the EEPROM in 2 API calls: 1st: Sends device address and eeprom memory address 2nd: Sends data, followed by a STOP
The only achievable way is using the following APIs:
However,
i2c_write_raw_blocking
does not write a STOP.It would be helpful to include the
nostop
paramter toi2c_write_raw_blocking
function:There's already a comment in there about this.