22个版本 (14个破坏性版本)
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.2.2 | 2018年7月11日 |
每月下载量11,348
用于 48 个crate(直接使用14个)
49MB
1.5M SLoC
stm32f4
这个crate提供访问STM32F4外设的自生成的API。API使用svd2rust和修补的svd文件生成,这些文件包含广泛的安全类型支持。更多信息请参阅主仓库。
请参阅文档以获取完整详细信息。
用法
此crate支持的每个设备都由一个功能门控器后置,这样你只需编译你想要的设备。要使用,在Cargo.toml中
[dependencies.stm32f4]
version = "0.15.1"
features = ["stm32f401"]
默认启用rt
功能,并引入对cortex-m-rt
的支持。要禁用,请在Cargo.toml
中指定default-features = false
。
在您的代码中
use stm32f4::stm32f401;
let mut peripherals = stm32f401::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
支持的设备
模块 | 设备 | 链接 |
---|---|---|
stm32f401 | STM32F401 | RM0368,st.com |
stm32f405 | STM32F405,STM32F415 | RM0090,st.com |
stm32f407 | STM32F407,STM32F417 | RM0090,st.com |
stm32f410 | STM32F410 | RM0401,st.com |
stm32f411 | STM32F411 | RM0383,st.com |
stm32f412 | STM32F412 | RM0402,st.com |
stm32f413 | STM32F413,STM32F423 | RM0430,st.com |
stm32f427 | STM32F427,STM32F437 | RM0090,st.com |
stm32f429 | STM32F429,STM32F439 | RM0090,st.com |
stm32f446 | STM32F446 | RM0390,st.com |
stm32f469 | STM32F469, STM32F479 | RM0386,st.com |