Skip to content

Commit

Permalink
Document limitations of I2C hardware
Browse files Browse the repository at this point in the history
As discussed in #678, the hardware does not support zero-length read/write transactions.
  • Loading branch information
agausmann authored Aug 30, 2023
1 parent a12bcda commit d5371de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rp2040-hal/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@ pub enum Error {
/// I2C abort with error
Abort(u32),
/// User passed in a read buffer that was 0 length
///
/// This is a limitation of the RP2040 I2C peripheral.
/// If the slave ACKs its address, the I2C peripheral must read
/// at least one byte before sending the STOP condition.
InvalidReadBufferLength,
/// User passed in a write buffer that was 0 length
///
/// This is a limitation of the RP2040 I2C peripheral.
/// If the slave ACKs its address, the I2C peripheral must write
/// at least one byte before sending the STOP condition.
InvalidWriteBufferLength,
/// Target i2c address is out of range
AddressOutOfRange(u16),
Expand Down

0 comments on commit d5371de

Please sign in to comment.