#![no_std]
#![cfg_attr(feature = "attiny85", doc = "**ATtiny85**.")]
#![cfg_attr(feature = "attiny88", doc = "**ATtiny88**.")]
#![cfg_attr(feature = "attiny167", doc = "**ATtiny167**.")]
#![cfg_attr(feature = "attiny2313", doc = "**ATtiny2313**.")]
#[cfg(all(
not(feature = "device-selected"),
not(feature = "disable-device-selection-error")
))]
compile_error!(
"This crate requires you to specify your target chip as a feature.
Please select one of the following
* attiny85
* attiny88
* attiny167
* attiny2313
"
);
#[cfg(feature = "attiny167")]
pub use avr_device::attiny167 as pac;
#[cfg(feature = "attiny2313")]
pub use avr_device::attiny2313 as pac;
#[cfg(feature = "attiny84")]
pub use avr_device::attiny84 as pac;
#[cfg(feature = "attiny85")]
pub use avr_device::attiny85 as pac;
#[cfg(feature = "attiny88")]
pub use avr_device::attiny88 as pac;
#[cfg(feature = "rt")]
pub use avr_device::entry;
#[cfg(feature = "device-selected")]
pub use pac::Peripherals;
pub use avr_hal_generic::clock;
pub use avr_hal_generic::delay;
pub use avr_hal_generic::prelude;
#[cfg(all(feature = "device-selected", not(feature = "attiny2313")))]
pub mod adc;
#[cfg(all(feature = "device-selected", not(feature = "attiny2313")))]
pub use adc::Adc;
#[cfg(feature = "device-selected")]
pub mod port;
#[cfg(feature = "device-selected")]
pub use port::Pins;
#[cfg(feature = "device-selected")]
pub mod simple_pwm;
#[cfg(feature = "device-selected")]
pub mod wdt;
#[cfg(feature = "device-selected")]
pub use wdt::Wdt;
#[cfg(feature = "device-selected")]
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")]
#[macro_export]
macro_rules! pins {
($p:expr) => {
$crate::Pins::new($p.PORTA, $p.PORTB)
};
}
#[cfg(feature = "attiny85")]
#[macro_export]
macro_rules! pins {
($p:expr) => {
$crate::Pins::new($p.PORTB)
};
}
#[cfg(feature = "attiny88")]
#[macro_export]
macro_rules! pins {
($p:expr) => {
$crate::Pins::new($p.PORTA, $p.PORTB, $p.PORTC, $p.PORTD)
};
}
#[cfg(feature = "attiny167")]
#[macro_export]
macro_rules! pins {
($p:expr) => {
$crate::Pins::new($p.PORTA, $p.PORTB)
};
}
#[cfg(feature = "attiny2313")]
#[macro_export]
macro_rules! pins {
($p:expr) => {
$crate::Pins::new($p.PORTA, $p.PORTB, $p.PORTD)
};
}