Skip to content
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
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,13 @@ jobs:
with:
toolchain: stable

# Python Dependencies
- name: Install Python dependencies
run: |
pip3 install --user setuptools wheel
pip3 install --user svdtools
- name: Put pip binary directory into path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

# Rust Dependencies
- name: Cache Cargo installed binaries
uses: actions/cache@v4
id: cache-cargo
with:
path: ~/cargo-bin
key: rust-tools-20250104-001
key: rust-tools-20250106-001
- name: Install svd2rust
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install svd2rust --version 0.28.0 --locked
Expand All @@ -44,13 +36,17 @@ jobs:
- name: Install atdf2svd
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install atdf2svd --version 0.5.0 --locked
- name: Install svdtools
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install svdtools --version 0.4.0 --locked
- name: Copy tools to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
mkdir ~/cargo-bin
cp ~/.cargo/bin/svd2rust ~/cargo-bin
cp ~/.cargo/bin/form ~/cargo-bin
cp ~/.cargo/bin/atdf2svd ~/cargo-bin
cp ~/.cargo/bin/svdtools ~/cargo-bin
- name: Put new cargo binary directory into path
run: echo "$HOME/cargo-bin" >> $GITHUB_PATH

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ svd/%.svd: vendor/%.atdf
svd/%.svd.patched: svd/%.svd .deps/%.d patch/%.yaml
@if [ -f patch/$*.yaml ] ; then \
echo -e "\tPATCH\t\t$*"; \
svd patch patch/$*.yaml; \
svdtools patch patch/$*.yaml; \
test -e $@; \
else \
echo -e "\t - No patches found for $*"; \
Expand Down Expand Up @@ -75,6 +75,6 @@ patch/%.yaml: .deps/%.d
.deps/%.d: patch/%.yaml
@mkdir -p .deps
@echo -e "\tMAKEDEPS\t$*"
@svd makedeps $< $@
@svdtools makedeps $< $@

-include $(DEPS)
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,13 @@ Via the feature you can select which chip you want the register specifications f
## Build Instructions
The version on `crates.io` is pre-built. The following is only necessary when trying to build this crate from source.

You need to have [atdf2svd][] (= 0.5.0), [svd2rust][] (= 0.28), [form][] (>= 0.8), [rustfmt][](for the *nightly* toolchain) and [svdtools][] (>= 0.1.9) installed:
You need to have [atdf2svd][] (= 0.5.0), [svd2rust][] (= 0.28), [form][] (>= 0.8), [rustfmt][](for the *nightly* toolchain) and [svdtools][] (= 0.4.0) installed:
```bash
cargo install atdf2svd --version 0.5.0 --locked
cargo install svd2rust --version 0.28.0 --locked
cargo install form
rustup component add --toolchain nightly rustfmt
pip3 install --user svdtools

# check svdtools
svd --version
# if a "command not found" error is printed instead of a version,
# either svdtools is installed incorrectly, or its installation path is missing from the PATH variable.
# Temporary solution to PATH variable issue is to manually add the path. Like so:
export PATH=$PATH:~/.local/bin
cargo install svdtools --version 0.4.0 --locked
```

[atdf2svd]: https://github.com/Rahix/atdf2svd
Expand Down
2 changes: 1 addition & 1 deletion gen-intr-lut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for intr_path in "$@"; do
chip="$(basename "${intr_path%.svd.patched}")"
echo " \"$chip\" => match intr {"
# toupper() to be compliant with svd2rust interrupts name
svd interrupts --no-gaps $intr_path | awk '{print " \""toupper(substr($2, 1, length($2)-1))"\"" " => Some(" $1"),"}'
svdtools interrupts --no-gaps $intr_path | awk '{print " \""toupper(substr($2, 1, length($2)-1))"\"" " => Some(" $1"),"}'
echo " _ => None,"
echo " },"
done
Expand Down
3 changes: 2 additions & 1 deletion patch/atmega8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ ADC:
USART:
UCSRA:
_modify:
PE:
UPE:
name: PE
access: read-only
DOR:
access: read-only
Expand Down
2 changes: 1 addition & 1 deletion patch/attiny13a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CPU:
PRESCALER_256: [8, "Prescaler Value 256"]
MCUCR:
_delete:
ISC?:
- ISC?
_add:
BODS:
description: "BOD Sleep (available on some devices)"
Expand Down
2 changes: 1 addition & 1 deletion patch/attiny85.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CPU:
PRESCALER_256: [8, "Prescaler Value 256"]
MCUCR:
_delete:
ISC?:
- ISC?
_add:
BODS:
description: "BOD Sleep (available on some devices)"
Expand Down
2 changes: 1 addition & 1 deletion patch/common/ac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AC:
_modify:
ACIS,ACIS?:
description: "Analog Comparator Interrupt Mode Select"
ACO:
ACO*:
access: read-only
ACIS,ACIS?:
_replace_enum:
Expand Down
2 changes: 1 addition & 1 deletion patch/common/attiny-xmega/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ FUSE:
"*":
access: read-only

PORT*:
PORT[A-Z]:
_modify:
# 'in' is reserved
IN:
Expand Down
8 changes: 4 additions & 4 deletions patch/common/mega0/port.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORTC:
_delete:
OUTSET:
- OUTSET
_add:
OUTSET:
description: Output Value Set
Expand All @@ -26,7 +26,7 @@ PORTC:
access: read-write
PORTD:
_delete:
OUTSET:
- OUTSET
_add:
OUTSET:
description: Output Value Set
Expand Down Expand Up @@ -69,7 +69,7 @@ PORTD:

PORTF:
_delete:
OUTSET:
- OUTSET
_add:
OUTSET:
description: Output Value Set
Expand Down Expand Up @@ -104,4 +104,4 @@ PORTF:
PF6:
description: Pin F6
bitRange: "[6:6]"
access: read-write
access: read-write
2 changes: 1 addition & 1 deletion patch/common/tiny/exint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EXINT:
MCUCR:
_delete:
ISC??:
- ISC??
_add:
ISC0:
description: "Interrupt Sense Control 0 bits"
Expand Down
2 changes: 1 addition & 1 deletion patch/common/twi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TWI*:
access: read-only
TWAMR:
_modify:
TWAM:
TWAM*:
description: "TWI (Slave) Address Mask Bits"
TWSR:
_modify:
Expand Down
Loading