Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 3.1 KB

README.md

File metadata and controls

79 lines (61 loc) · 3.1 KB

stm32wlxx-hal

CI stable-docs nightly-docs crates.io rustc

Embedded rust HAL (hardware abstraction layer) for the STM32WL series.

This is still in development, the code that exists today covers basic usage of:

  • SubGHz LoRa TX + RX
  • SubGHz (G)FSK TX + RX
  • SPI
  • GPIO
  • UART
  • I2C
  • Low-power timers
  • ADC
  • DAC
  • PKA ECDSA signing + verification
  • Secure random number generation
  • AES ECB encryption + decryption
  • RTC date and time

Usage

[dependencies.stm32wlxx-hal]
version = "0.6.1"
features = [
    # use exactly one to match your target hardware
    "stm32wl5x_cm0p",
    "stm32wl5x_cm4",
    "stm32wle5",
    # optional: use the cortex-m-rt interrupt interface
    "rt",
    # optional: use defmt
    "defmt",
    # optional: enable conversions with embedded-time types
    "embedded-time",
    # optional: use the real time clock (RTC)
    "chrono",
]

Examples

All examples run on the NUCLEO-WL55JC2.

Most examples are written in the form of on-target tests. See testsuite/README.md for details.

There are also simple examples located in the examples crate. These can be run with the run-ex cargo alias:

cargo run-ex gpio-blink

System Level Example

The on-target tests and examples are a good starting point, but they demonstrate features independent of each-other. A system-level example using multiple features simultaneously is provided in a separate repo: stm32wl-lightswitch-demo

Unit Tests

Off-target unit tests use the built-in cargo framework. You must specify the target device as a feature.

cargo test --features stm32wl5x_cm4

Reference Documentation