1#![no_std]
2
3#![cfg_attr(feature = "attiny85", doc = "**ATtiny85**.")]
9#![cfg_attr(feature = "attiny88", doc = "**ATtiny88**.")]
10#![cfg_attr(feature = "attiny167", doc = "**ATtiny167**.")]
11#![cfg_attr(feature = "attiny2313", doc = "**ATtiny2313**.")]
12#[cfg(all(
20 not(feature = "device-selected"),
21 not(feature = "disable-device-selection-error")
22))]
23compile_error!(
24 "This crate requires you to specify your target chip as a feature.
25
26 Please select one of the following
27
28 * attiny85
29 * attiny88
30 * attiny167
31 * attiny2313
32 "
33);
34
35#[cfg(feature = "attiny167")]
38pub use avr_device::attiny167 as pac;
39#[cfg(feature = "attiny2313")]
42pub use avr_device::attiny2313 as pac;
43#[cfg(feature = "attiny84")]
46pub use avr_device::attiny84 as pac;
47#[cfg(feature = "attiny85")]
50pub use avr_device::attiny85 as pac;
51#[cfg(feature = "attiny88")]
54pub use avr_device::attiny88 as pac;
55
56#[cfg(feature = "rt")]
58pub use avr_device::entry;
59
60#[cfg(feature = "device-selected")]
61pub use pac::Peripherals;
62
63pub use avr_hal_generic::clock;
64pub use avr_hal_generic::delay;
65pub use avr_hal_generic::prelude;
66
67#[cfg(all(feature = "device-selected", not(feature = "attiny2313")))]
69pub mod adc;
70#[cfg(all(feature = "device-selected", not(feature = "attiny2313")))]
71pub use adc::Adc;
72
73#[cfg(feature = "device-selected")]
74pub mod port;
75#[cfg(feature = "device-selected")]
76pub use port::Pins;
77
78#[cfg(feature = "device-selected")]
79pub mod simple_pwm;
80
81#[cfg(feature = "device-selected")]
82pub mod wdt;
83#[cfg(feature = "device-selected")]
84pub use wdt::Wdt;
85
86#[cfg(feature = "device-selected")]
87pub mod eeprom;
88#[cfg(feature = "device-selected")]
89pub use eeprom::Eeprom;
90
91#[cfg(feature = "device-selected")]
92pub mod spi;
93#[cfg(feature = "device-selected")]
94pub use spi::Spi;
95
96pub struct Attiny;
97
98#[cfg(feature = "attiny84")]
99#[macro_export]
100macro_rules! pins {
101 ($p:expr) => {
102 $crate::Pins::new($p.PORTA, $p.PORTB)
103 };
104}
105#[cfg(feature = "attiny85")]
106#[macro_export]
107macro_rules! pins {
108 ($p:expr) => {
109 $crate::Pins::new($p.PORTB)
110 };
111}
112#[cfg(feature = "attiny88")]
113#[macro_export]
114macro_rules! pins {
115 ($p:expr) => {
116 $crate::Pins::new($p.PORTA, $p.PORTB, $p.PORTC, $p.PORTD)
117 };
118}
119#[cfg(feature = "attiny167")]
120#[macro_export]
121macro_rules! pins {
122 ($p:expr) => {
123 $crate::Pins::new($p.PORTA, $p.PORTB)
124 };
125}
126#[cfg(feature = "attiny2313")]
127#[macro_export]
128macro_rules! pins {
129 ($p:expr) => {
130 $crate::Pins::new($p.PORTA, $p.PORTB, $p.PORTD)
131 };
132}