Skip to content

Commit a49dc67

Browse files
Vanarillrubdos
authored andcommitted
Initial WB55 support.
1 parent ea92699 commit a49dc67

File tree

5 files changed

+36993
-4
lines changed

5 files changed

+36993
-4
lines changed

Justfile

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ check-all:
5151
DRONE_RUSTFLAGS='--cfg cortex_m_core="cortex_m4f_r0p1" --cfg stm32_mcu="stm32l4s7"' drone env thumbv7em-none-eabihf -- cargo check --package drone-stm32-map --features "{{features}}"
5252
DRONE_RUSTFLAGS='--cfg cortex_m_core="cortex_m4f_r0p1" --cfg stm32_mcu="stm32l4r9"' drone env thumbv7em-none-eabihf -- cargo check --package drone-stm32-map --features "{{features}}"
5353
DRONE_RUSTFLAGS='--cfg cortex_m_core="cortex_m4f_r0p1" --cfg stm32_mcu="stm32l4s9"' drone env thumbv7em-none-eabihf -- cargo check --package drone-stm32-map --features "{{features}}"
54+
DRONE_RUSTFLAGS='--cfg cortex_m_core="cortex_m4f_r0p1" --cfg stm32_mcu="stm32wbx5"' drone env thumbv7em-none-eabihf -- cargo check --package drone-stm32-map --features "{{features}}"
5455

5556
# Generate the docs
5657
doc:

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ a drop-in replacement for it.
4747
| `stm32l4s7` | ARM® Cortex®-M4F r0p1 | [RM0432](https://www.st.com/resource/en/reference_manual/dm00310109.pdf) | `adc` `dma` `exti` `gpio` `i2c` `rtc` `spi` `tim` `uart` |
4848
| `stm32l4r9` | ARM® Cortex®-M4F r0p1 | [RM0432](https://www.st.com/resource/en/reference_manual/dm00310109.pdf) | `adc` `dma` `exti` `gpio` `i2c` `rtc` `spi` `tim` `uart` |
4949
| `stm32l4s9` | ARM® Cortex®-M4F r0p1 | [RM0432](https://www.st.com/resource/en/reference_manual/dm00310109.pdf) | `adc` `dma` `exti` `gpio` `i2c` `rtc` `spi` `tim` `uart` |
50+
| `stm32wbx5` | ARM® Cortex®-M4F r0p1 | [RM0434](https://www.st.com/resource/en/reference_manual/dm00318631.pdf) | |
5051

5152
`stm32_mcu` config flag should be set at the application level according to
5253
this table.

src/periph/gpio/lib.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ periph! {
5151
stm32_mcu = "stm32l4r9",
5252
stm32_mcu = "stm32l4s5",
5353
stm32_mcu = "stm32l4s7",
54-
stm32_mcu = "stm32l4s9"
54+
stm32_mcu = "stm32l4s9",
55+
stm32_mcu = "stm32wbx5"
5556
))]
5657
BUSSMENR {
5758
0x20 RwRegBitBand Shared;
@@ -82,7 +83,8 @@ periph! {
8283
stm32_mcu = "stm32l4r9",
8384
stm32_mcu = "stm32l4s5",
8485
stm32_mcu = "stm32l4s7",
85-
stm32_mcu = "stm32l4s9"
86+
stm32_mcu = "stm32l4s9",
87+
stm32_mcu = "stm32wbx5"
8688
))]
8789
AFRL {
8890
0x20 RwReg;
@@ -117,7 +119,8 @@ periph! {
117119
stm32_mcu = "stm32l4r9",
118120
stm32_mcu = "stm32l4s5",
119121
stm32_mcu = "stm32l4s7",
120-
stm32_mcu = "stm32l4s9"
122+
stm32_mcu = "stm32l4s9",
123+
stm32_mcu = "stm32wbx5"
121124
))]
122125
AFRH {
123126
0x20 RwReg;
@@ -132,7 +135,8 @@ periph! {
132135
}
133136
#[cfg(any(
134137
stm32_mcu = "stm32l4x5",
135-
stm32_mcu = "stm32l4x6"
138+
stm32_mcu = "stm32l4x6",
139+
stm32_mcu = "stm32wbx5"
136140
))]
137141
ASCR {
138142
0x20 RwReg Option;

svd/src/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,16 @@ fn svd_deserialize() -> Result<Device> {
7474
"stm32l4s5" => patch_stm32l4plus(parse_svd("STM32L4S5.svd")?),
7575
"stm32l4s7" => patch_stm32l4plus(parse_svd("STM32L4S7.svd")?),
7676
"stm32l4s9" => patch_stm32l4plus(parse_svd("STM32L4S9.svd")?),
77+
"stm32wbx5" => patch_stm32wbx5(parse_svd("STM32WBxx_CM4.svd")?),
7778
_ => bail!("invalid `stm32_mcu` cfg flag"),
7879
}
7980
}
8081

82+
fn patch_stm32wbx5(mut dev: Device) -> Result<Device> {
83+
fix_802154(&mut dev)?;
84+
Ok(dev)
85+
}
86+
8187
fn patch_stm32f102(mut dev: Device) -> Result<Device> {
8288
spi::fix_spi2_1(&mut dev)?;
8389
Ok(dev)
@@ -199,6 +205,12 @@ fn patch_stm32f413(mut dev: Device) -> Result<Device> {
199205
Ok(dev)
200206
}
201207

208+
fn fix_802154(dev: &mut Device) -> Result<()> {
209+
dev.periph("PWR").reg("SR1").field("802WUF").name = "IEEE802WUF".to_string();
210+
dev.periph("PWR").reg("C2CR1").field("802EWKUP").name = "IEEE802EWKUP".to_string();
211+
Ok(())
212+
}
213+
202214
fn patch_stm32f427(mut dev: Device) -> Result<Device> {
203215
rcc::fix_3(&mut dev)?;
204216
dma::fix_dma2_1(&mut dev)?;

0 commit comments

Comments
 (0)