Skip to content

Commit 768f7f8

Browse files
committed
rm e-h 1.0 serial traits
1 parent 4c16f3d commit 768f7f8

File tree

5 files changed

+26
-157
lines changed

5 files changed

+26
-157
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Changed
1111

12+
- bump embedded-hal to `1.0-rc1` (remove `serial` part)
1213
- complete and rework Dma Stream API [#666]
1314
- Use `enumflags2::BitFlags` for interrupt flags and events [#673]
1415
- SPI bidi takes 2 pins [#526]

Diff for: Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ embedded-dma = "0.2.0"
4040
bare-metal = { version = "1" }
4141
void = { default-features = false, version = "1.0.2" }
4242
embedded-hal = { features = ["unproven"], version = "0.2.7" }
43-
embedded-hal-nb = "1.0.0-alpha.3"
43+
embedded-hal-nb = "1.0.0-rc.1"
4444
display-interface = { version = "0.4.1", optional = true }
4545
fugit = "0.3.6"
4646
fugit-timer = "0.1.3"
@@ -55,7 +55,7 @@ version = "0.3.14"
5555
default-features = false
5656

5757
[dependencies.embedded-hal-one]
58-
version = "=1.0.0-alpha.11"
58+
version = "=1.0.0-rc.1"
5959
package = "embedded-hal"
6060

6161
[dependencies.stm32_i2s_v12x]

Diff for: src/serial.rs

+20-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use core::marker::PhantomData;
1818

1919
mod hal_02;
20-
mod hal_1;
2120

2221
pub(crate) mod uart_impls;
2322
pub use uart_impls::Instance;
@@ -30,8 +29,26 @@ use crate::pac;
3029
use crate::gpio::NoPin;
3130
use crate::rcc::Clocks;
3231

33-
/// Serial error
34-
pub use embedded_hal_one::serial::ErrorKind as Error;
32+
/// Serial error kind
33+
///
34+
/// This represents a common set of serial operation errors. HAL implementations are
35+
/// free to define more specific or additional error types. However, by providing
36+
/// a mapping to these common serial errors, generic code can still react to them.
37+
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
38+
#[non_exhaustive]
39+
pub enum Error {
40+
/// The peripheral receive buffer was overrun.
41+
Overrun,
42+
/// Received data does not conform to the peripheral configuration.
43+
/// Can be caused by a misconfigured device on either end of the serial line.
44+
FrameFormat,
45+
/// Parity check failed.
46+
Parity,
47+
/// Serial line is too noisy to read valid data.
48+
Noise,
49+
/// A different error occurred. The original error may contain more information.
50+
Other,
51+
}
3552

3653
/// UART interrupt events
3754
#[enumflags2::bitflags]

Diff for: src/serial/hal_1.rs

-149
This file was deleted.

Diff for: src/uart.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ use crate::pac;
1818

1919
use crate::serial::uart_impls::RegisterBlockUart;
2020

21-
pub use crate::serial::{config, Event, Instance, NoRx, NoTx, Rx, RxISR, Serial, Tx, TxISR};
21+
pub use crate::serial::{
22+
config, ErrorKind as Error, Event, Instance, NoRx, NoTx, Rx, RxISR, Serial, Tx, TxISR,
23+
};
2224
pub use config::Config;
23-
/// Serial error
24-
pub use embedded_hal_one::serial::ErrorKind as Error;
2525

2626
#[cfg(not(any(feature = "stm32f413", feature = "stm32f423",)))]
2727
macro_rules! halUart {

0 commit comments

Comments
 (0)