From 34861eade57937a964af7a61bd944f32b560a6c0 Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 11 May 2019 14:34:20 +0200 Subject: [PATCH] Add support for atmega8 Signed-off-by: Filip --- Cargo.toml | 1 + Makefile | 2 +- README.md | 1 + src/devices/mod.rs | 4 +- src/lib.rs | 4 +- vendor/atmega8.atdf | 962 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 971 insertions(+), 3 deletions(-) create mode 100644 vendor/atmega8.atdf diff --git a/Cargo.toml b/Cargo.toml index 00aa19c..274b61f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Rahix "] edition = "2018" [features] +atmega8 = [] atmega328p = [] atmega32u4 = [] attiny85 = [] diff --git a/Makefile b/Makefile index 4819613..c9ed4b1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all: chips -CHIPS := atmega328p atmega32u4 attiny85 +CHIPS := atmega8 atmega328p atmega32u4 attiny85 .PHONY: chips chips: $(foreach chip, $(CHIPS), src/devices/$(chip)/mod.rs) diff --git a/README.md b/README.md index 41efeed..bc7bffe 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ features = ["atmega32u4"] ``` Via the feature you can select which chip you want the register specifications for. The following list is what is currently supported: +* `atmega8` * `atmega328p` * `atmega32u4` * `attiny85` diff --git a/src/devices/mod.rs b/src/devices/mod.rs index 2f205bb..74a1043 100644 --- a/src/devices/mod.rs +++ b/src/devices/mod.rs @@ -1,5 +1,7 @@ cfg_if::cfg_if! { - if #[cfg(feature = "atmega328p")] { + if #[cfg(feature = "atmega8")] { + pub mod atmega8; + } else if #[cfg(feature = "atmega328p")] { pub mod atmega328p; } else if #[cfg(feature = "atmega32u4")] { pub mod atmega32u4; diff --git a/src/lib.rs b/src/lib.rs index 7a5bbd7..fb576ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,9 @@ mod devices; pub mod interrupt; cfg_if::cfg_if! { - if #[cfg(feature = "atmega328p")] { + if #[cfg(feature = "atmega8")] { + pub use crate::devices::atmega8::*; + } else if #[cfg(feature = "atmega328p")] { pub use crate::devices::atmega328p::*; } else if #[cfg(feature = "atmega32u4")] { pub use crate::devices::atmega32u4::*; diff --git a/vendor/atmega8.atdf b/vendor/atmega8.atdf new file mode 100644 index 0000000..1295212 --- /dev/null +++ b/vendor/atmega8.atdf @@ -0,0 +1,962 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.49.0