avr-device [![crates.io page](https://img.shields.io/crates/v/avr-device.svg)](https://crates.io/crates/avr-device) [![docs.rs](https://docs.rs/avr-device/badge.svg)](https://docs.rs/avr-device) ![Continuous Integration](https://github.com/Rahix/avr-device/workflows/Continuous%20Integration/badge.svg)
==========
Auto-generated wrappers around registers for AVR microcontrollers.
## Usage
Add the following to `Cargo.toml`:
```toml
[dependencies.avr-device]
version = "0.3.4"
features = ["atmega32u4"]
```
Via the feature you can select which chip you want the register specifications for. The following list is what is currently supported:
| ATmega | ATmega USB | ATmega 0,1 Series | AT90 | ATtiny |
|:---------------:|:------------:|:-----------------:|:-------------:|:-------------:|
| `atmega8` | `atmega8u2` | `atmega4809` | `at90usb1286` | `attiny13a` |
| `atmega48p` | `atmega32u4` | | | `attiny167` |
| `atmega64` | | | | `attiny202` |
| `atmega644` | | | | `attiny84` |
| `atmega168` | | | | `attiny85` |
| `atmega328p` | | | | `attiny88` |
| `atmega328pb` | | | | `attiny816` |
| `atmega1280` | | | | `attiny841` |
| `atmega1284p` | | | | `attiny861` |
| `atmega128rfa1` | | | | `attiny1614`|
| `atmega2560` | | | | `attiny2313`|
| `atmega164pa` | | | | `attiny2313a`|
## 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.3.1), [svd2rust][] (= 0.19), [form][] (>= 0.8), [rustfmt][](for the *nightly* toolchain) and [svdtools][] (>= 0.1.9) installed:
```bash
cargo install atdf2svd --version 0.3.1
cargo install svd2rust --version 0.19.0
cargo install form
rustup component add --toolchain nightly rustfmt
pip3 install --user svdtools
```
[atdf2svd]: https://github.com/Rahix/atdf2svd
[svd2rust]: https://github.com/rust-embedded/svd2rust
[form]: https://github.com/djmcgill/form
[rustfmt]: https://github.com/rust-lang/rustfmt
[svdtools]: https://github.com/stm32-rs/svdtools
Next, clone this repo and build the device definitions:
```bash
git clone https://github.com/Rahix/avr-device
cd avr-device
make
# You can build for just one specific chip using
# make atmega32u4
# I suggest building documentation as well
cargo +nightly doc --features <chip> --open
```
## Internals
*avr-device* is generated using [`atdf2svd`](https://github.com/Rahix/atdf2svd) and [`svd2rust`](https://github.com/rust-embedded/svd2rust). The vendor-provided *atdf* files can be found in `vendor/`. The intermediate svd files are patched by `svdpatch.py` (Adapted from [`svdpatch.py`](https://github.com/stm32-rs/stm32-rs/blob/master/scripts/svdpatch.py) in [stm32-rs](https://github.com/stm32-rs/stm32-rs)) with device-dependent patches in `patch/`, mainly to improve undescriptive names and missing descriptions.
### Adding a new Chip
To add a new chip, download the *atdf* from <http://packs.download.atmel.com/> (or [avr-mcu/packs/](https://github.com/avr-rust/avr-mcu/tree/master/packs)) 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 commit [290613454fbd ("Add basic support for ATmega64")](https://github.com/Rahix/avr-device/commit/290613454fbdc5e4ac98e53deccaf74dafc88963). Please adhere to the alphabetical sorting that is present so far.
Next, you **must** create a `<chipname>.yaml` in `patch/` which has at least the following content:
```yaml
_svd: ../svd/<chipname>.svd
```
If more patches need to be applied (most likely!), they should be added into this file as well. The patching format is documented in the [`svdtools` README](https://github.com/stm32-rs/svdtools#device-and-peripheral-yaml-format). Ideally, try to reuse the exisiting patches in `patch/common/` or `patch/timer/`.
Finally, try building the crate for your MCU with `make <chipname>`.
## License
*avr-device* is licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
The vendored *atdf* files are licensed under the Apache License, Version 2.0 ([LICENSE-VENDOR](vendor/LICENSE)).
没有合适的资源?快使用搜索试试~ 我知道了~
AVR微控制器的寄存器访问包_rust_代码_相关文件_下载
共112个文件
yaml:64个
atdf:28个
rs:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 54 浏览量
2022-07-06
17:18:05
上传
评论
收藏 398KB ZIP 举报
温馨提示
AVR 微控制器的寄存器周围自动生成的包装器。 通过该功能,您可以选择您想要寄存器规格的芯片。以下列表是当前支持的内容: atmega8 atmega8u2 atmega4809 at90usb1286 attiny13a atmega48p atmega32u4 attiny167 atmega64 attiny202 atmega644 attiny84 atmega168 attiny85 atmega328p 等等等等 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
AVR微控制器的寄存器访问包_rust_代码_相关文件_下载
(112个子文件)
attiny1614.atdf 258KB
attiny816.atdf 255KB
atmega128rfa1.atdf 167KB
atmega4809.atdf 167KB
attiny202.atdf 138KB
atmega2560.atdf 126KB
atmega1280.atdf 119KB
atmega328pb.atdf 97KB
atmega32u4.atdf 94KB
atmega1284p.atdf 94KB
atmega164pa.atdf 92KB
atmega64.atdf 87KB
atmega644.atdf 85KB
at90usb1286.atdf 84KB
atmega328p.atdf 79KB
atmega168.atdf 78KB
atmega48p.atdf 77KB
attiny841.atdf 76KB
atmega8u2.atdf 72KB
attiny861.atdf 64KB
atmega8.atdf 64KB
attiny167.atdf 62KB
attiny88.atdf 61KB
attiny85.atdf 55KB
attiny2313a.atdf 49KB
attiny2313.atdf 48KB
attiny84.atdf 48KB
attiny13a.atdf 40KB
.gitignore 104B
.gitignore 11B
LICENSE 589B
LICENSE-APACHE 11KB
LICENSE-MIT 1023B
Makefile 2KB
CHANGELOG.md 6KB
README.md 5KB
README.md 570B
modrs.patch 123B
mod.rs 14KB
lib.rs 9KB
lib.rs 6KB
interrupt.rs 2KB
asm.rs 1KB
build.rs 316B
gen-intr-lut.sh 686B
Cargo.toml 2KB
Cargo.toml 439B
attiny84.yaml 7KB
attiny85.yaml 3KB
attiny167.yaml 3KB
attiny88.yaml 3KB
attiny13a.yaml 2KB
10bit.yaml 2KB
8bit-tiny8n-tc0.yaml 2KB
8bit-tiny85-tc1.yaml 2KB
8bit.yaml 2KB
attiny841.yaml 2KB
8bit-async.yaml 1KB
attiny-0-series.yaml 1KB
usart.yaml 1KB
atmega328pb.yaml 1KB
usart-single-attiny2313a.yaml 1KB
attiny816.yaml 1KB
usart-single-attiny2313.yaml 1KB
wdt.yaml 1KB
pll.yaml 1005B
16bit.yaml 1001B
attiny2313-common.yaml 968B
usi.yaml 744B
atmega328pb.yaml 726B
adc.yaml 717B
twi.yaml 668B
ac.yaml 641B
atmega1284p.yaml 633B
atmega128rfa1.yaml 539B
exint.yaml 529B
16bit-tiny861-tc0.yaml 501B
spi.yaml 476B
8bit-tiny88.yaml 450B
attiny841.yaml 366B
attiny85.yaml 322B
atmega328p.yaml 315B
attiny861.yaml 303B
atmega1284p.yaml 277B
attiny84.yaml 264B
attiny88.yaml 261B
atmega1280-2560.yaml 248B
atmega2560.yaml 248B
atmega8u2.yaml 247B
atmega328p.yaml 236B
atmega32u4.yaml 235B
atmega32u4.yaml 223B
attiny13a.yaml 223B
atmega2560.yaml 206B
atmega1280.yaml 206B
atmega48p.yaml 200B
atmega644.yaml 200B
atmega168.yaml 200B
atmega64.yaml 198B
attiny2313-common.yaml 190B
共 112 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功