#register #flash #interrupt #data #stm32 #channel #dma

stm32-metapac

Peripheral Access Crate (PAC) for all STM32 chips, including metadata

16 stable releases (16 major)

new 16.0.0 Jan 10, 2025
15.0.0 Jan 11, 2024
14.0.0 Sep 25, 2023
13.0.0 Jul 22, 2023
0.0.0 Jun 15, 2021

#65 in Hardware support

Download history 995/week @ 2024-09-20 593/week @ 2024-09-27 618/week @ 2024-10-04 580/week @ 2024-10-11 681/week @ 2024-10-18 536/week @ 2024-10-25 973/week @ 2024-11-01 881/week @ 2024-11-08 836/week @ 2024-11-15 1327/week @ 2024-11-22 1058/week @ 2024-11-29 1685/week @ 2024-12-06 1634/week @ 2024-12-13 593/week @ 2024-12-20 522/week @ 2024-12-27 1297/week @ 2025-01-03

4,328 downloads per month
Used in 14 crates (2 directly)

MIT/Apache

203MB
7M SLoC

stm32-metapac

This is a Peripheral Access Crate for STMicroelectronics STM32 microcontrollers.

This crate has been automatically generated based on data in the stm32-data project, and is used for the embassy-stm32 Rust Hardware Abstraction Layer (HAL) for the STM32 microcontrollers.

Metadata

This PAC additionally exports "metadata" about the chips. To use it, enable the metadata feature and access it at stm32_metapac::METADATA. It is intended to be consumed from build.rs scripts or code-generation tools running on PCs, not from the firmware itself.

The metadata includes the following info:

  • Memory maps for RAM, flash.
  • Interrupts
  • GPIO Alternate Function mappings
  • Interrupt -> peripheral mappings
  • DMA channel -> peripehral mappings
  • RCC clock tree information for each peripheral (what clocks does it receive, which RCC registers to poke to enable, reset, or choose the clock)

Supported chips

This PAC aims to support all STM32 chip families:

  • STM32F0
  • STM32F1
  • STM32F2
  • STM32F3
  • STM32F4
  • STM32F7
  • STM32C0
  • STM32G0
  • STM32G4
  • STM32H5
  • STM32H7
  • STM32H7RS
  • STM32L0
  • STM32L1
  • STM32L4
  • STM32L5
  • STM32U0
  • STM32U5
  • STM32WB
  • STM32WBA
  • STM32WL

Dependencies