Skip to content
forked from Rahix/avr-device

Register access crate for AVR microcontrollers

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

octycs/avr-device

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

avr-device

Auto-generated wrappers around registers for avr chips.

Usage

You need to have atdf2svd, svd2rust, form, and rustfmt installed:

rustup component add rustfmt
cargo install form
cargo install svd2rust
git clone https://github.com/Rahix/atdf2svd
cd atdf2svd
cargo install --path .

Next, clone this repo and build the device definitions:

git clone https://github.com/Rahix/avr-device
cd avr-device
make
# You can build for just one specific chip using
make src/devices/<chip>/mod.rs
# I suggest building documentation as well
cargo +nightly doc --features <chip> --open

In your project add the following lines to Cargo.toml:

[dependencies.avr-device]
path = "path/to/avr-device/"
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

Internals

avr-device is generated using atdf2svd and svd2rust. The vendor-provided atdf files can be found in vendor/. Later on, we intend to add support for patching the svd files because some information in the provided files is not quite as good as it should be (mainly undescriptive names and missing descriptions).

Adding a new Chip

To add a new chip, download the atdf from http://packs.download.atmel.com/ and place it in vendor/. Be sure to name it like the Rust module that should be generated. Next, you need to integrate it into the base crate and build system. Follow what was done in this commit. Please adhere to the alphabetical sorting that is present so far.

License

avr-device is licensed under either of

at your option.

The vendored atdf files are licensed under the Apache License, Version 2.0 (LICENSE-VENDOR).

About

Register access crate for AVR microcontrollers

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 76.1%
  • Makefile 23.9%