From 8b1679a89704f5a303a1578b261aa2aee53e1251 Mon Sep 17 00:00:00 2001 From: Rahix Date: Thu, 9 May 2019 11:03:18 +0200 Subject: [PATCH] Add support for atmega328p Signed-off-by: Rahix --- Cargo.toml | 1 + Makefile | 2 +- README.md | 1 + src/devices/mod.rs | 4 +- src/lib.rs | 4 +- vendor/atmega328p.atdf | 1199 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1208 insertions(+), 3 deletions(-) create mode 100644 vendor/atmega328p.atdf diff --git a/Cargo.toml b/Cargo.toml index 1598624..00aa19c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ authors = ["Rahix "] edition = "2018" [features] +atmega328p = [] atmega32u4 = [] attiny85 = [] diff --git a/Makefile b/Makefile index fe6a5e9..4819613 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all: chips -CHIPS := atmega32u4 attiny85 +CHIPS := atmega328p atmega32u4 attiny85 .PHONY: chips chips: $(foreach chip, $(CHIPS), src/devices/$(chip)/mod.rs) diff --git a/README.md b/README.md index be6337d..81de38a 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: +* `atmega328p` * `atmega32u4` * `attiny85` diff --git a/src/devices/mod.rs b/src/devices/mod.rs index 0ef1b14..2f205bb 100644 --- a/src/devices/mod.rs +++ b/src/devices/mod.rs @@ -1,5 +1,7 @@ cfg_if::cfg_if! { - if #[cfg(feature = "atmega32u4")] { + if #[cfg(feature = "atmega328p")] { + pub mod atmega328p; + } else if #[cfg(feature = "atmega32u4")] { pub mod atmega32u4; } else if #[cfg(feature = "attiny85")] { pub mod attiny85; diff --git a/src/lib.rs b/src/lib.rs index e9f6a60..7a5bbd7 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 = "atmega32u4")] { + if #[cfg(feature = "atmega328p")] { + pub use crate::devices::atmega328p::*; + } else if #[cfg(feature = "atmega32u4")] { pub use crate::devices::atmega32u4::*; } else if #[cfg(feature = "attiny85")] { pub use crate::devices::attiny85::*; diff --git a/vendor/atmega328p.atdf b/vendor/atmega328p.atdf new file mode 100644 index 0000000..9bfb85b --- /dev/null +++ b/vendor/atmega328p.atdf @@ -0,0 +1,1199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.49.0