Skip to content
Open
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 @@ -32,6 +32,7 @@ atmega16 = ["device-selected"]
atmega16u2 = ["device-selected"]
atmega164pa = ["device-selected"]
atmega168 = ["device-selected"]
atmega169pa = ["device-selected"]
atmega2560 = ["device-selected"]
atmega8 = ["device-selected"]
atmega8u2 = ["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 atmega16u2 atmega2560 atmega8 atmega8u2 atmega324pa atmega328p atmega328pb atmega32a atmega32u2 atmega32u4 atmega3208 atmega3209 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
CHIPS := at90usb1286 atmega1280 atmega1284p atmega128a atmega128rfa1 atmega16 atmega164pa atmega168 atmega169pa atmega16u2 atmega2560 atmega8 atmega8u2 atmega324pa atmega328p atmega328pb atmega32a atmega32u2 atmega32u4 atmega3208 atmega3209 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Via the feature you can select which chip you want the register specifications f
| `atmega128rfa1` | | | | `attiny816` |
| `atmega2560` | | | | `attiny828` |
| `atmega164pa` | | | | `attiny841` |
| | | | | `attiny84a` |
| `atmega169pa` | | | | `attiny84a` |
| | | | | `attiny861` |
| | | | | `attiny1614` |
| | | | | `attiny2313` |
Expand Down
71 changes: 71 additions & 0 deletions patch/atmega169pa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
_svd: ../svd/atmega169pa.svd

_include:
- "common/ac.yaml"
- "common/adc.yaml"
- "common/spi.yaml"
- "timer/atmega169pa.yaml"

EXINT:
EIMSK:
_delete:
- PCIE
_add:
PCIE0:
description: "Pin Change Interrupt Enable 0"
bitOffset: 6
bitWidth: 1
access: read-write
PCIE1:
description: "Pin Change Interrupt Enable 1"
bitOffset: 7
bitWidth: 1
access: read-write

USART?:
UCSR?B:
_modify:
RXB8?:
access: read-only
UCSR?C:
UCSZ?:
_replace_enum:
CHR5: [0, "Character Size: 5 bit"]
CHR6: [1, "Character Size: 6 bit"]
CHR7: [2, "Character Size: 7 bit"]
CHR8: [3, "Character Size: 8 bit"]
UCPOL?:
_replace_enum:
RISING_EDGE: [0, "Transmit on Rising XCKn Edge, Receive on Falling XCKn Edge"]
FALLING_EDGE: [1, "Transmit on Falling XCKn Edge, Receive on Rising XCKn Edge"]
UMSEL?:
_replace_enum:
USART_ASYNC: [0, "Asynchronous USART"]
USART_SYNC: [1, "Synchronous USART"]
UPM?:
_replace_enum:
DISABLED: [0, "Disabled"]
PARITY_EVEN: [2, "Enabled, Even Parity"]
PARITY_ODD: [3, "Enabled, Odd Parity"]
USBS?:
_replace_enum:
STOP1: [0, "1-bit"]
STOP2: [1, "2-bit"]

WDT:
WDTCR:
_delete:
- WDP
_add:
WDPL:
description: "Watchdog Timer Prescaler - Low Bits"
bitRange: "[2:0]"
WDPL:
CYCLES_16K: [0, "- 16K (16,384) cycles, ~15ms"]
CYCLES_32K: [1, "- 32K (32,768) cycles, ~29ms"]
CYCLES_64K: [2, "- 64K (65,536) cycles, ~59ms"]
CYCLES_128K: [3, "- 128K (131,072) cycles, ~0.12s"]
CYCLES_256K: [4, "- 256K (262,144) cycles, ~0.23s"]
CYCLES_512K: [5, "- 512K (524,288) cycles, ~0.47s"]
CYCLES_1024K: [6, "- 1024K (1,048,576) cycles, ~0.9s"]
CYCLES_2048K: [7, "- 2048K (2,097,152) cycles, ~1.9s"]
77 changes: 77 additions & 0 deletions patch/timer/atmega169pa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
TC0:
TCCR?A:
_delete:
- "WGM??"
_add:
WGM00:
description: Waveform Generation Mode
bitOffset: 6
bitWidth: 1
access: read-write
WGM01:
description: Waveform Generation Mode
bitOffset: 3
bitWidth: 1
access: read-write
_modify:
COM?A:
description: "Compare Output A Mode"
_write_constraint: enum
FOC??:
access: write-only
COM??:
_replace_enum:
DISCONNECTED: [0, "Normal port operation, OCix disconnected"]
MATCH_TOGGLE: [1, "Toggle OCix on Compare Match (Might depend on WGM)"]
MATCH_CLEAR: [2, "Clear OCix on Compare Match (If PWM is enabled, OCix is set at TOP)"]
MATCH_SET: [3, "Set OCix on Compare Match (If PWM is enabled, OCix is cleared at TOP)"]
CS?:
_replace_enum:
NO_CLOCK: [0, "No clock source (Timer/Counter stopped)"]
DIRECT: [1, "Running, No Prescaling"]
PRESCALE_8: [2, "Running, CLK/8"]
PRESCALE_64: [3, "Running, CLK/64"]
PRESCALE_256: [4, "Running, CLK/256"]
PRESCALE_1024: [5, "Running, CLK/1024"]
EXT_FALLING: [6, "Running, ExtClk Tx Falling Edge"]
EXT_RISING: [7, "Running, ExtClk Tx Rising Edge"]

TC1:
_include:
- "dev/16bit.yaml"

TC2:
TCCR?A:
_delete:
- "WGM??"
_add:
WGM20:
description: Waveform Generation Mode
bitOffset: 6
bitWidth: 1
access: read-write
WGM21:
description: Waveform Generation Mode
bitOffset: 3
bitWidth: 1
access: read-write
_modify:
COM?A:
description: "Compare Output A Mode"
_write_constraint: enum
COM??:
_replace_enum:
DISCONNECTED: [0, "Normal port operation, OCix disconnected"]
MATCH_TOGGLE: [1, "Toggle OCix on Compare Match (Might depend on WGM)"]
MATCH_CLEAR: [2, "Clear OCix on Compare Match (If PWM is enabled, OCix is set at TOP)"]
MATCH_SET: [3, "Set OCix on Compare Match (If PWM is enabled, OCix is cleared at TOP)"]
CS?:
_replace_enum:
NO_CLOCK: [0, "No clock source (Timer/Counter stopped)"]
DIRECT: [1, "Running, No Prescaling"]
PRESCALE_8: [2, "Running, CLK/8"]
PRESCALE_32: [3, "Running, CLK/32"]
PRESCALE_64: [4, "Running, CLK/64"]
PRESCALE_128: [5, "Running, CLK/128"]
PRESCALE_256: [6, "Running, CLK/256"]
PRESCALE_1024: [7, "Running, CLK/1024"]
4 changes: 4 additions & 0 deletions src/devices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ pub mod atmega164pa;
#[cfg(feature = "atmega168")]
pub mod atmega168;

/// [ATmega169PA](https://www.microchip.com/en-us/product/ATmega169PA)
#[cfg(feature = "atmega169pa")]
pub mod atmega169pa;

/// [ATmega16u2](https://www.microchip.com/wwwproducts/en/ATmega16u2)
#[cfg(feature = "atmega16u2")]
pub mod atmega16u2;
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#![cfg_attr(feature = "atmega16", doc = "**atmega16**,")]
#![cfg_attr(feature = "atmega164pa", doc = "**atmega164pa**,")]
#![cfg_attr(feature = "atmega168", doc = "**atmega168**,")]
#![cfg_attr(feature = "atmega169pa", doc = "**atmega169pa**,")]
#![cfg_attr(feature = "atmega16u2", doc = "**atmega16u2**,")]
#![cfg_attr(feature = "atmega2560", doc = "**atmega2560**,")]
#![cfg_attr(feature = "atmega8", doc = "**atmega8**,")]
Expand Down Expand Up @@ -67,6 +68,7 @@
//! `atmega16`,
//! `atmega164pa`,
//! `atmega168`,
//! `atmega169pa`,
//! `atmega16u2`,
//! `atmega2560`,
//! `atmega8`,
Expand Down Expand Up @@ -240,6 +242,7 @@ compile_error!(
* atmega16
* atmega164pa
* atmega168
* atmega169pa
* atmega16u2
* atmega2560
* atmega324pa
Expand Down Expand Up @@ -304,6 +307,8 @@ pub use crate::devices::atmega16;
pub use crate::devices::atmega164pa;
#[cfg(feature = "atmega168")]
pub use crate::devices::atmega168;
#[cfg(feature = "atmega169pa")]
pub use crate::devices::atmega169pa;
#[cfg(feature = "atmega16u2")]
pub use crate::devices::atmega16u2;
#[cfg(feature = "atmega2560")]
Expand Down
Loading