Skip to content

Commit

Permalink
attiny-hal: Enabled and fixed SPI support
Browse files Browse the repository at this point in the history
  • Loading branch information
tbienko authored Apr 25, 2024
1 parent 7f7d0a5 commit 3e36262
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions mcu/attiny-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ pub mod eeprom;
#[cfg(feature = "device-selected")]
pub use eeprom::Eeprom;

#[cfg(feature = "device-selected")]
pub mod spi;
#[cfg(feature = "device-selected")]
pub use spi::Spi;

pub struct Attiny;

#[cfg(feature = "attiny84")]
Expand Down
8 changes: 4 additions & 4 deletions mcu/attiny-hal/src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub use avr_hal_generic::spi::*;

#[cfg(feature = "attiny88")]
pub type Spi = avr_hal_generic::spi::Spi<
crate::Atmega,
crate::Attiny,
crate::pac::SPI,
port::PB5,
port::PB3,
Expand All @@ -13,7 +13,7 @@ pub type Spi = avr_hal_generic::spi::Spi<
>;
#[cfg(feature = "attiny88")]
avr_hal_generic::impl_spi! {
hal: crate::Atmega,
hal: crate::Attiny,
peripheral: crate::pac::SPI,
sclk: port::PB5,
mosi: port::PB3,
Expand All @@ -23,7 +23,7 @@ avr_hal_generic::impl_spi! {

#[cfg(feature = "attiny167")]
pub type Spi = avr_hal_generic::spi::Spi<
crate::Atmega,
crate::Attiny,
crate::pac::SPI,
port::PA5,
port::PA4,
Expand All @@ -32,7 +32,7 @@ pub type Spi = avr_hal_generic::spi::Spi<
>;
#[cfg(feature = "attiny167")]
avr_hal_generic::impl_spi! {
hal: crate::Atmega,
hal: crate::Attiny,
peripheral: crate::pac::SPI,
sclk: port::PA5,
mosi: port::PA4,
Expand Down

0 comments on commit 3e36262

Please sign in to comment.