avr-hal ![Continuous Integration](https://github.com/Rahix/avr-hal/workflows/Continuous%20Integration/badge.svg) [![arduino-hal docs](https://img.shields.io/badge/docs-arduino--hal-4d76ae)][arduino-hal docs] [![atmega-hal docs](https://img.shields.io/badge/docs-atmega--hal-4d76ae)][atmega-hal docs] [![attiny-hal docs](https://img.shields.io/badge/docs-attiny--hal-4d76ae)][attiny-hal docs]
=======
Hardware Abstraction Layer for AVR microcontrollers and common boards (for example Arduino). Based on the [`avr-device`](https://github.com/Rahix/avr-device) crate.
**This is a new version of `avr-hal`! Older versions can be found in the `old` branch but will no longer get support.**
## Quickstart
You need a nightly Rust compiler for compiling Rust code for AVR. The correct version will be installed automatically due to the `rust-toolchain.toml` file.
On Ubuntu, you'll need to install dependencies:
```bash
sudo apt install avr-libc gcc-avr pkg-config avrdude
```
Next, install ["ravedude"](./ravedude), a tool which seamlessly integrates flashing your board into the usual cargo workflow:
```bash
cargo +stable install ravedude
```
Go into `./examples/arduino-uno` (or the directory for whatever board you want), and run the following commands:
```bash
cd examples/arduino-uno
# Build and run it on a connected board
cargo run --bin uno-blink
```
## Starting your own project
The best way to start your own project is via the [`avr-hal-template`](https://github.com/Rahix/avr-hal-template) which you can easily use with [`cargo-generate`](https://github.com/cargo-generate/cargo-generate):
```bash
cargo install cargo-generate
cargo generate --git https://github.com/Rahix/avr-hal-template.git
```
## Repository Structure
The `avr-hal` repository is a workspace containing all components making up the HAL. Here is an overview:
### `arduino-hal` [![arduino-hal docs](https://img.shields.io/badge/docs-git-4d76ae)][arduino-hal docs]
`arduino-hal` is the batteries-included HAL for all Arduino & similar boards. This is what you probably want to use for your projects. It is intentionally built to abstract away the differences between boards as much as possible.
### `examples/*`
The [examples directory](./examples) contains lots of examples for common hardware. Do note that not all examples were ported to all boards, but there is a good chance that you can still use the code. Currently, the [Arduino Uno](./examples/arduino-uno/) crate contains the most examples.
### `mcu/atmega-hal` [![atmega-hal docs](https://img.shields.io/badge/docs-git-4d76ae)][atmega-hal docs] , `mcu/attiny-hal` [![attiny-hal docs](https://img.shields.io/badge/docs-git-4d76ae)][attiny-hal docs]
HAL crates for AVR microcontroller families. If you have a custom board, you'll want to work with these crates. Please check their documentation for a list of supported MCUs.
### `avr-hal-generic` [![avr-hal-generic docs](https://img.shields.io/badge/docs-git-4d76ae)][avr-hal-generic docs]
This is a generic crate containing most of the HAL implementaions in the form of macros which are instanciated in each HAL crate for the specific MCUs. If you intend to write drivers that work with any AVR chip, targeting `avr-hal-generic` is probably the best route.
### `avr-specs/`
The `avr-specs/` directory contains rustc target definitions for all supported microcontrollers. You will need these for compiling rust code for AVR. The [`avr-hal-template`](https://github.com/Rahix/avr-hal-template) already includes them for convenience.
### [`ravedude`](./ravedude) [![crates.io page](https://img.shields.io/crates/v/ravedude.svg)](https://crates.io/crates/ravedude)
`ravedude` is a utility for seamlessly integrating avrdude and a serial console into the cargo workflow. With a bit of configuration (check its [README](./ravedude/README.md)!) you can then upload your code to your board and view its output over the serial console by just using `cargo run` as you would normally.
[avr-hal-generic docs]: https://rahix.github.io/avr-hal/avr_hal_generic/index.html
[arduino-hal docs]: https://rahix.github.io/avr-hal/arduino_hal/index.html
[atmega-hal docs]: https://rahix.github.io/avr-hal/atmega_hal/index.html
[attiny-hal docs]: https://rahix.github.io/avr-hal/attiny_hal/index.html
## Disclaimer
This project is not affiliated with either Microchip (former Atmel) nor any of the Vendors that created the boards supported in this repository.
## License
*avr-hal* 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.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
没有合适的资源?快使用搜索试试~ 我知道了~
AVR微控制器 的嵌入式 hal 抽象_Rust_代码_相关文件_下载
共139个文件
rs:90个
toml:26个
json:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 131 浏览量
2022-07-06
15:57:09
上传
评论
收藏 171KB ZIP 举报
温馨提示
AVR 微控制器和通用板(例如 Arduino)的硬件抽象层。基于avr-device板条箱。 快速开始 你需要一个夜间 Rust 编译器来为 AVR 编译 Rust 代码。rust-toolchain.toml由于该文件,将自动安装正确的版本。 在 Ubuntu 上,您需要安装依赖项: 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
AVR微控制器 的嵌入式 hal 抽象_Rust_代码_相关文件_下载
(139个子文件)
avrdude.conf 470KB
.gitignore 30B
.gitignore 20B
avr-atmega1280.json 578B
avr-atmega328p.json 578B
avr-atmega2560.json 578B
avr-atmega32u4.json 578B
avr-atmega168.json 576B
avr-attiny167.json 576B
avr-atmega48p.json 576B
avr-attiny88.json 574B
avr-attiny85.json 574B
LICENSE-APACHE 11KB
LICENSE-MIT 1023B
Cargo.lock 14KB
CHANGELOG.md 9KB
README.md 5KB
README.md 5KB
CHANGELOG.md 2KB
README.md 706B
sync-from-upstream.py 2KB
simple_pwm.rs 26KB
port.rs 22KB
i2c.rs 19KB
usart.rs 17KB
spi.rs 13KB
port.rs 13KB
mega2560.rs 11KB
adc.rs 9KB
board.rs 9KB
delay.rs 8KB
adc.rs 7KB
simple_pwm.rs 7KB
lib.rs 7KB
adc.rs 7KB
main.rs 5KB
port.rs 5KB
wdt.rs 5KB
simple_pwm.rs 5KB
diecimila.rs 5KB
uno.rs 5KB
trinket_pro.rs 4KB
leonardo.rs 4KB
uno-infrared.rs 4KB
uno-timer.rs 4KB
lib.rs 4KB
mod.rs 3KB
uno-millis.rs 3KB
nano168-millis.rs 3KB
usart.rs 3KB
uno-hc-sr04.rs 3KB
lib.rs 2KB
nano168-ldr.rs 2KB
promicro.rs 2KB
uno-pin-change-interrupt.rs 2KB
mega2560-adc.rs 2KB
uno-adc.rs 2KB
nano-adc.rs 2KB
uno-16chan-servo-driver.rs 2KB
uno-ext-interrupt.rs 2KB
nano168-adc.rs 2KB
uno-panic.rs 2KB
nano168-panic.rs 2KB
i2c.rs 2KB
spi.rs 2KB
leonardo-adc.rs 2KB
mod.rs 2KB
uno-manual-servo.rs 1KB
uno-spi-feedback.rs 1KB
leonardo-spi-feedback.rs 1KB
promicro-spi-feedback.rs 1KB
mega2560-spi-feedback.rs 1KB
diecimila-spi-feedback.rs 1KB
uno-i2cdetect.rs 1KB
diecimila-adc.rs 1KB
promicro-adc.rs 1KB
console.rs 1KB
clock.rs 1KB
lib.rs 1KB
nano168-watchdog.rs 1014B
ui.rs 993B
clock.rs 929B
uno-watchdog.rs 916B
delay.rs 882B
wdt.rs 856B
spi.rs 833B
diecimila-i2cdetect.rs 783B
mega2560-i2cdetect.rs 767B
nano168-i2cdetect.rs 765B
leonardo-i2cdetect.rs 765B
promicro-i2cdetect.rs 765B
leonardo-blink.rs 711B
uno-usart.rs 674B
trinket-simple-pwm.rs 662B
uno-simple-pwm.rs 660B
uno-blink.rs 642B
diecimila-usart.rs 606B
mega2560-usart.rs 598B
nano168-usart.rs 598B
leonardo-usart.rs 598B
共 139 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9149
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功