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
60pub use avr_device;
65
66#[cfg(feature = "device-selected")]
67pub use pac::Peripherals;
68
69pub use avr_hal_generic::clock;
70pub use avr_hal_generic::delay;
71pub use avr_hal_generic::prelude;
72
73#[cfg(all(feature = "device-selected", not(feature = "attiny2313")))]
75pub mod adc;
76#[cfg(all(feature = "device-selected", not(feature = "attiny2313")))]
77pub use adc::Adc;
78
79#[cfg(feature = "device-selected")]
80pub mod port;
81#[cfg(feature = "device-selected")]
82pub use port::Pins;
83
84#[cfg(feature = "device-selected")]
85pub mod simple_pwm;
86
87#[cfg(feature = "device-selected")]
88pub mod wdt;
89#[cfg(feature = "device-selected")]
90pub use wdt::Wdt;
91
92#[cfg(feature = "device-selected")]
93pub mod eeprom;
94#[cfg(feature = "device-selected")]
95pub use eeprom::Eeprom;
96
97#[cfg(feature = "device-selected")]
98pub mod spi;
99#[cfg(feature = "device-selected")]
100pub use spi::Spi;
101
102pub struct Attiny;
103
104#[cfg(feature = "attiny84")]
105#[macro_export]
106macro_rules! pins {
107 ($p:expr) => {
108 $crate::Pins::new($p.PORTA, $p.PORTB)
109 };
110}
111#[cfg(feature = "attiny85")]
112#[macro_export]
113macro_rules! pins {
114 ($p:expr) => {
115 $crate::Pins::new($p.PORTB)
116 };
117}
118#[cfg(feature = "attiny88")]
119#[macro_export]
120macro_rules! pins {
121 ($p:expr) => {
122 $crate::Pins::new($p.PORTA, $p.PORTB, $p.PORTC, $p.PORTD)
123 };
124}
125#[cfg(feature = "attiny167")]
126#[macro_export]
127macro_rules! pins {
128 ($p:expr) => {
129 $crate::Pins::new($p.PORTA, $p.PORTB)
130 };
131}
132#[cfg(feature = "attiny2313")]
133#[macro_export]
134macro_rules! pins {
135 ($p:expr) => {
136 $crate::Pins::new($p.PORTA, $p.PORTB, $p.PORTD)
137 };
138}