From 3e362624547462928a219c40f9ea8e3a64f21e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Bie=C5=84kowski?= Date: Thu, 25 Apr 2024 20:29:48 +0200 Subject: [PATCH] attiny-hal: Enabled and fixed SPI support --- mcu/attiny-hal/src/lib.rs | 5 +++++ mcu/attiny-hal/src/spi.rs | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mcu/attiny-hal/src/lib.rs b/mcu/attiny-hal/src/lib.rs index 6ffde47448..ebf3d0750d 100644 --- a/mcu/attiny-hal/src/lib.rs +++ b/mcu/attiny-hal/src/lib.rs @@ -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")] diff --git a/mcu/attiny-hal/src/spi.rs b/mcu/attiny-hal/src/spi.rs index 88c5ea0ed2..0b279f5605 100644 --- a/mcu/attiny-hal/src/spi.rs +++ b/mcu/attiny-hal/src/spi.rs @@ -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, @@ -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, @@ -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, @@ -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,