13个版本 (破坏性更新)
0.10.0 | 2022年1月11日 |
---|---|
0.9.0 | 2021年9月27日 |
0.8.0 | 2021年1月1日 |
0.7.0 | 2020年11月28日 |
0.1.2 | 2019年3月17日 |
#2146 in 嵌入式开发
每月35次下载
用于 neobirth
1.5MB
24K SLoC
Adafruit NeoTrellis M4 Express开发板支持包
此包提供用于与Adafruit NeoTrellis M4板交互的类型安全Rust API。
板级功能
- Microchip ATSAMD51G Cortex-M4微控制器 @ 120 MHz (32位,3.3V逻辑和电源)
- 512kB闪存
- 192kB SRAM
- 8 MB SPI闪存芯片
- USB设备控制器(例如,MIDI)
- 带有3.3V电源、地线和两个GPIO的4-JST黑客端口(可以是I2C/ADC/UART)
- Analog Devices ADXL343 三轴加速度计
先决条件
- 安装交叉编译工具链
rustup target add thumbv7em-none-eabihf
- 安装cargo-hf2 hf2引导加载程序闪存工具,具体取决于您的平台
上传示例
查看存储库中的示例
https://github.com/atsamd-rs/atsamd/tree/master/boards/trellis_m4/examples
- 在以下目录中
cd boards/trellis_m4
- 将您的设备置于引导加载程序模式,通常通过按两次复位按钮。
- 一步构建和上传
$ cargo hf2 --release --example neopixel_rainbow
Finished release [optimized + debuginfo] target(s) in 0.19s
Searching for a connected device with known vid/pid pair.
Trying Ok(Some("Adafruit Industries")) Ok(Some("PyBadge"))
Flashing "/Users/User/atsamd/boards/trellis_m4/target/thumbv7em-none-eabihf/release/examples/neopixel_rainbow"
Finished in 0.079s
$
可选的trellis_m4
Cargo功能
以下可选硬件驱动程序可以作为cargo功能启用
要启用它们,请使用features
选项将软件包依赖项添加到您的Cargo.toml中
[dependencies]
trellis_m4 = { version = "~0.1", features = ["adxl343", "keypad-unproven"] }
或在运行示例时
$ cargo hf2 --release --example neopixel_keypad
error: target `neopixel_keypad` in package `trellis_m4` requires the features: `keypad-unproven`
Consider enabling them by passing, e.g., `--features="keypad-unproven"`
只需按照说明添加 --features,例如:
cargo hf2 --release --example neopixel_keypad --features="keypad-unproven"
Finished release [optimized + debuginfo] target(s) in 0.09s
Searching for a connected device with known vid/pid pair.
Trying Ok(Some("Adafruit Industries")) Ok(Some("PyGamer"))
Flashing "/Users/User/atsamd/boards/trellis_m4/target/thumbv7em-none-eabihf/release/examples/neopixel_keypad"
Finished in 0.167s
$
更多示例
依赖项
~7MB
~165K SLoC