From 5549a832632f2844bbf44a863060725c854ec3d7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Feb 2025 15:26:01 +0100 Subject: [PATCH] HAL update + CHANGELOG --- .../embassy/src/bin/uart-echo-with-irq.rs | 3 ++- flashloader/src/main.rs | 2 +- va416xx-hal/CHANGELOG.md | 27 +++++++++++++++++++ va416xx-hal/src/uart.rs | 8 +++--- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/examples/embassy/src/bin/uart-echo-with-irq.rs b/examples/embassy/src/bin/uart-echo-with-irq.rs index 66d1623..79018e7 100644 --- a/examples/embassy/src/bin/uart-echo-with-irq.rs +++ b/examples/embassy/src/bin/uart-echo-with-irq.rs @@ -32,7 +32,8 @@ use va416xx_hal::{ uart, }; -pub type SharedUart = Mutex>>>; +pub type SharedUart = + Mutex>>>; static RX: SharedUart = Mutex::new(RefCell::new(None)); const BAUDRATE: u32 = 115200; diff --git a/flashloader/src/main.rs b/flashloader/src/main.rs index 4b28bcf..e0d4040 100644 --- a/flashloader/src/main.rs +++ b/flashloader/src/main.rs @@ -127,7 +127,7 @@ mod app { #[local] struct Local { - uart_rx: uart::RxWithIrq, + uart_rx: uart::RxWithInterrupt, uart_tx: uart::Tx, rx_context: IrqContextTimeoutOrMaxSize, rom_spi: Option, diff --git a/va416xx-hal/CHANGELOG.md b/va416xx-hal/CHANGELOG.md index bb9fffe..8dd6ebd 100644 --- a/va416xx-hal/CHANGELOG.md +++ b/va416xx-hal/CHANGELOG.md @@ -8,6 +8,33 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [unreleased] +# [v0.4.0] 2025-02-14 + +## Changed + +- GPIO API: Interrupt, pulse and filter and `set_datamask` and `clear_datamask` APIs are now + methods which mutable modify the pin instead of consuming and returning it. +- Simplified PWM module implementation. +- All error types now implement `core::error::Error` by using the `thiserror::Error` derive. +- `InvalidPinTypeError` now wraps the pin mode. +- I2C `TimingCfg` constructor now returns explicit error instead of generic Error. + Removed the timing configuration error type from the generic I2C error enumeration. +- `PinsA` and `PinsB` constructor do not expect an optional `pac::Ioconfig` argument anymore. +- `IrqCfg` renamed to `InterruptConfig`, kept alias for old name. +- All library provided interrupt handlers now start with common prefix `on_interrupt_*` +- `RxWithIrq` renamed to `RxWithInterrupt` +- `Rx::into_rx_with_irq` does not expect any arguments any more. +- `filter_type` renamed to `configure_filter_type`. +- `level_irq` renamed to `configure_level_interrupt`. +- `edge_irq` renamed to `configure_edge_interrupt`. +- UART interrupt management is now handled by the main constructor instead of later stages to + statically ensure one interrupt vector for the UART peripheral. `Uart::new` expects an + optional `InterruptConfig` argument. +- `enable_interrupt` and `disable_interrupt` renamed to `enable_nvic_interrupt` and + `disable_nvic_interrupt` to distinguish them from peripheral interrupts more clearly. +- `port_mux` renamed to `port_function_select` +- Renamed `IrqUartErrors` to `UartErrors`. + # [v0.3.0] 2024-30-09 ## Changed diff --git a/va416xx-hal/src/uart.rs b/va416xx-hal/src/uart.rs index 3a24341..4f1ea2a 100644 --- a/va416xx-hal/src/uart.rs +++ b/va416xx-hal/src/uart.rs @@ -785,8 +785,8 @@ impl Rx { self.0.data().read().bits() } - pub fn into_rx_with_irq(self) -> RxWithIrq { - RxWithIrq(self) + pub fn into_rx_with_irq(self) -> RxWithInterrupt { + RxWithInterrupt(self) } pub fn release(self) -> Uart { @@ -967,9 +967,9 @@ impl embedded_io::Write for Tx { /// then call the [Self::irq_handler_max_size_or_timeout_based] in the interrupt service /// routine. You have to call [Self::read_fixed_len_or_timeout_based_using_irq] in the ISR to /// start reading the next packet. -pub struct RxWithIrq(Rx); +pub struct RxWithInterrupt(Rx); -impl RxWithIrq { +impl RxWithInterrupt { /// This function should be called once at initialization time if the regular /// [Self::irq_handler] is used to read the UART receiver to enable and start the receiver. pub fn start(&mut self) {