#hal #hardware-abstraction #cortex-m #arm #stm32f0xx

no-std stm32f0xx-hal

Peripheral access API for STM32F0 series microcontrollers

18 releases (11 breaking)

0.18.0 Nov 14, 2021
0.17.1 Aug 30, 2020
0.17.0 Jun 27, 2020
0.16.0 Feb 2, 2020
0.10.1 Dec 25, 2018

#1544 in Embedded development

Download history 141/week @ 2024-07-19 311/week @ 2024-07-26 158/week @ 2024-08-02 219/week @ 2024-08-09 139/week @ 2024-08-16 121/week @ 2024-08-23 150/week @ 2024-08-30 161/week @ 2024-09-06 137/week @ 2024-09-13 251/week @ 2024-09-20 125/week @ 2024-09-27 56/week @ 2024-10-04 44/week @ 2024-10-11 59/week @ 2024-10-18 55/week @ 2024-10-25 38/week @ 2024-11-01

199 downloads per month
Used in 4 crates

0BSD license

190KB
4.5K SLoC

stm32f0xx-hal

Continuous integration Crates.io docs.rs

stm32f0xx-hal contains a hardware abstraction on top of the peripheral access API for the STMicro STM32F0xx family of microcontrollers.

This crate replaces the stm32f042-hal by a more ubiquitous version suitable for additional families. The idea behind this crate is to gloss over the slight differences in the various peripherals available on those MCUs so a HAL can be written for all chips in that same family without having to cut and paste crates for every single model.

This crate relies on Adam Greig's fantastic stm32f0 crate to provide appropriate register definitions, and implements a partial set of the embedded-hal traits. Some of the implementation was shamelessly adapted from the stm32f103xx-hal crate by Jorge Aparicio.

Collaboration on this crate is highly welcome, as are pull requests!

Supported Configurations

  • stm32f030 (stm32f030x4, stm32f030x6, stm32f030x8, stm32f030xc)
  • stm32f031
  • stm32f038
  • stm32f042
  • stm32f048
  • stm32f051
  • stm32f058
  • stm32f070 (stm32f070x6, stm32f070xb)
  • stm32f071
  • stm32f072
  • stm32f078
  • stm32f091
  • stm32f098

Getting Started

The examples folder contains several example programs. To compile them, one must specify the target device as cargo feature:

$ cargo build --features=stm32f030

To use stm32f0xx-hal as a dependency in a standalone project the target device feature must be specified in the Cargo.toml file:

[dependencies]
cortex-m = "0.7"
cortex-m-rt = "0.7"
stm32f0xx-hal = { version = "0.18", features = ["stm32f030"]}

If you are unfamiliar with embedded development using Rust, there are a number of fantastic resources available to help.

Minimum supported Rust version

The minimum supported Rust version is the latest stable release. Older versions may compile, especially when some features are not used in your application.

Changelog

See CHANGELOG.md.

License

0-Clause BSD License, see LICENSE-0BSD.txt for more details.

Dependencies

~13MB
~371K SLoC