stm32-hal2 1.8.2

Hardware abstraction layer for the STM32 MCUs
Documentation
[package]

name = "stm32-hal2"

version = "1.8.2"

authors = ["David O'Connor <david.alan.oconnor@gmail.com>"]

description = "Hardware abstraction layer for the STM32 MCUs"

keywords = ["no-std", "stm32", "embedded", "embedded-hal"]

categories = [

    "embedded",

    "hardware-support",

    "no-std",

]

repository = "https://github.com/David-OConnor/stm32-hal"

documentation = "https://docs.rs/stm32-hal2"

readme = "README.md"

license = "MIT"

exclude = [".gitignore"]

edition = "2021"



[dependencies]

cortex-m = "^0.7.7"



# Peripheral Access Crates

stm32f3 = { version = "0.15.1", optional = true }

stm32f4 = { version = "0.15.1", optional = true }

stm32l4 = { version = "0.15.1", optional = true }

stm32l5 = { version = "0.15.1", optional = true }

stm32g0 = { version = "0.15.1", optional = true }

stm32g4 = { version = "0.15.1", optional = true }

#stm32h5 = { version = "0.15.1", optional = true }

#stm32h5 = { path = "../../Desktop/h5_pac/stm32-rs/stm32h5", optional = true }

stm32h7 = { version = "0.15.1", optional = true }

stm32wb = { version = "0.15.1", optional = true }

stm32wl = { version = "0.15.1", optional = true }



defmt = "^0.3.4"



# Embedded-HAL traits and related libs. Featured-gated with `embedded-hal`.

embedded-hal = { version = "^1.0.0", features=["defmt-03"], optional = true }

# `nb` is only included when using the embedded-hal feature.

#nb = { version = "^1.1.0", optional = true }

#void = { version = "^1.0.2", default-features = false, optional = true }

#embedded-time = { version = "^0.12.1", optional = true }



# Enabled with the `monotonic` feature.

rtic-monotonic = { version = "^1.0.0", optional = true }



# Chrono allows for basic time and date functionality, for use with the RTC.

chrono = { version = "^0.4.23", default-features = false }



# These USB and CAN crates are only imported if one of the `can`, `usb`, `usbotg_fs`, or `usbotg_hs`

# features are used.

stm32-usbd = { version = "^0.6.0", optional = true }

#stm32-usbd = { git = "https://github.com/stm32-rs/stm32-usbd", optional = true }

synopsys-usb-otg = { version = "^0.3.2", features = ["cortex-m"], optional = true }

bxcan = { version = "^0.7.0", optional = true }

fdcan = { version = "^0.2.0", optional = true }



# TCP stack for use with the Ethernet peripheral.

smoltcp = { version = "^0.8.1", optional = true }



# Misc features

num-traits = { version = "^0.2.15", default-features = false, features = ["libm"] }  # For sqrt in timers



# Meta-programming; mainly used for feature-gating

cfg-if = "^1.0.0"  # if/else blocks for feature-gating

paste = "^1.0.4"  # Token pasting, to make macros easier



[package.metadata.docs.rs]

features = ["h735", "h7rt", "usbotg_hs", "can_fd_h", "embedded_hal"]

targets = ["thumbv7em-none-eabihf"]





# Compile with one of these "runtime" features if the program

# will be directly flashed to an MCU; ie not a library.

[features]

f3rt = ["stm32f3/rt"]

f4rt = ["stm32f4/rt"]

l4rt = ["stm32l4/rt"]

l5rt = ["stm32l5/rt"]

g0rt = ["stm32g0/rt"]

g4rt = ["stm32g4/rt"]

#h5rt = ["stm32h5/rt"]

h7rt = ["stm32h7/rt"]

wbrt = ["stm32wb/rt"]

wlrt = ["stm32wl/rt"]



# Features defined here are those taken from the SVD-generated STM32 PACs.

# The "f3" etc designator at the end lets us group by family when feature-gating.



# [F3](https://docs.rs/crate/stm32f3/latest/source/Cargo.toml)

f301 = ["stm32f3/stm32f301", "f3"]

f302 = ["stm32f3/stm32f302", "f3"]

f303 = ["stm32f3/stm32f303", "f3"]

f373 = ["stm32f3/stm32f373", "f3"]

f3x4 = ["stm32f3/stm32f3x4", "f3"]



# [F4](https://docs.rs/crate/stm32f4/latest/source/Cargo.toml)

f401 = ["stm32f4/stm32f401", "f4"]

f405 = ["stm32f4/stm32f405", "f4"]

f407 = ["stm32f4/stm32f407", "f4"]

f410 = ["stm32f4/stm32f410", "f4"]

f411 = ["stm32f4/stm32f411", "f4"]

f412 = ["stm32f4/stm32f412", "f4"]

f413 = ["stm32f4/stm32f413", "f4"]

f427 = ["stm32f4/stm32f427", "f4"]

f429 = ["stm32f4/stm32f429", "f4"]

f446 = ["stm32f4/stm32f446", "f4"]

f469 = ["stm32f4/stm32f469", "f4"]



# [L4](https://docs.rs/crate/stm32l4/latest/source/Cargo.toml)

l4x1 = ["stm32l4/stm32l4x1", "l4"]

l4x2 = ["stm32l4/stm32l4x2", "l4"]

# L412 is the same as L4x2, but with an RTC like in G0, G4 and L5.

l412 = ["stm32l4/stm32l412", "l4"]

l4x3 = ["stm32l4/stm32l4x3", "l4"]

l4x5 = ["stm32l4/stm32l4x5", "l4"]

l4x6 = ["stm32l4/stm32l4x6", "l4"]

# todo: Handle l4+ (P, R, S, Q)



# [L5](https://docs.rs/crate/stm32l5/latest/source/Cargo.toml)

l552 = ["stm32l5/stm32l552", "l5"]

l562 = ["stm32l5/stm32l562", "l5"]



# [G0](https://docs.rs/crate/stm32g0/latest/source/Cargo.toml)

g030 = ["stm32g0/stm32g030", "g0"]

g031 = ["stm32g0/stm32g031", "g0"]

g041 = ["stm32g0/stm32g041", "g0"]

g050 = ["stm32g0/stm32g050", "g0"]

g051 = ["stm32g0/stm32g051", "g0"]

g061 = ["stm32g0/stm32g061", "g0"]

g070 = ["stm32g0/stm32g070", "g0"]

g071 = ["stm32g0/stm32g071", "g0"]

g081 = ["stm32g0/stm32g081", "g0"]

g0b0 = ["stm32g0/stm32g0b0", "g0"]

g0b1 = ["stm32g0/stm32g0b1", "g0"]

g0c1 = ["stm32g0/stm32g0c1", "g0"]



# [G4](https://docs.rs/crate/stm32g4/latest/source/Cargo.toml)

g431 = ["stm32g4/stm32g431", "g4"]

g441 = ["stm32g4/stm32g441", "g4"]

g471 = ["stm32g4/stm32g471", "g4"]

g473 = ["stm32g4/stm32g473", "g4"]

g474 = ["stm32g4/stm32g474", "g4"]

g483 = ["stm32g4/stm32g483", "g4"]

g484 = ["stm32g4/stm32g484", "g4"]

g491 = ["stm32g4/stm32g491", "g4"]

g4a1 = ["stm32g4/stm32g4a1", "g4"]



#h503 = ["stm32h5/stm32h503", "h5"]

#h562 = ["stm32h5/stm32h562", "h5"]

#h563 = ["stm32h5/stm32h563", "h5"]

#h573 = ["stm32h5/stm32h573", "h5"]



# [H7](https://docs.rs/crate/stm32h7/latest/source/Cargo.toml)

h735 = ["stm32h7/stm32h735", "h7"]

h743 = ["stm32h7/stm32h743", "h7"]

h743v = ["stm32h7/stm32h743v", "h7"]

h747cm4 = ["stm32h7/stm32h747cm4", "h7"]

h747cm7 = ["stm32h7/stm32h747cm7", "h7"]

h753 = ["stm32h7/stm32h753", "h7"]

h753v = ["stm32h7/stm32h753v", "h7"]

h7b3 = ["stm32h7/stm32h7b3", "h7"]



# [WB](https://docs.rs/crate/stm32wb/latest/source/Cargo.toml)

wb55 = ["stm32wb/stm32wb55", "wb"]



# [WB](https://docs.rs/crate/stm32wl/latest/source/Cargo.toml)

wle5 = ["stm32wl/stm32wle5", "wl"]



usb = ["dep:stm32-usbd"]

usbotg_fs = ["synopsys-usb-otg/fs"]  # eg F4 for FS.

usbotg_hs = ["synopsys-usb-otg/hs"]  # eg H7 for HS.

can_bx = ["dep:bxcan"]

can_fd_g = ["fdcan/fdcan_g0_g4_l5"]

can_fd_h = ["fdcan/fdcan_h7"]

net = ["dep:smoltcp"]

#embedded_hal = ["dep:embedded-hal", "dep:nb", "dep:void", "dep:embedded-time"]

embedded_hal = ["dep:embedded-hal"]

monotonic = ["dep:rtic-monotonic"]



# These features are used to featured gate sections of code that apply

# to an entire family.

f3 = []

f4 = []

l4 = []

l5 = []

g0 = []

g4 = []

h5 = []

h7 = []

#wb = ["bit_field", "stm32-device-signature", "heapless", "byteorder", "bbqueue"]

wb = []

wl = []





#[package.metadata.docs.rs]

#features = ["h7rt", "h743v", "can_fd_h", "usbotg_hs"]



# todo: w feature to combine wb and wl since they often have feature parity?