12 个版本 (破坏性)
0.15.1 | 2022年7月4日 |
---|---|
0.14.0 | 2021年10月3日 |
0.13.0 | 2021年2月15日 |
0.12.1 | 2020年9月22日 |
0.6.0 | 2019年1月14日 |
#1593 in 嵌入式开发
1,970 个月下载量
在 7 个包中使用了 (直接使用 2 个)
35MB
820K SLoC
stm32g0
此包提供对 STM32G0 外设的自动生成 API。API 使用修补后的 svd 文件生成,这些文件包含广泛的支持类型安全。有关更多信息,请参阅 主仓库。
请参阅 文档 了解详细信息。
使用方法
此包支持的每个设备都在特征门后面,因此您只需编译您想要的设备。要在 Cargo.toml 中使用,请参考:
[dependencies.stm32g0]
version = "0.15.1"
features = ["stm32g030"]
rt
特性默认启用并引入了 cortex-m-rt
的支持。要禁用,请在 Cargo.toml 中指定 default-features = false
。
在您的代码中
use stm32g0::stm32g030;
let mut peripherals = stm32g030::Peripherals::take().unwrap();
let gpioa = &peripherals.GPIOA;
gpioa.odr.modify(|_, w| w.odr0().set_bit());
有关自动生成 API 的完整详细信息,请参阅: https://docs.rs/svd2rust/0.24.1/svd2rust/#peripheral-api
支持的设备
模块 | 设备 | 链接 |
---|---|---|
stm32g030 | STM32G030 | RM0454,st.com |
stm32g031 | STM32G031 | RM0444,st.com |
stm32g041 | STM32G041 | RM0444,st.com |
stm32g050 | STM32G050 | RM0454,st.com |
stm32g051 | STM32G051 | RM0444,st.com |
stm32g061 | STM32G061 | RM0444,st.com |
stm32g070 | STM32G070 | RM0454,st.com |
stm32g071 | STM32G071 | RM0444,st.com |
stm32g081 | STM32G081 | RM0444,st.com |
stm32g0b0 | STM32G0b0 | RM0454,st.com |
stm32g0b1 | STM32G0b1 | RM0444,st.com |
stm32g0c1 | STM32G0c1 | RM0444,st.com |