reorder files in the crate

This commit is contained in:
2026-02-26 15:35:19 +01:00
parent a789b5a881
commit f41a7b9002
17 changed files with 230 additions and 50 deletions

2
.cargo/config.toml Normal file
View File

@@ -0,0 +1,2 @@
[build]
target = "thumbv7em-none-eabi"

175
Cargo.lock generated
View File

@@ -80,6 +80,15 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "chrono"
version = "0.4.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0"
dependencies = [
"num-traits",
]
[[package]] [[package]]
name = "cortex-m" name = "cortex-m"
version = "0.7.7" version = "0.7.7"
@@ -88,6 +97,7 @@ checksum = "8ec610d8f49840a5b376c69663b6369e71f4b34484b9b2eb29fb918d92516cb9"
dependencies = [ dependencies = [
"bare-metal", "bare-metal",
"bitfield", "bitfield",
"critical-section",
"embedded-hal 0.2.7", "embedded-hal 0.2.7",
"volatile-register", "volatile-register",
] ]
@@ -118,6 +128,50 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"
[[package]]
name = "darling"
version = "0.20.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
dependencies = [
"darling_core",
"darling_macro",
]
[[package]]
name = "darling_core"
version = "0.20.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
dependencies = [
"fnv",
"ident_case",
"proc-macro2",
"quote",
"strsim",
"syn 2.0.117",
]
[[package]]
name = "darling_macro"
version = "0.20.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
dependencies = [
"darling_core",
"quote",
"syn 2.0.117",
]
[[package]]
name = "defmt"
version = "0.3.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
dependencies = [
"defmt 1.0.1",
]
[[package]] [[package]]
name = "defmt" name = "defmt"
version = "1.0.1" version = "1.0.1"
@@ -150,6 +204,16 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "defmt-rtt"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93d5a25c99d89c40f5676bec8cefe0614f17f0f40e916f98e345dae941807f9e"
dependencies = [
"critical-section",
"defmt 1.0.1",
]
[[package]] [[package]]
name = "document-features" name = "document-features"
version = "0.2.12" version = "0.2.12"
@@ -165,9 +229,11 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8" checksum = "554e3e840696f54b4c9afcf28a0f24da431c927f4151040020416e7393d6d0d8"
dependencies = [ dependencies = [
"defmt 1.0.1",
"embassy-futures", "embassy-futures",
"embassy-hal-internal 0.3.0", "embassy-hal-internal 0.3.0",
"embassy-sync", "embassy-sync",
"embassy-time",
"embedded-hal 0.2.7", "embedded-hal 0.2.7",
"embedded-hal 1.0.0", "embedded-hal 1.0.0",
"embedded-hal-async", "embedded-hal-async",
@@ -176,6 +242,38 @@ dependencies = [
"nb 1.1.0", "nb 1.1.0",
] ]
[[package]]
name = "embassy-executor"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06070468370195e0e86f241c8e5004356d696590a678d47d6676795b2e439c6b"
dependencies = [
"cortex-m",
"critical-section",
"defmt 1.0.1",
"document-features",
"embassy-executor-macros",
"embassy-executor-timer-queue",
]
[[package]]
name = "embassy-executor-macros"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfdddc3a04226828316bf31393b6903ee162238576b1584ee2669af215d55472"
dependencies = [
"darling",
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "embassy-executor-timer-queue"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fc328bf943af66b80b98755db9106bf7e7471b0cf47dc8559cd9a6be504cc9c"
[[package]] [[package]]
name = "embassy-futures" name = "embassy-futures"
version = "0.1.2" version = "0.1.2"
@@ -199,6 +297,7 @@ checksum = "7f10ce10a4dfdf6402d8e9bd63128986b96a736b1a0a6680547ed2ac55d55dba"
dependencies = [ dependencies = [
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"defmt 1.0.1",
"num-traits", "num-traits",
] ]
@@ -207,6 +306,9 @@ name = "embassy-net-driver"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d"
dependencies = [
"defmt 0.3.100",
]
[[package]] [[package]]
name = "embassy-stm32" name = "embassy-stm32"
@@ -219,15 +321,20 @@ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"block-device-driver", "block-device-driver",
"cfg-if", "cfg-if",
"chrono",
"cortex-m", "cortex-m",
"cortex-m-rt", "cortex-m-rt",
"critical-section", "critical-section",
"defmt 1.0.1",
"document-features", "document-features",
"embassy-embedded-hal", "embassy-embedded-hal",
"embassy-futures", "embassy-futures",
"embassy-hal-internal 0.4.0", "embassy-hal-internal 0.4.0",
"embassy-net-driver", "embassy-net-driver",
"embassy-sync", "embassy-sync",
"embassy-time",
"embassy-time-driver",
"embassy-time-queue-utils",
"embassy-usb-driver", "embassy-usb-driver",
"embassy-usb-synopsys-otg", "embassy-usb-synopsys-otg",
"embedded-can", "embedded-can",
@@ -263,6 +370,7 @@ checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"critical-section", "critical-section",
"defmt 1.0.1",
"embedded-io-async 0.6.1", "embedded-io-async 0.6.1",
"futures-core", "futures-core",
"futures-sink", "futures-sink",
@@ -277,6 +385,7 @@ checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"critical-section", "critical-section",
"defmt 1.0.1",
"document-features", "document-features",
"embassy-time-driver", "embassy-time-driver",
"embedded-hal 0.2.7", "embedded-hal 0.2.7",
@@ -294,12 +403,23 @@ dependencies = [
"document-features", "document-features",
] ]
[[package]]
name = "embassy-time-queue-utils"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454"
dependencies = [
"embassy-executor-timer-queue",
"heapless 0.8.0",
]
[[package]] [[package]]
name = "embassy-usb-driver" name = "embassy-usb-driver"
version = "0.2.0" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a" checksum = "17119855ccc2d1f7470a39756b12068454ae27a3eabb037d940b5c03d9c77b7a"
dependencies = [ dependencies = [
"defmt 1.0.1",
"embedded-io-async 0.6.1", "embedded-io-async 0.6.1",
] ]
@@ -310,6 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "288751f8eaa44a5cf2613f13cee0ca8e06e6638cb96e897e6834702c79084b23" checksum = "288751f8eaa44a5cf2613f13cee0ca8e06e6638cb96e897e6834702c79084b23"
dependencies = [ dependencies = [
"critical-section", "critical-section",
"defmt 1.0.1",
"embassy-sync", "embassy-sync",
"embassy-usb-driver", "embassy-usb-driver",
] ]
@@ -369,6 +490,9 @@ name = "embedded-io"
version = "0.7.1" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9eb1aa714776b75c7e67e1da744b81a129b3ff919c8712b5e1b32252c1f07cc7" checksum = "9eb1aa714776b75c7e67e1da744b81a129b3ff919c8712b5e1b32252c1f07cc7"
dependencies = [
"defmt 1.0.1",
]
[[package]] [[package]]
name = "embedded-io-async" name = "embedded-io-async"
@@ -385,6 +509,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2564b9f813c544241430e147d8bc454815ef9ac998878d30cc3055449f7fd4c0" checksum = "2564b9f813c544241430e147d8bc454815ef9ac998878d30cc3055449f7fd4c0"
dependencies = [ dependencies = [
"defmt 1.0.1",
"embedded-io 0.7.1", "embedded-io 0.7.1",
] ]
@@ -403,6 +528,12 @@ dependencies = [
"embedded-storage", "embedded-storage",
] ]
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]] [[package]]
name = "futures-core" name = "futures-core"
version = "0.3.32" version = "0.3.32"
@@ -461,6 +592,12 @@ dependencies = [
"stable_deref_trait", "stable_deref_trait",
] ]
[[package]]
name = "ident_case"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]] [[package]]
name = "litrs" name = "litrs"
version = "1.0.0" version = "1.0.0"
@@ -491,6 +628,16 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "panic-probe"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd402d00b0fb94c5aee000029204a46884b1262e0c443f166d86d2c0747e1a1a"
dependencies = [
"cortex-m",
"defmt 1.0.1",
]
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.16" version = "0.2.16"
@@ -608,6 +755,7 @@ checksum = "a411079520dbccc613af73172f944b7cf97ba84e3bd7381a0352b6ec7bfef03b"
dependencies = [ dependencies = [
"cortex-m", "cortex-m",
"cortex-m-rt", "cortex-m-rt",
"defmt 0.3.100",
] ]
[[package]] [[package]]
@@ -615,13 +763,38 @@ name = "stm32wl-subghz"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cortex-m", "cortex-m",
"defmt", "defmt 1.0.1",
"embassy-stm32", "embassy-stm32",
"embassy-time", "embassy-time",
"embedded-hal 1.0.0", "embedded-hal 1.0.0",
"embedded-hal-async", "embedded-hal-async",
] ]
[[package]]
name = "stm32wl-subghz-examples"
version = "0.1.0"
dependencies = [
"cortex-m",
"cortex-m-rt",
"defmt 1.0.1",
"defmt-rtt",
"embassy-embedded-hal",
"embassy-executor",
"embassy-stm32",
"embassy-sync",
"embassy-time",
"embedded-hal 1.0.0",
"embedded-hal-async",
"panic-probe",
"stm32wl-subghz",
]
[[package]]
name = "strsim"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.109" version = "1.0.109"

View File

@@ -1,3 +1,51 @@
[package]
name = "stm32wl-subghz"
version = "0.1.0"
edition = "2024"
license = "MIT"
repository = "https://git.lusia.moe/lukrecja/stm32wl-subghz"
categories = [ "no-std", "embedded", "asynchronous" ]
keywords = [ "stm32wl", "stm32wle5jc", "lora", "fsk", "gfsk", "msk", "gmsk", "bpsk", "radio", "embedded-hal-async" ]
description = "Sub-GHz radio driver for STM32WL-series microcontrollers"
[workspace] [workspace]
members = [ "stm32wl-subghz" ] members = ["examples/stm32wle5jc"]
exclude = [ "examples/stm32wle5jc" ]
[features]
# Default chip for development/CI. Downstream users should use default-features = false
# and enable their specific chip feature.
default = ["stm32wle5jc"]
# Single-core variants
stm32wle4c8 = ["embassy-stm32/stm32wle4c8"]
stm32wle4cb = ["embassy-stm32/stm32wle4cb"]
stm32wle4cc = ["embassy-stm32/stm32wle4cc"]
stm32wle4j8 = ["embassy-stm32/stm32wle4j8"]
stm32wle4jb = ["embassy-stm32/stm32wle4jb"]
stm32wle4jc = ["embassy-stm32/stm32wle4jc"]
stm32wle5c8 = ["embassy-stm32/stm32wle5c8"]
stm32wle5cb = ["embassy-stm32/stm32wle5cb"]
stm32wle5cc = ["embassy-stm32/stm32wle5cc"]
stm32wle5j8 = ["embassy-stm32/stm32wle5j8"]
stm32wle5jb = ["embassy-stm32/stm32wle5jb"]
stm32wle5jc = ["embassy-stm32/stm32wle5jc"]
# Dual-core variants
stm32wl54cc-cm0p = ["embassy-stm32/stm32wl54cc-cm0p"]
stm32wl54cc-cm4 = ["embassy-stm32/stm32wl54cc-cm4"]
stm32wl54jc-cm0p = ["embassy-stm32/stm32wl54jc-cm0p"]
stm32wl54jc-cm4 = ["embassy-stm32/stm32wl54jc-cm4"]
stm32wl55cc-cm0p = ["embassy-stm32/stm32wl55cc-cm0p"]
stm32wl55cc-cm4 = ["embassy-stm32/stm32wl55cc-cm4"]
stm32wl55jc-cm0p = ["embassy-stm32/stm32wl55jc-cm0p"]
stm32wl55jc-cm4 = ["embassy-stm32/stm32wl55jc-cm4"]
[dependencies]
embassy-stm32 = { version = "0.5.0", features = ["unstable-pac"] }
embassy-time = "0.5.0"
defmt = "1.0.1"
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
embedded-hal = "1.0.0"
embedded-hal-async = "1.0.0"
[profile.release]
debug = 2
opt-level = 3

View File

@@ -5,7 +5,7 @@
Sub-GHZ SPI device radio driver for STM32WL-series microcontrollers, currently supporting LoRa and BPSK. Sub-GHZ SPI device radio driver for STM32WL-series microcontrollers, currently supporting LoRa and BPSK.
## Crates ## Crates
- [`stm32wl-subghz`](./stm32wl-subghz/) - the driver library - [`stm32wl-subghz`](.) - the driver library
- [`examples/stm32wle5jc`](./examples/stm32wle5jc/) - usage examples for the STM32WLE5JC-based boards - [`examples/stm32wle5jc`](./examples/stm32wle5jc/) - usage examples for the STM32WLE5JC-based boards
## License ## License

View File

@@ -6,7 +6,7 @@ license = "MIT"
publish = false publish = false
[dependencies] [dependencies]
stm32wl-subghz = { path = "../../stm32wl-subghz" } stm32wl-subghz = { path = "../.." }
embassy-stm32 = { version = "0.5.0", features = ["defmt", "stm32wle5jc", "time-driver-tim1", "memory-x", "unstable-pac", "exti", "chrono"] } embassy-stm32 = { version = "0.5.0", features = ["defmt", "stm32wle5jc", "time-driver-tim1", "memory-x", "unstable-pac", "exti", "chrono"] }
embassy-sync = { version = "0.7.2", features = ["defmt"] } embassy-sync = { version = "0.7.2", features = ["defmt"] }

1
rust-analyzer.toml Normal file
View File

@@ -0,0 +1 @@
linkedProjects = ["Cargo.toml", "examples/stm32wle5jc/Cargo.toml"]

View File

@@ -1,17 +0,0 @@
[package]
name = "stm32wl-subghz"
version = "0.1.0"
edition = "2024"
license = "MIT"
repository = "https://git.lusia.moe/lukrecja/stm32wl-subghz"
categories = [ "no-std", "embedded", "asynchronous" ]
keywords = [ "stm32wl", "stm32wle5jc", "lora", "fsk", "gfsk", "msk", "gmsk", "bpsk", "radio", "embedded-hal-async" ]
description = "Sub-GHz radio driver for STM32WL-series microcontrollers"
[dependencies]
embassy-stm32 = { version = "0.5.0", features = ["unstable-pac"] }
embassy-time = "0.5.0"
defmt = "1.0.1"
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
embedded-hal = "1.0.0"
embedded-hal-async = "1.0.0"

View File

@@ -1,7 +0,0 @@
Copyright © 2026 Lukrecja Pleskaczyńska
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,20 +0,0 @@
# stm32wl-subghz
[![Latest Version]][crates.io]
Sub-GHZ SPI device radio driver for STM32WL-series microcontrollers, currently supporting LoRa and BPSK.
Built on `embedded-hal-async` and `embassy-stm32`.
## Supported hardware
- STM32WLE5JC (single-core) - tested
- Possibly all the other variants in STM32WL5x and STM32WLEx families
## Usage
See the [examples](../examples/) directory.
## License
MIT
[Latest Version]: https://img.shields.io/crates/v/stm32wl-subghz.svg
[crates.io]: https://crates.io/crates/stm32wl-subghz