Skip to content

Commit

Permalink
Merge pull request #694 from stm32-rs/hal-rc
Browse files Browse the repository at this point in the history
hal rc1
  • Loading branch information
therealprof committed Nov 19, 2023
2 parents 4c16f3d + f4af0f2 commit 92c5ce8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 157 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- bump embedded-hal to `1.0-rc1` (remove `serial` part)
- complete and rework Dma Stream API [#666]
- Use `enumflags2::BitFlags` for interrupt flags and events [#673]
- SPI bidi takes 2 pins [#526]
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ embedded-dma = "0.2.0"
bare-metal = { version = "1" }
void = { default-features = false, version = "1.0.2" }
embedded-hal = { features = ["unproven"], version = "0.2.7" }
embedded-hal-nb = "1.0.0-alpha.3"
embedded-hal-nb = "1.0.0-rc.1"
display-interface = { version = "0.4.1", optional = true }
fugit = "0.3.6"
fugit-timer = "0.1.3"
Expand All @@ -55,7 +55,7 @@ version = "0.3.14"
default-features = false

[dependencies.embedded-hal-one]
version = "=1.0.0-alpha.11"
version = "=1.0.0-rc.1"
package = "embedded-hal"

[dependencies.stm32_i2s_v12x]
Expand Down
23 changes: 20 additions & 3 deletions src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use core::marker::PhantomData;

mod hal_02;
mod hal_1;

pub(crate) mod uart_impls;
pub use uart_impls::Instance;
Expand All @@ -30,8 +29,26 @@ use crate::pac;
use crate::gpio::NoPin;
use crate::rcc::Clocks;

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

/// UART interrupt events
#[enumflags2::bitflags]
Expand Down
149 changes: 0 additions & 149 deletions src/serial/hal_1.rs

This file was deleted.

4 changes: 1 addition & 3 deletions src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ use crate::pac;

use crate::serial::uart_impls::RegisterBlockUart;

pub use crate::serial::{config, Event, Instance, NoRx, NoTx, Rx, RxISR, Serial, Tx, TxISR};
pub use crate::serial::{config, Error, Event, Instance, NoRx, NoTx, Rx, RxISR, Serial, Tx, TxISR};
pub use config::Config;
/// Serial error
pub use embedded_hal_one::serial::ErrorKind as Error;

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

0 comments on commit 92c5ce8

Please sign in to comment.