atsam-rs / atsam4-hal

Apache License 2.0
5 stars 3 forks source link

Add support for TWI (I2C) module #26

Open haata opened 3 years ago

haata commented 3 years ago

At minimum we should implement I2C master (atsamd doesn't have an I2C slave implementation afaict). https://github.com/atsamd-rs/atsamd/blob/master/hal/src/common/thumbv7em/sercom/v1/i2c.rs https://docs.rs/embedded-hal/0.2.4/embedded_hal/blocking/i2c/index.html

Both atsam4s and atsam4e have two TWI modules.

Ideally with optional support for PDC, but this can get complicated as it's actually less efficient to use PDC for I2C when the transfer sizes are small. So it's probably best to ignore this for now.