Skip to content

Commit 8f58aaf

Browse files
committed
RBExt
1 parent d1a8367 commit 8f58aaf

File tree

12 files changed

+882
-674
lines changed

12 files changed

+882
-674
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
- Unmacro `Adc`
1111
- Use `write` instead of `modify` to clear flags
1212
- Bump `stm32f4-staging` to 0.18, update other dependencies
13+
- `serial` mod refactor
1314

1415
## [v0.22.1] - 2024-11-03
1516

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ micromath = { version = "2.1.0", optional = true }
6767

6868
[dependencies.stm32f4]
6969
package = "stm32f4-staging"
70-
version = "0.18.0"
70+
version = "0.19.0"
7171
features = ["atomics"]
7272

7373
[dependencies.time]
@@ -168,7 +168,7 @@ gpio-f401 = [
168168
"tim9",
169169
"tim10",
170170
"tim11",
171-
"rcc_shared_m"
171+
"rcc_shared_m",
172172
]
173173
gpio-f410 = [
174174
"dac",
@@ -317,7 +317,7 @@ gpio-f417 = [
317317
"usart3",
318318
"uart4",
319319
"uart5",
320-
"rcc_shared_m"
320+
"rcc_shared_m",
321321
]
322322
gpio-f427 = [
323323
"gpiod",
@@ -364,7 +364,7 @@ gpio-f427 = [
364364
"uart5",
365365
"uart7",
366366
"uart8",
367-
"rcc_shared_m"
367+
"rcc_shared_m",
368368
]
369369
gpio-f446 = [
370370
"gpiod",
@@ -457,7 +457,7 @@ gpio-f469 = [
457457
"uart5",
458458
"uart7",
459459
"uart8",
460-
"rcc_shared_m"
460+
"rcc_shared_m",
461461
]
462462

463463
## Support monotonic timers and other stuff that can be used by [RTICv1 framework](https://crates.io/crates/cortex-m-rtic)

examples/serial-dma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use stm32f4xx_hal::{
1818
self,
1919
dma::{RxDMA, SerialDma, TxDMA},
2020
},
21-
uart::{config::StopBits, Config, Serial},
21+
serial::{config::StopBits, Config, Serial},
2222
};
2323

2424
/// Global variable for USART2 DMA handle.

examples/uart-dma.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ use cortex_m_rt::entry;
1111
use stm32f4xx_hal::dma::config::DmaConfig;
1212
use stm32f4xx_hal::pac::Interrupt;
1313
use stm32f4xx_hal::pac::{interrupt, DMA1};
14-
use stm32f4xx_hal::uart::config::StopBits;
15-
use stm32f4xx_hal::uart::{Config, Rx, Serial};
14+
use stm32f4xx_hal::serial::{config::StopBits, Config, Rx, Serial};
1615
use stm32f4xx_hal::{
1716
dma::{StreamsTuple, Transfer},
1817
pac,

src/fmpi2c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl<I2C: Instance> I2c<I2C> {
206206
if isr.nackf().bit_is_set() {
207207
self.i2c
208208
.icr()
209-
.write(|w| w.stopcf().set_bit().nackcf().set_bit());
209+
.write(|w| w.stopcf().clear_bit_by_one().nackcf().clear_bit_by_one());
210210
return Err(Error::NoAcknowledge(NoAcknowledgeSource::Unknown));
211211
}
212212

src/gpio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub enum Pull {
127127
Down = 2,
128128
}
129129

130-
impl From<Pull> for pac::gpioa::pupdr::PUPDR0 {
130+
impl From<Pull> for pac::gpioa::pupdr::PULL {
131131
fn from(value: Pull) -> Self {
132132
match value {
133133
Pull::Down => Self::PullDown,
@@ -206,7 +206,7 @@ pub enum Speed {
206206
VeryHigh = 3,
207207
}
208208

209-
impl From<Speed> for pac::gpioa::ospeedr::OSPEEDR0 {
209+
impl From<Speed> for pac::gpioa::ospeedr::OUTPUT_SPEED {
210210
fn from(value: Speed) -> Self {
211211
match value {
212212
Speed::Low => Self::LowSpeed,

src/gpio/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::*;
2-
use crate::pac::gpioa::{moder::MODER0 as Mode, otyper::OT0 as OutputType};
2+
use crate::pac::gpioa::{moder::MODE as Mode, otyper::OUTPUT_TYPE as OutputType};
33

44
impl Input {
55
pub fn new<const P: char, const N: u8, MODE: PinMode>(

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ pub mod spi;
132132
pub mod syscfg;
133133
pub mod time;
134134
pub mod timer;
135-
#[cfg(feature = "uart4")]
136-
pub mod uart;
137135
pub mod watchdog;
138136

139137
mod sealed {

0 commit comments

Comments
 (0)