Skip to content

Commit

Permalink
fix rename of I2c to I2c[Master|Slave]
Browse files Browse the repository at this point in the history
update usages under boards/
  • Loading branch information
ToddG committed Oct 29, 2020
1 parent f33e261 commit 93e9ec8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions avr-hal-generic/src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ macro_rules! impl_twi_i2c {
// Disable prescaler
p.$twsr.write(|w| w.$twps().prescaler_1());

$I2c {
[<$I2c Master>] {
p,
sda,
scl,
Expand Down Expand Up @@ -268,7 +268,7 @@ macro_rules! impl_twi_i2c {
// Disable prescaler
p.$twsr.write(|w| w.$twps().prescaler_1());

$I2c {
[<$I2c Master>] {
p,
sda,
scl,
Expand Down
3 changes: 2 additions & 1 deletion boards/arduino-diecimila/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ pub use atmega168_hal::spi;

pub type Delay = hal::delay::Delay<hal::clock::MHz16>;
pub type Serial<IMODE> = hal::usart::Usart0<hal::clock::MHz16, IMODE>;
pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
pub type I2cMaster<M> = hal::i2c::I2cMaster<hal::clock::MHz16, M>;
pub type I2cSlave<M> = hal::i2c::I2cSlave<hal::clock::MHz16, M>;
3 changes: 2 additions & 1 deletion boards/arduino-leonardo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ pub type Serial<IMODE> = hal::usart::Usart1<hal::clock::MHz16, IMODE>;
/// ```
///
/// [ex-i2c]: https://github.com/Rahix/avr-hal/blob/master/boards/arduino-leonardo/examples/leonardo-i2cdetect.rs
pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
pub type I2cMaster<M> = hal::i2c::I2cMaster<hal::clock::MHz16, M>;
pub type I2cSlave<M> = hal::i2c::I2cSlave<hal::clock::MHz16, M>;

/// Support for the Watchdog Timer
///
Expand Down
5 changes: 3 additions & 2 deletions boards/arduino-mega2560/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ pub use crate::pins::*;

pub type Delay = hal::delay::Delay<hal::clock::MHz16>;
pub type Serial<IMODE> = atmega2560_hal::usart::Usart0<hal::clock::MHz16, IMODE>;
pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
pub type I2cMaster<M> = hal::i2c::I2cMaster<hal::clock::MHz16, M>;
pub type I2cSlave<M> = hal::i2c::I2cSlave<hal::clock::MHz16, M>;

/// Support for PWM pins
///
Expand Down Expand Up @@ -63,4 +64,4 @@ pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
/// [ex-pwm]: https://github.com/sepotvin/avr-hal/blob/master/boards/arduino-mega2560/examples/mega2560-pwm.rs
pub mod pwm {
pub use atmega2560_hal::pwm::*;
}
}
3 changes: 2 additions & 1 deletion boards/arduino-uno/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ pub type Serial<IMODE> = hal::usart::Usart0<hal::clock::MHz16, IMODE>;
/// ```
///
/// [ex-i2c]: https://github.com/Rahix/avr-hal/blob/master/boards/arduino-uno/examples/uno-i2cdetect.rs
pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
pub type I2cMaster<M> = hal::i2c::I2cMaster<hal::clock::MHz16, M>;
pub type I2cSlave<M> = hal::i2c::I2cSlave<hal::clock::MHz16, M>;

/// Support for the WatchDog Timer
///
Expand Down
3 changes: 2 additions & 1 deletion boards/bigavr6/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ pub use atmega1280_hal::prelude;

pub type Delay = hal::delay::Delay<hal::clock::MHz16>;
pub type Serial<IMODE> = atmega1280_hal::usart::Usart0<hal::clock::MHz16, IMODE>;
pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
pub type I2cMaster<M> = hal::i2c::I2cMaster<hal::clock::MHz16, M>;
pub type I2cSlave<M> = hal::i2c::I2cSlave<hal::clock::MHz16, M>;
3 changes: 2 additions & 1 deletion boards/sparkfun-pro-micro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,5 @@ pub type Serial<IMODE> = hal::usart::Usart1<hal::clock::MHz16, IMODE>;
/// ```
///
/// [ex-i2c]: https://github.com/Rahix/avr-hal/blob/master/boards/sparkfun-pro-micro/examples/pro-micro-i2cdetect.rs
pub type I2c<M> = hal::i2c::I2c<hal::clock::MHz16, M>;
pub type I2cMaster<M> = hal::i2c::I2cMaster<hal::clock::MHz16, M>;
pub type I2cSlave<M> = hal::i2c::I2cSlave<hal::clock::MHz16, M>;

0 comments on commit 93e9ec8

Please sign in to comment.