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

Add initial support for attiny1614. #90

Merged
merged 1 commit into from
Oct 18, 2021
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ attiny841 = ["device-selected"]
attiny85 = ["device-selected"]
attiny861 = ["device-selected"]
attiny88 = ["device-selected"]
attiny1614 = ["device-selected"]
rt = ["avr-device-macros"]

[dependencies]
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 atmega168 atmega2560 atmega8 atmega8u2 atmega328p atmega328pb atmega32u4 atmega4809 atmega48p atmega64 atmega644 attiny202 attiny2313 attiny2313a attiny84 attiny85 attiny88 attiny816 attiny841 attiny861 attiny167
CHIPS := at90usb1286 atmega1280 atmega168 atmega2560 atmega8 atmega8u2 atmega328p atmega328pb atmega32u4 atmega4809 atmega48p atmega64 atmega644 attiny202 attiny2313 attiny2313a attiny84 attiny85 attiny88 attiny816 attiny841 attiny861 attiny167 attiny1614

RUSTUP_TOOLCHAIN ?= nightly

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Via the feature you can select which chip you want the register specifications f
| `atmega328p` | | | | `attiny816` |
| `atmega328pb` | | | | `attiny841` |
| `atmega1280` | | | | `attiny861` |
| `atmega2560` | | | | `attiny2313` |
| `atmega2560` | | | | `attiny1614` |
| | | | | `attiny2313` |
| | | | | `attiny2313a` |

## Build Instructions
Expand Down
1 change: 1 addition & 0 deletions patch/attiny1614.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_svd: ../svd/attiny1614.svd
19 changes: 19 additions & 0 deletions src/devices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,25 @@ impl attiny167::Peripherals {
}
}

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

#[cfg(feature = "attiny1614")]
impl attiny1614::Peripherals {
/// Returns all the peripherals *once*
#[inline]
pub fn take() -> Option<Self> {
crate::interrupt::free(|_| {
if unsafe { DEVICE_PERIPHERALS } {
None
} else {
Some(unsafe { attiny1614::Peripherals::steal() })
}
})
}
}

/// [ATtiny202](https://www.microchip.com/wwwproducts/en/ATtiny202)
#[cfg(feature = "attiny202")]
pub mod attiny202;
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#![cfg_attr(feature = "atmega64", doc = "**atmega64**,")]
#![cfg_attr(feature = "atmega644", doc = "**atmega644**,")]
#![cfg_attr(feature = "attiny167", doc = "**attiny167**,")]
#![cfg_attr(feature = "attiny1614", doc = "**attiny1614**,")]
#![cfg_attr(feature = "attiny202", doc = "**attiny202**,")]
#![cfg_attr(feature = "attiny2313", doc = "**attiny2313**,")]
#![cfg_attr(feature = "attiny2313a", doc = "**attiny2313a**,")]
Expand Down Expand Up @@ -40,6 +41,7 @@
//! * `atmega64`
//! * `atmega644`
//! * `attiny167`
//! * `attiny1614`
//! * `attiny202`
//! * `attiny2313`
//! * `attiny2313a`
Expand Down Expand Up @@ -113,6 +115,7 @@ compile_error!(
* atmega8
* atmega8u2
* attiny167
* attiny1614
* attiny202
* attiny2313
* attiny2313a
Expand Down Expand Up @@ -156,6 +159,8 @@ pub use crate::devices::atmega8;
pub use crate::devices::atmega8u2;
#[cfg(feature = "attiny167")]
pub use crate::devices::attiny167;
#[cfg(feature = "attiny1614")]
pub use crate::devices::attiny1614;
#[cfg(feature = "attiny202")]
pub use crate::devices::attiny202;
#[cfg(feature = "attiny2313")]
Expand Down
Loading