From 7ef9a6453a0a2a286741d47fcb99170d802f7d7d Mon Sep 17 00:00:00 2001 From: Rob Wells Date: Mon, 27 Oct 2025 15:23:54 +0000 Subject: embassy-rp: doc comment spelling pass All changes but one are to documentation comments, and one to an ordinary comment. --- embassy-rp/CHANGELOG.md | 2 +- embassy-rp/src/block.rs | 4 ++-- embassy-rp/src/clocks.rs | 2 +- embassy-rp/src/i2c_slave.rs | 4 ++-- embassy-rp/src/multicore.rs | 2 +- embassy-rp/src/pio/mod.rs | 2 +- embassy-rp/src/pio_programs/i2s.rs | 18 +++++++++--------- embassy-rp/src/pio_programs/pwm.rs | 2 +- embassy-rp/src/pio_programs/spi.rs | 4 ++-- embassy-rp/src/pio_programs/uart.rs | 2 +- embassy-rp/src/rom_data/rp2040.rs | 2 +- embassy-rp/src/rtc/mod.rs | 2 +- embassy-rp/src/spi.rs | 2 +- embassy-rp/src/uart/mod.rs | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) (limited to 'embassy-rp') diff --git a/embassy-rp/CHANGELOG.md b/embassy-rp/CHANGELOG.md index a99d04aa4..57ec13658 100644 --- a/embassy-rp/CHANGELOG.md +++ b/embassy-rp/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased - ReleaseDate -- Fix typo in interrupt comment +- Fix several minor typos in documentation - Add PIO SPI - Add PIO I2S input - Add PIO onewire parasite power strong pullup diff --git a/embassy-rp/src/block.rs b/embassy-rp/src/block.rs index a3e1ad925..745883b83 100644 --- a/embassy-rp/src/block.rs +++ b/embassy-rp/src/block.rs @@ -240,7 +240,7 @@ impl UnpartitionedSpace { } } - /// Create a new unpartition space from run-time values. + /// Create a new unpartitioned space from run-time values. /// /// Get these from the ROM function `get_partition_table_info` with an argument of `PT_INFO`. pub const fn from_raw(permissions_and_location: u32, permissions_and_flags: u32) -> Self { @@ -714,7 +714,7 @@ impl PartitionTableBlock { new_table } - /// Add a a SHA256 hash of the Block + /// Add a SHA256 hash of the Block /// /// Adds a `HASH_DEF` covering all the previous items in the Block, and a /// `HASH_VALUE` with a SHA-256 hash of them. diff --git a/embassy-rp/src/clocks.rs b/embassy-rp/src/clocks.rs index 56892d7a2..8bfb5129a 100644 --- a/embassy-rp/src/clocks.rs +++ b/embassy-rp/src/clocks.rs @@ -267,7 +267,7 @@ impl CoreVoltage { } } -/// CLock configuration. +/// Clock configuration. #[non_exhaustive] pub struct ClockConfig { /// Ring oscillator configuration. diff --git a/embassy-rp/src/i2c_slave.rs b/embassy-rp/src/i2c_slave.rs index 770087bc8..0853709df 100644 --- a/embassy-rp/src/i2c_slave.rs +++ b/embassy-rp/src/i2c_slave.rs @@ -52,7 +52,7 @@ pub enum ReadStatus { Done, /// Transaction Incomplete, controller trying to read more bytes than were provided NeedMoreBytes, - /// Transaction Complere, but controller stopped reading bytes before we ran out + /// Transaction Complete, but controller stopped reading bytes before we ran out LeftoverBytes(u16), } @@ -240,7 +240,7 @@ impl<'d, T: Instance> I2cSlave<'d, T> { if p.ic_rxflr().read().rxflr() > 0 || me.pending_byte.is_some() { me.drain_fifo(buffer, &mut len); - // we're recieving data, set rx fifo watermark to 12 bytes (3/4 full) to reduce interrupt noise + // we're receiving data, set rx fifo watermark to 12 bytes (3/4 full) to reduce interrupt noise p.ic_rx_tl().write(|w| w.set_rx_tl(11)); } diff --git a/embassy-rp/src/multicore.rs b/embassy-rp/src/multicore.rs index 3b120e349..572d8db91 100644 --- a/embassy-rp/src/multicore.rs +++ b/embassy-rp/src/multicore.rs @@ -58,7 +58,7 @@ const PAUSE_TOKEN: u32 = 0xDEADBEEF; const RESUME_TOKEN: u32 = !0xDEADBEEF; static IS_CORE1_INIT: AtomicBool = AtomicBool::new(false); -/// Represents a partiticular CPU core (SIO_CPUID) +/// Represents a particular CPU core (SIO_CPUID) #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[repr(u8)] diff --git a/embassy-rp/src/pio/mod.rs b/embassy-rp/src/pio/mod.rs index 38ee1f97c..92b2c603e 100644 --- a/embassy-rp/src/pio/mod.rs +++ b/embassy-rp/src/pio/mod.rs @@ -62,7 +62,7 @@ pub enum FifoJoin { #[cfg(feature = "_rp235x")] RxAsControl, /// FJOIN_RX_PUT | FJOIN_RX_GET: RX can be used as a scratch register, - /// not accesible from the CPU + /// not accessible from the CPU #[cfg(feature = "_rp235x")] PioScratch, } diff --git a/embassy-rp/src/pio_programs/i2s.rs b/embassy-rp/src/pio_programs/i2s.rs index 7e5f68ad6..5c49beecb 100644 --- a/embassy-rp/src/pio_programs/i2s.rs +++ b/embassy-rp/src/pio_programs/i2s.rs @@ -1,4 +1,4 @@ -//! Pio backed I2s output and output drivers +//! Pio backed I2S output and output drivers use fixed::traits::ToFixed; @@ -9,7 +9,7 @@ use crate::pio::{ Common, Config, Direction, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, }; -/// This struct represents an i2s receiver & controller driver program +/// This struct represents an I2S receiver & controller driver program pub struct PioI2sInProgram<'d, PIO: Instance> { prg: LoadedProgram<'d, PIO>, } @@ -35,7 +35,7 @@ impl<'d, PIO: Instance> PioI2sInProgram<'d, PIO> { } } -/// Pio backed I2s input driver +/// Pio backed I2S input driver pub struct PioI2sIn<'d, P: Instance, const S: usize> { dma: Peri<'d, AnyChannel>, sm: StateMachine<'d, P, S>, @@ -50,7 +50,7 @@ impl<'d, P: Instance, const S: usize> PioI2sIn<'d, P, S> { // Whether or not to use the MCU's internal pull-down resistor, as the // Pico 2 is known to have problems with the inbuilt pulldowns, many // opt to just use an external pull down resistor to meet requirements of common - // i2s microphones such as the INMP441 + // I2S microphones such as the INMP441 data_pulldown: bool, data_pin: Peri<'d, impl PioPin>, bit_clock_pin: Peri<'d, impl PioPin>, @@ -90,13 +90,13 @@ impl<'d, P: Instance, const S: usize> PioI2sIn<'d, P, S> { Self { dma: dma.into(), sm } } - /// Return an in-prograss dma transfer future. Awaiting it will guarentee a complete transfer. + /// Return an in-progress dma transfer future. Awaiting it will guarantee a complete transfer. pub fn read<'b>(&'b mut self, buff: &'b mut [u32]) -> Transfer<'b, AnyChannel> { self.sm.rx().dma_pull(self.dma.reborrow(), buff, false) } } -/// This struct represents an i2s output driver program +/// This struct represents an I2S output driver program /// /// The sample bit-depth is set through scratch register `Y`. /// `Y` has to be set to sample bit-depth - 2. @@ -128,14 +128,14 @@ impl<'d, PIO: Instance> PioI2sOutProgram<'d, PIO> { } } -/// Pio backed I2s output driver +/// Pio backed I2S output driver pub struct PioI2sOut<'d, P: Instance, const S: usize> { dma: Peri<'d, AnyChannel>, sm: StateMachine<'d, P, S>, } impl<'d, P: Instance, const S: usize> PioI2sOut<'d, P, S> { - /// Configure a state machine to output I2s + /// Configure a state machine to output I2S pub fn new( common: &mut Common<'d, P>, mut sm: StateMachine<'d, P, S>, @@ -179,7 +179,7 @@ impl<'d, P: Instance, const S: usize> PioI2sOut<'d, P, S> { Self { dma: dma.into(), sm } } - /// Return an in-prograss dma transfer future. Awaiting it will guarentee a complete transfer. + /// Return an in-progress dma transfer future. Awaiting it will guarantee a complete transfer. pub fn write<'b>(&'b mut self, buff: &'b [u32]) -> Transfer<'b, AnyChannel> { self.sm.tx().dma_push(self.dma.reborrow(), buff, false) } diff --git a/embassy-rp/src/pio_programs/pwm.rs b/embassy-rp/src/pio_programs/pwm.rs index ba06bb3c1..e4ad4a6f0 100644 --- a/embassy-rp/src/pio_programs/pwm.rs +++ b/embassy-rp/src/pio_programs/pwm.rs @@ -67,7 +67,7 @@ impl<'d, T: Instance, const SM: usize> PioPwm<'d, T, SM> { Self { sm, pin } } - /// Enable's the PIO program, continuing the wave generation from the PIO program. + /// Enables the PIO program, continuing the wave generation from the PIO program. pub fn start(&mut self) { self.sm.set_enable(true); } diff --git a/embassy-rp/src/pio_programs/spi.rs b/embassy-rp/src/pio_programs/spi.rs index b10fc6628..765ffaa06 100644 --- a/embassy-rp/src/pio_programs/spi.rs +++ b/embassy-rp/src/pio_programs/spi.rs @@ -1,4 +1,4 @@ -//! PIO backed SPi drivers +//! PIO backed SPI drivers use core::marker::PhantomData; @@ -83,7 +83,7 @@ pub enum Error { // No errors for now } -/// PIO based Spi driver. +/// PIO based SPI driver. /// Unlike other PIO programs, the PIO SPI driver owns and holds a reference to /// the PIO memory it uses. This is so that it can be reconfigured at runtime if /// desired. diff --git a/embassy-rp/src/pio_programs/uart.rs b/embassy-rp/src/pio_programs/uart.rs index 444efb5db..d59596dd1 100644 --- a/embassy-rp/src/pio_programs/uart.rs +++ b/embassy-rp/src/pio_programs/uart.rs @@ -130,7 +130,7 @@ impl<'d, PIO: Instance> PioUartRxProgram<'d, PIO> { } } -/// PIO backed Uart reciever +/// PIO backed Uart receiver pub struct PioUartRx<'d, PIO: Instance, const SM: usize> { sm_rx: StateMachine<'d, PIO, SM>, } diff --git a/embassy-rp/src/rom_data/rp2040.rs b/embassy-rp/src/rom_data/rp2040.rs index 5a74eddd6..27a8d8981 100644 --- a/embassy-rp/src/rom_data/rp2040.rs +++ b/embassy-rp/src/rom_data/rp2040.rs @@ -30,7 +30,7 @@ const DATA_TABLE: *const u16 = 0x0000_0016 as _; /// Address of the version number of the ROM. const VERSION_NUMBER: *const u8 = 0x0000_0013 as _; -/// Retrive rom content from a table using a code. +/// Retrieve rom content from a table using a code. fn rom_table_lookup(table: *const u16, tag: RomFnTableCode) -> T { unsafe { let rom_table_lookup_ptr: *const u32 = rom_hword_as_ptr(ROM_TABLE_LOOKUP_PTR); diff --git a/embassy-rp/src/rtc/mod.rs b/embassy-rp/src/rtc/mod.rs index 68fb3b765..054572903 100644 --- a/embassy-rp/src/rtc/mod.rs +++ b/embassy-rp/src/rtc/mod.rs @@ -47,7 +47,7 @@ impl<'d, T: Instance> Rtc<'d, T> { Self { inner } } - /// Enable or disable the leap year check. The rp2040 chip will always add a Feb 29th on every year that is divisable by 4, but this may be incorrect (e.g. on century years). This function allows you to disable this check. + /// Enable or disable the leap year check. The rp2040 chip will always add a Feb 29th on every year that is divisible by 4, but this may be incorrect (e.g. on century years). This function allows you to disable this check. /// /// Leap year checking is enabled by default. pub fn set_leap_year_check(&mut self, leap_year_check_enabled: bool) { diff --git a/embassy-rp/src/spi.rs b/embassy-rp/src/spi.rs index 559b3b909..d9410e78d 100644 --- a/embassy-rp/src/spi.rs +++ b/embassy-rp/src/spi.rs @@ -157,7 +157,7 @@ impl<'d, T: Instance, M: Mode> Spi<'d, T, M> { /// Private function to apply SPI configuration (phase, polarity, frequency) settings. /// - /// Driver should be disabled before making changes and reenabled after the modifications + /// Driver should be disabled before making changes and re-enabled after the modifications /// are applied. fn apply_config(inner: &Peri<'d, T>, config: &Config) { let p = inner.regs(); diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index 43187df2d..8be87a5d2 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs @@ -315,7 +315,7 @@ impl<'d, M: Mode> UartRx<'d, M> { } /// Returns Ok(len) if no errors occurred. Returns Err((len, err)) if an error was - /// encountered. in both cases, `len` is the number of *good* bytes copied into + /// encountered. In both cases, `len` is the number of *good* bytes copied into /// `buffer`. fn drain_fifo(&mut self, buffer: &mut [u8]) -> Result { let r = self.info.regs; -- cgit