no-std stm32f4

STM32F4设备的设备支持crate

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日
Download history 4348/week @ 2024-03-27 4210/week @ 2024-04-03 3731/week @ 2024-04-10 3962/week @ 2024-04-17 4031/week @ 2024-04-24 3842/week @ 2024-05-01 2783/week @ 2024-05-08 2239/week @ 2024-05-15 2531/week @ 2024-05-22 2686/week @ 2024-05-29 2357/week @ 2024-06-05 2147/week @ 2024-06-12 2916/week @ 2024-06-19 3079/week @ 2024-06-26 2619/week @ 2024-07-03 2364/week @ 2024-07-10

每月下载量11,348
用于 48 个crate(直接使用14个)

MIT/Apache

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 RM0368st.com
stm32f405 STM32F405,STM32F415 RM0090st.com
stm32f407 STM32F407,STM32F417 RM0090st.com
stm32f410 STM32F410 RM0401st.com
stm32f411 STM32F411 RM0383st.com
stm32f412 STM32F412 RM0402st.com
stm32f413 STM32F413,STM32F423 RM0430st.com
stm32f427 STM32F427,STM32F437 RM0090st.com
stm32f429 STM32F429,STM32F439 RM0090st.com
stm32f446 STM32F446 RM0390st.com
stm32f469 STM32F469, STM32F479 RM0386st.com

依赖项