-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic: simplify port macro via
paste!
- Loading branch information
1 parent
aed6b9a
commit 063f845
Showing
10 changed files
with
249 additions
and
611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
pub use attiny_hal::port::{mode, Pin, PinOps, PinMode}; | ||
pub use attiny_hal::port::{mode, Pin, PinMode, PinOps}; | ||
|
||
avr_hal_generic::renamed_pins! { | ||
type Pin = Pin; | ||
pub struct Pins { | ||
/// `#0`: `PB0`, `DI`(SPI), `SDA`(I2C) | ||
pub d0: attiny_hal::port::PB0 = pb0, | ||
/// `#1`: `PB1`, `DO`(SPI), Builtin LED | ||
pub d1: attiny_hal::port::PB1 = pb1, | ||
/// `#2`: `PB2`, `SCK`(SPI), `SCL`(I2C) | ||
pub d2: attiny_hal::port::PB2 = pb2, | ||
/// `#3`: `PB3` | ||
pub d3: attiny_hal::port::PB3 = pb3, | ||
/// `#4`: `PB4` | ||
pub d4: attiny_hal::port::PB4 = pb4, | ||
} | ||
|
||
pub struct Pins from attiny_hal::Pins { | ||
/// `#0`: `PB0`, `DI`(SPI), `SDA`(I2C) | ||
pub d0: attiny_hal::port::PB0 = pb0, | ||
/// `#1`: `PB1`, `DO`(SPI), Builtin LED | ||
pub d1: attiny_hal::port::PB1 = pb1, | ||
/// `#2`: `PB2`, `SCK`(SPI), `SCL`(I2C) | ||
pub d2: attiny_hal::port::PB2 = pb2, | ||
/// `#3`: `PB3` | ||
pub d3: attiny_hal::port::PB3 = pb3, | ||
/// `#4`: `PB4` | ||
pub d4: attiny_hal::port::PB4 = pb4, | ||
impl Pins { | ||
type Pin = Pin; | ||
type McuPins = attiny_hal::Pins; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.