Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for avrTiny 1 series attiny[24]1[246] #167

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ atmega88p = ["device-selected"]
attiny13a = ["device-selected"]
attiny167 = ["device-selected"]
attiny202 = ["device-selected"]
attiny212 = ["device-selected"]
attiny214 = ["device-selected"]
attiny2313 = ["device-selected"]
attiny2313a = ["device-selected"]
attiny26 = ["device-selected"]
attiny402 = ["device-selected"]
attiny404 = ["device-selected"]
attiny412 = ["device-selected"]
attiny414 = ["device-selected"]
attiny416 = ["device-selected"]
attiny44a = ["device-selected"]
attiny816 = ["device-selected"]
attiny828 = ["device-selected"]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
all: deps chips

CHIPS := at90usb1286 atmega1280 atmega1284p atmega128a atmega128rfa1 atmega16 atmega164pa atmega168 atmega2560 atmega8 atmega8u2 atmega324pa atmega328p atmega328pb atmega32a atmega32u4 atmega4808 atmega4809 atmega48p atmega64 atmega644 atmega88p attiny13a attiny202 attiny2313 attiny2313a attiny26 attiny402 attiny404 attiny44a attiny84 attiny85 attiny88 attiny816 attiny828 attiny841 attiny84a attiny861 attiny167 attiny1614 avr64du32 avr64du28
CHIPS := at90usb1286 atmega1280 atmega1284p atmega128a atmega128rfa1 atmega16 atmega164pa atmega168 atmega2560 atmega8 atmega8u2 atmega324pa atmega328p atmega328pb atmega32a atmega32u4 atmega4808 atmega4809 atmega48p atmega64 atmega644 atmega88p attiny13a attiny202 attiny212 attiny214 attiny2313 attiny2313a attiny26 attiny402 attiny404 attiny412 attiny414 attiny416 attiny44a attiny84 attiny85 attiny88 attiny816 attiny828 attiny841 attiny84a attiny861 attiny167 attiny1614 avr64du32 avr64du28

RUSTUP_TOOLCHAIN ?= nightly

Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,25 @@ Via the feature you can select which chip you want the register specifications f
| `atmega8` | `atmega8u2` | `atmega4808` | `at90usb1286` | `attiny13a` |
| `atmega48p` | `atmega32u4` | `atmega4809` | | `attiny167` |
| `atmega64` | `avr64du32` | | | `attiny202` |
| `atmega644` | `avr64du28` | | | `attiny402` |
| `atmega88p` | | | | `attiny404` |
| `atmega16` | | | | `attiny44a` |
| `atmega168` | | | | `attiny84` |
| `atmega324pa` | | | | `attiny85` |
| `atmega328p` | | | | `attiny88` |
| `atmega328pb` | | | | `attiny816` |
| `atmega32a` | | | | `attiny828` |
| `atmega1280` | | | | `attiny841` |
| `atmega1284p` | | | | `attiny84a` |
| `atmega128a` | | | | `attiny861` |
| `atmega128rfa1` | | | | `attiny1614` |
| `atmega2560` | | | | `attiny2313` |
| `atmega164pa` | | | | `attiny2313a` |
| `atmega644` | `avr64du28` | | | `attiny212` |
| `atmega88p` | | | | `attiny214` |
| `atmega16` | | | | `attiny402` |
| `atmega168` | | | | `attiny404` |
| `atmega324pa` | | | | `attiny412` |
| `atmega328p` | | | | `attiny414` |
| `atmega328pb` | | | | `attiny416` |
| `atmega32a` | | | | `attiny44a` |
| `atmega1280` | | | | `attiny84` |
| `atmega1284p` | | | | `attiny85` |
| `atmega128a` | | | | `attiny88` |
| `atmega128rfa1` | | | | `attiny816` |
| `atmega2560` | | | | `attiny828` |
| `atmega164pa` | | | | `attiny841` |
| | | | | `attiny84a` |
| | | | | `attiny861` |
| | | | | `attiny1614` |
| | | | | `attiny2313` |
| | | | | `attiny2313a` |

## Build Instructions
The version on `crates.io` is pre-built. The following is only necessary when trying to build this crate from source.
Expand Down
5 changes: 5 additions & 0 deletions patch/attiny212.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_svd: ../svd/attiny212.svd

_include:
- common/attiny-0-series.yaml
- common/attiny-1-series.yaml
5 changes: 5 additions & 0 deletions patch/attiny214.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_svd: ../svd/attiny214.svd

_include:
- common/attiny-0-series.yaml
- common/attiny-1-series.yaml
5 changes: 5 additions & 0 deletions patch/attiny412.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_svd: ../svd/attiny412.svd

_include:
- common/attiny-0-series.yaml
- common/attiny-1-series.yaml
5 changes: 5 additions & 0 deletions patch/attiny414.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_svd: ../svd/attiny414.svd

_include:
- common/attiny-0-series.yaml
- common/attiny-1-series.yaml
5 changes: 5 additions & 0 deletions patch/attiny416.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_svd: ../svd/attiny416.svd

_include:
- common/attiny-0-series.yaml
- common/attiny-1-series.yaml
6 changes: 3 additions & 3 deletions patch/common/attiny-0-series.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This is probably good for at least ATtiny202/204/402/404/406, but may not be valid for ATtiny80* and ATtiny160*
# This is also good for ATtiny212/214/412/414/416, but may not be valid for ATtiny81* and ATtiny161*

TCB0:
CTRLB:
Expand Down Expand Up @@ -46,12 +47,11 @@ SIGROW:
"TEMPSENSE1":
description: "Temperature Sensor Calibration: Offset"
_array:
"DEVICEID*" : {}
"SERNUM*" : {}
"DEVICEID*": {}
"SERNUM*": {}

# All FUSEs are read-only from the CPU (can only be modified with UPDI)
FUSE:
_modify:
"*":
access: read-only

4 changes: 4 additions & 0 deletions patch/common/attiny-1-series.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Nothing needed beyond what we already have for the 0-series
# This is probably good for at least ATtiny212/214/412/414/416, but may not be valid for ATtiny81* and ATtiny161*

{}
20 changes: 20 additions & 0 deletions src/devices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ pub mod attiny1614;
#[cfg(feature = "attiny202")]
pub mod attiny202;

/// [ATtiny212](https://www.microchip.com/wwwproducts/en/ATtiny212)
#[cfg(feature = "attiny212")]
pub mod attiny212;

/// [ATtiny214](https://www.microchip.com/wwwproducts/en/ATtiny214)
#[cfg(feature = "attiny214")]
pub mod attiny214;

/// [ATtiny2313](https://www.microchip.com/wwwproducts/en/ATtiny2313)
#[cfg(feature = "attiny2313")]
pub mod attiny2313;
Expand All @@ -127,6 +135,18 @@ pub mod attiny402;
#[cfg(feature = "attiny404")]
pub mod attiny404;

/// [ATtiny412](https://www.microchip.com/wwwproducts/en/ATtiny412)
#[cfg(feature = "attiny412")]
pub mod attiny412;

/// [ATtiny414](https://www.microchip.com/wwwproducts/en/ATtiny414)
#[cfg(feature = "attiny414")]
pub mod attiny414;

/// [ATtiny416](https://www.microchip.com/wwwproducts/en/ATtiny416)
#[cfg(feature = "attiny416")]
pub mod attiny416;

/// [ATtiny44a](https://www.microchip.com/en-us/product/ATtiny44a)
#[cfg(feature = "attiny44a")]
pub mod attiny44a;
Expand Down
25 changes: 25 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@
#![cfg_attr(feature = "attiny167", doc = "**attiny167**,")]
#![cfg_attr(feature = "attiny1614", doc = "**attiny1614**,")]
#![cfg_attr(feature = "attiny202", doc = "**attiny202**,")]
#![cfg_attr(feature = "attiny212", doc = "**attiny212**,")]
#![cfg_attr(feature = "attiny214", doc = "**attiny214**,")]
#![cfg_attr(feature = "attiny2313", doc = "**attiny2313**,")]
#![cfg_attr(feature = "attiny2313a", doc = "**attiny2313a**,")]
#![cfg_attr(feature = "attiny26", doc = "**attiny26**,")]
#![cfg_attr(feature = "attiny402", doc = "**attiny402**,")]
#![cfg_attr(feature = "attiny404", doc = "**attiny404**,")]
#![cfg_attr(feature = "attiny412", doc = "**attiny412**,")]
#![cfg_attr(feature = "attiny414", doc = "**attiny414**,")]
#![cfg_attr(feature = "attiny416", doc = "**attiny416**,")]
#![cfg_attr(feature = "attiny44a", doc = "**attiny44a**,")]
#![cfg_attr(feature = "attiny816", doc = "**attiny816**,")]
#![cfg_attr(feature = "attiny828", doc = "**attiny828**,")]
Expand Down Expand Up @@ -76,11 +81,16 @@
//! `attiny167`,
//! `attiny1614`,
//! `attiny202`,
//! `attiny212`,
//! `attiny214`,
//! `attiny2313`,
//! `attiny2313a`,
//! `attiny26`,
//! `attiny402`,
//! `attiny404`,
//! `attiny412`,
//! `attiny414`,
//! `attiny416`,
//! `attiny44a`,
//! `attiny816`,
//! `attiny828`,
Expand Down Expand Up @@ -240,10 +250,15 @@ compile_error!(
* attiny167
* attiny1614
* attiny202
* attiny212
* attiny214
* attiny2313
* attiny2313a
* attiny26
* attiny402
* attiny412
* attiny414
* attiny416
* attiny44a
* attiny816
* attiny828
Expand Down Expand Up @@ -313,6 +328,10 @@ pub use crate::devices::attiny1614;
pub use crate::devices::attiny167;
#[cfg(feature = "attiny202")]
pub use crate::devices::attiny202;
#[cfg(feature = "attiny212")]
pub use crate::devices::attiny212;
#[cfg(feature = "attiny214")]
pub use crate::devices::attiny214;
#[cfg(feature = "attiny2313")]
pub use crate::devices::attiny2313;
#[cfg(feature = "attiny2313a")]
Expand All @@ -323,6 +342,12 @@ pub use crate::devices::attiny26;
pub use crate::devices::attiny402;
#[cfg(feature = "attiny404")]
pub use crate::devices::attiny404;
#[cfg(feature = "attiny412")]
pub use crate::devices::attiny412;
#[cfg(feature = "attiny414")]
pub use crate::devices::attiny414;
#[cfg(feature = "attiny416")]
pub use crate::devices::attiny416;
#[cfg(feature = "attiny44a")]
pub use crate::devices::attiny44a;
#[cfg(feature = "attiny816")]
Expand Down
Loading
Loading