Module atmega_hal::i2c
source · Expand description
I2C
§Example
Complete example source code can be found in the repository:
atmega2560-i2cdetect.rs
let dp = atmega_hal::Peripherals::take().unwrap();
let pins = atmega_hal::pins!(dp);
let mut i2c = I2c::new(
dp.TWI,
pins.pd1.into_pull_up_input(),
pins.pd0.into_pull_up_input(),
50_000,
);
i2c.i2cdetect(&mut serial, atmega_hal::i2c::Direction::Read).unwrap();
Modules§
- TWI Status Codes
Enums§
- I2C Transfer Direction
- I2C Error
Traits§
- Internal trait for low-level I2C peripherals.