From e24fc608a3ad8e6266a08eec8335b507e88aad5c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 13 Feb 2025 11:44:14 +0100 Subject: [PATCH] all doc fixes --- va108xx-hal/src/gpio/asynch.rs | 10 +++++----- va108xx-hal/src/lib.rs | 4 ++-- va108xx-hal/src/uart/mod.rs | 10 +++++----- va108xx-hal/src/uart/rx_asynch.rs | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/va108xx-hal/src/gpio/asynch.rs b/va108xx-hal/src/gpio/asynch.rs index 34eeb0b..0e5a478 100644 --- a/va108xx-hal/src/gpio/asynch.rs +++ b/va108xx-hal/src/gpio/asynch.rs @@ -4,7 +4,7 @@ //! the [embedded_hal_async::digital::Wait] trait. These types allow for asynchronous waiting //! on GPIO pins. Please note that this module does not specify/declare the interrupt handlers //! which must be provided for async support to work. However, it provides one generic -//! [handler][handle_interrupt_for_async_gpio] which should be called in ALL user interrupt handlers +//! [handler][on_interrupt_for_asynch_gpio] which should be called in ALL user interrupt handlers //! which handle GPIO interrupts. //! //! # Example @@ -90,7 +90,7 @@ pub struct InputPinFuture { impl InputPinFuture { /// # Safety /// - /// This calls [Self::new] but uses [pac::Peripherals::steal] to get the system configuration + /// This calls [Self::new_with_dyn_pin] but uses [pac::Peripherals::steal] to get the system configuration /// and IRQ selection peripherals. Users must ensure that the registers and configuration /// related to this input pin are not being used elsewhere concurrently. pub unsafe fn new_unchecked_with_dyn_pin( @@ -127,7 +127,7 @@ impl InputPinFuture { /// # Safety /// - /// This calls [Self::new] but uses [pac::Peripherals::steal] to get the system configuration + /// This calls [Self::new_with_pin] but uses [pac::Peripherals::steal] to get the system configuration /// and IRQ selection peripherals. Users must ensure that the registers and configuration /// related to this input pin are not being used elsewhere concurrently. pub unsafe fn new_unchecked_with_pin( @@ -200,7 +200,7 @@ impl InputDynPinAsync { /// passed as well and is used to route and enable the interrupt. /// /// Please note that the interrupt handler itself must be provided by the user and the - /// generic [handle_interrupt_for_async_gpio] function must be called inside that function for + /// generic [on_interrupt_for_asynch_gpio] function must be called inside that function for /// the asynchronous functionality to work. pub fn new(pin: DynPin, irq: pac::Interrupt) -> Result { if !pin.is_input_pin() { @@ -335,7 +335,7 @@ impl InputPinAsync { /// passed as well and is used to route and enable the interrupt. /// /// Please note that the interrupt handler itself must be provided by the user and the - /// generic [handle_interrupt_for_async_gpio] function must be called inside that function for + /// generic [on_interrupt_for_asynch_gpio] function must be called inside that function for /// the asynchronous functionality to work. pub fn new(pin: Pin>, irq: pac::Interrupt) -> Self { Self { pin, irq } diff --git a/va108xx-hal/src/lib.rs b/va108xx-hal/src/lib.rs index b12f853..a1d04cd 100644 --- a/va108xx-hal/src/lib.rs +++ b/va108xx-hal/src/lib.rs @@ -51,8 +51,8 @@ pub enum PeripheralSelect { /// Generic interrupt config which can be used to specify whether the HAL driver will /// use the IRQSEL register to route an interrupt, and whether the IRQ will be unmasked in the -/// Cortex-M0 NVIC. Both are generally necessary for IRQs to work, but the user might perform -/// this steps themselves +/// Cortex-M0 NVIC. Both are generally necessary for IRQs to work, but the user might want to +/// perform those steps themselves. #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub struct InterruptConfig { /// Interrupt target vector. Should always be set, might be required for disabling IRQs diff --git a/va108xx-hal/src/uart/mod.rs b/va108xx-hal/src/uart/mod.rs index 137c9db..39cd72b 100644 --- a/va108xx-hal/src/uart/mod.rs +++ b/va108xx-hal/src/uart/mod.rs @@ -1108,10 +1108,10 @@ impl embedded_io::Write for Tx { /// /// 1. The first way simply empties the FIFO on an interrupt into a user provided buffer. You /// can simply use [Self::start] to prepare the peripheral and then call the -/// [Self::irq_handler] in the interrupt service routine. +/// [Self::on_interrupt] in the interrupt service routine. /// 2. The second way reads packets bounded by a maximum size or a baudtick based timeout. You /// can use [Self::read_fixed_len_or_timeout_based_using_irq] to prepare the peripheral and -/// then call the [Self::irq_handler_max_size_or_timeout_based] in the interrupt service +/// then call the [Self::on_interrupt_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 RxWithInterrupt(Rx); @@ -1122,7 +1122,7 @@ 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. + /// [Self::on_interrupt] is used to read the UART receiver to enable and start the receiver. pub fn start(&mut self) { self.0.enable(); self.enable_rx_irq_sources(true); @@ -1133,13 +1133,13 @@ impl RxWithInterrupt { &self.0.uart } - /// This function is used together with the [Self::irq_handler_max_size_or_timeout_based] + /// This function is used together with the [Self::on_interrupt_max_size_or_timeout_based] /// function to read packets with a maximum size or variable sized packets by using the /// receive timeout of the hardware. /// /// This function should be called once at initialization to initiate the context state /// and to [Self::start] the receiver. After that, it should be called after each - /// completed [Self::irq_handler_max_size_or_timeout_based] call to restart the reception + /// completed [Self::on_interrupt_max_size_or_timeout_based] call to restart the reception /// of a packet. pub fn read_fixed_len_or_timeout_based_using_irq( &mut self, diff --git a/va108xx-hal/src/uart/rx_asynch.rs b/va108xx-hal/src/uart/rx_asynch.rs index a93ecd7..faa5c19 100644 --- a/va108xx-hal/src/uart/rx_asynch.rs +++ b/va108xx-hal/src/uart/rx_asynch.rs @@ -286,7 +286,7 @@ impl Drop for ActiveReadGuard { } } -/// Core data structure to allow asynchrnous UART reception. +/// Core data structure to allow asynchronous UART reception. /// /// If the ring buffer becomes full, data will be lost. pub struct RxAsync { @@ -295,7 +295,7 @@ pub struct RxAsync { } impl ErrorType for RxAsync { - /// Error reporting is done using atomic booleans and the [get_and_clear_errors] function. + /// Error reporting is done using the result of the interrupt functions. type Error = Infallible; } @@ -345,7 +345,7 @@ impl embedded_io_async::Read for RxAsync { } impl ErrorType for RxAsyncSharedConsumer { - /// Error reporting is done using atomic booleans and the [get_and_clear_errors] function. + /// Error reporting is done using the result of the interrupt functions. type Error = Infallible; }