diff options
Diffstat (limited to 'embassy-rp')
| -rw-r--r-- | embassy-rp/CHANGELOG.md | 2 | ||||
| -rw-r--r-- | embassy-rp/src/block.rs | 4 | ||||
| -rw-r--r-- | embassy-rp/src/clocks.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/i2c_slave.rs | 4 | ||||
| -rw-r--r-- | embassy-rp/src/multicore.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/pio/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/pio_programs/i2s.rs | 18 | ||||
| -rw-r--r-- | embassy-rp/src/pio_programs/pwm.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/pio_programs/spi.rs | 4 | ||||
| -rw-r--r-- | embassy-rp/src/pio_programs/uart.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/rom_data/rp2040.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/rtc/mod.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/spi.rs | 2 | ||||
| -rw-r--r-- | embassy-rp/src/uart/mod.rs | 2 |
14 files changed, 25 insertions, 25 deletions
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 | |||
| 8 | <!-- next-header --> | 8 | <!-- next-header --> |
| 9 | ## Unreleased - ReleaseDate | 9 | ## Unreleased - ReleaseDate |
| 10 | 10 | ||
| 11 | - Fix typo in interrupt comment | 11 | - Fix several minor typos in documentation |
| 12 | - Add PIO SPI | 12 | - Add PIO SPI |
| 13 | - Add PIO I2S input | 13 | - Add PIO I2S input |
| 14 | - Add PIO onewire parasite power strong pullup | 14 | - 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 { | |||
| 240 | } | 240 | } |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | /// Create a new unpartition space from run-time values. | 243 | /// Create a new unpartitioned space from run-time values. |
| 244 | /// | 244 | /// |
| 245 | /// Get these from the ROM function `get_partition_table_info` with an argument of `PT_INFO`. | 245 | /// Get these from the ROM function `get_partition_table_info` with an argument of `PT_INFO`. |
| 246 | pub const fn from_raw(permissions_and_location: u32, permissions_and_flags: u32) -> Self { | 246 | pub const fn from_raw(permissions_and_location: u32, permissions_and_flags: u32) -> Self { |
| @@ -714,7 +714,7 @@ impl PartitionTableBlock { | |||
| 714 | new_table | 714 | new_table |
| 715 | } | 715 | } |
| 716 | 716 | ||
| 717 | /// Add a a SHA256 hash of the Block | 717 | /// Add a SHA256 hash of the Block |
| 718 | /// | 718 | /// |
| 719 | /// Adds a `HASH_DEF` covering all the previous items in the Block, and a | 719 | /// Adds a `HASH_DEF` covering all the previous items in the Block, and a |
| 720 | /// `HASH_VALUE` with a SHA-256 hash of them. | 720 | /// `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 { | |||
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | /// CLock configuration. | 270 | /// Clock configuration. |
| 271 | #[non_exhaustive] | 271 | #[non_exhaustive] |
| 272 | pub struct ClockConfig { | 272 | pub struct ClockConfig { |
| 273 | /// Ring oscillator configuration. | 273 | /// 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 { | |||
| 52 | Done, | 52 | Done, |
| 53 | /// Transaction Incomplete, controller trying to read more bytes than were provided | 53 | /// Transaction Incomplete, controller trying to read more bytes than were provided |
| 54 | NeedMoreBytes, | 54 | NeedMoreBytes, |
| 55 | /// Transaction Complere, but controller stopped reading bytes before we ran out | 55 | /// Transaction Complete, but controller stopped reading bytes before we ran out |
| 56 | LeftoverBytes(u16), | 56 | LeftoverBytes(u16), |
| 57 | } | 57 | } |
| 58 | 58 | ||
| @@ -240,7 +240,7 @@ impl<'d, T: Instance> I2cSlave<'d, T> { | |||
| 240 | 240 | ||
| 241 | if p.ic_rxflr().read().rxflr() > 0 || me.pending_byte.is_some() { | 241 | if p.ic_rxflr().read().rxflr() > 0 || me.pending_byte.is_some() { |
| 242 | me.drain_fifo(buffer, &mut len); | 242 | me.drain_fifo(buffer, &mut len); |
| 243 | // we're recieving data, set rx fifo watermark to 12 bytes (3/4 full) to reduce interrupt noise | 243 | // we're receiving data, set rx fifo watermark to 12 bytes (3/4 full) to reduce interrupt noise |
| 244 | p.ic_rx_tl().write(|w| w.set_rx_tl(11)); | 244 | p.ic_rx_tl().write(|w| w.set_rx_tl(11)); |
| 245 | } | 245 | } |
| 246 | 246 | ||
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; | |||
| 58 | const RESUME_TOKEN: u32 = !0xDEADBEEF; | 58 | const RESUME_TOKEN: u32 = !0xDEADBEEF; |
| 59 | static IS_CORE1_INIT: AtomicBool = AtomicBool::new(false); | 59 | static IS_CORE1_INIT: AtomicBool = AtomicBool::new(false); |
| 60 | 60 | ||
| 61 | /// Represents a partiticular CPU core (SIO_CPUID) | 61 | /// Represents a particular CPU core (SIO_CPUID) |
| 62 | #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] | 62 | #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] |
| 63 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 63 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 64 | #[repr(u8)] | 64 | #[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 { | |||
| 62 | #[cfg(feature = "_rp235x")] | 62 | #[cfg(feature = "_rp235x")] |
| 63 | RxAsControl, | 63 | RxAsControl, |
| 64 | /// FJOIN_RX_PUT | FJOIN_RX_GET: RX can be used as a scratch register, | 64 | /// FJOIN_RX_PUT | FJOIN_RX_GET: RX can be used as a scratch register, |
| 65 | /// not accesible from the CPU | 65 | /// not accessible from the CPU |
| 66 | #[cfg(feature = "_rp235x")] | 66 | #[cfg(feature = "_rp235x")] |
| 67 | PioScratch, | 67 | PioScratch, |
| 68 | } | 68 | } |
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 @@ | |||
| 1 | //! Pio backed I2s output and output drivers | 1 | //! Pio backed I2S output and output drivers |
| 2 | 2 | ||
| 3 | use fixed::traits::ToFixed; | 3 | use fixed::traits::ToFixed; |
| 4 | 4 | ||
| @@ -9,7 +9,7 @@ use crate::pio::{ | |||
| 9 | Common, Config, Direction, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, | 9 | Common, Config, Direction, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, |
| 10 | }; | 10 | }; |
| 11 | 11 | ||
| 12 | /// This struct represents an i2s receiver & controller driver program | 12 | /// This struct represents an I2S receiver & controller driver program |
| 13 | pub struct PioI2sInProgram<'d, PIO: Instance> { | 13 | pub struct PioI2sInProgram<'d, PIO: Instance> { |
| 14 | prg: LoadedProgram<'d, PIO>, | 14 | prg: LoadedProgram<'d, PIO>, |
| 15 | } | 15 | } |
| @@ -35,7 +35,7 @@ impl<'d, PIO: Instance> PioI2sInProgram<'d, PIO> { | |||
| 35 | } | 35 | } |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | /// Pio backed I2s input driver | 38 | /// Pio backed I2S input driver |
| 39 | pub struct PioI2sIn<'d, P: Instance, const S: usize> { | 39 | pub struct PioI2sIn<'d, P: Instance, const S: usize> { |
| 40 | dma: Peri<'d, AnyChannel>, | 40 | dma: Peri<'d, AnyChannel>, |
| 41 | sm: StateMachine<'d, P, S>, | 41 | sm: StateMachine<'d, P, S>, |
| @@ -50,7 +50,7 @@ impl<'d, P: Instance, const S: usize> PioI2sIn<'d, P, S> { | |||
| 50 | // Whether or not to use the MCU's internal pull-down resistor, as the | 50 | // Whether or not to use the MCU's internal pull-down resistor, as the |
| 51 | // Pico 2 is known to have problems with the inbuilt pulldowns, many | 51 | // Pico 2 is known to have problems with the inbuilt pulldowns, many |
| 52 | // opt to just use an external pull down resistor to meet requirements of common | 52 | // opt to just use an external pull down resistor to meet requirements of common |
| 53 | // i2s microphones such as the INMP441 | 53 | // I2S microphones such as the INMP441 |
| 54 | data_pulldown: bool, | 54 | data_pulldown: bool, |
| 55 | data_pin: Peri<'d, impl PioPin>, | 55 | data_pin: Peri<'d, impl PioPin>, |
| 56 | bit_clock_pin: Peri<'d, impl PioPin>, | 56 | bit_clock_pin: Peri<'d, impl PioPin>, |
| @@ -90,13 +90,13 @@ impl<'d, P: Instance, const S: usize> PioI2sIn<'d, P, S> { | |||
| 90 | Self { dma: dma.into(), sm } | 90 | Self { dma: dma.into(), sm } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | /// Return an in-prograss dma transfer future. Awaiting it will guarentee a complete transfer. | 93 | /// Return an in-progress dma transfer future. Awaiting it will guarantee a complete transfer. |
| 94 | pub fn read<'b>(&'b mut self, buff: &'b mut [u32]) -> Transfer<'b, AnyChannel> { | 94 | pub fn read<'b>(&'b mut self, buff: &'b mut [u32]) -> Transfer<'b, AnyChannel> { |
| 95 | self.sm.rx().dma_pull(self.dma.reborrow(), buff, false) | 95 | self.sm.rx().dma_pull(self.dma.reborrow(), buff, false) |
| 96 | } | 96 | } |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | /// This struct represents an i2s output driver program | 99 | /// This struct represents an I2S output driver program |
| 100 | /// | 100 | /// |
| 101 | /// The sample bit-depth is set through scratch register `Y`. | 101 | /// The sample bit-depth is set through scratch register `Y`. |
| 102 | /// `Y` has to be set to sample bit-depth - 2. | 102 | /// `Y` has to be set to sample bit-depth - 2. |
| @@ -128,14 +128,14 @@ impl<'d, PIO: Instance> PioI2sOutProgram<'d, PIO> { | |||
| 128 | } | 128 | } |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | /// Pio backed I2s output driver | 131 | /// Pio backed I2S output driver |
| 132 | pub struct PioI2sOut<'d, P: Instance, const S: usize> { | 132 | pub struct PioI2sOut<'d, P: Instance, const S: usize> { |
| 133 | dma: Peri<'d, AnyChannel>, | 133 | dma: Peri<'d, AnyChannel>, |
| 134 | sm: StateMachine<'d, P, S>, | 134 | sm: StateMachine<'d, P, S>, |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | impl<'d, P: Instance, const S: usize> PioI2sOut<'d, P, S> { | 137 | impl<'d, P: Instance, const S: usize> PioI2sOut<'d, P, S> { |
| 138 | /// Configure a state machine to output I2s | 138 | /// Configure a state machine to output I2S |
| 139 | pub fn new( | 139 | pub fn new( |
| 140 | common: &mut Common<'d, P>, | 140 | common: &mut Common<'d, P>, |
| 141 | mut sm: StateMachine<'d, P, S>, | 141 | mut sm: StateMachine<'d, P, S>, |
| @@ -179,7 +179,7 @@ impl<'d, P: Instance, const S: usize> PioI2sOut<'d, P, S> { | |||
| 179 | Self { dma: dma.into(), sm } | 179 | Self { dma: dma.into(), sm } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | /// Return an in-prograss dma transfer future. Awaiting it will guarentee a complete transfer. | 182 | /// Return an in-progress dma transfer future. Awaiting it will guarantee a complete transfer. |
| 183 | pub fn write<'b>(&'b mut self, buff: &'b [u32]) -> Transfer<'b, AnyChannel> { | 183 | pub fn write<'b>(&'b mut self, buff: &'b [u32]) -> Transfer<'b, AnyChannel> { |
| 184 | self.sm.tx().dma_push(self.dma.reborrow(), buff, false) | 184 | self.sm.tx().dma_push(self.dma.reborrow(), buff, false) |
| 185 | } | 185 | } |
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> { | |||
| 67 | Self { sm, pin } | 67 | Self { sm, pin } |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | /// Enable's the PIO program, continuing the wave generation from the PIO program. | 70 | /// Enables the PIO program, continuing the wave generation from the PIO program. |
| 71 | pub fn start(&mut self) { | 71 | pub fn start(&mut self) { |
| 72 | self.sm.set_enable(true); | 72 | self.sm.set_enable(true); |
| 73 | } | 73 | } |
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 @@ | |||
| 1 | //! PIO backed SPi drivers | 1 | //! PIO backed SPI drivers |
| 2 | 2 | ||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | 4 | ||
| @@ -83,7 +83,7 @@ pub enum Error { | |||
| 83 | // No errors for now | 83 | // No errors for now |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | /// PIO based Spi driver. | 86 | /// PIO based SPI driver. |
| 87 | /// Unlike other PIO programs, the PIO SPI driver owns and holds a reference to | 87 | /// Unlike other PIO programs, the PIO SPI driver owns and holds a reference to |
| 88 | /// the PIO memory it uses. This is so that it can be reconfigured at runtime if | 88 | /// the PIO memory it uses. This is so that it can be reconfigured at runtime if |
| 89 | /// desired. | 89 | /// 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> { | |||
| 130 | } | 130 | } |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | /// PIO backed Uart reciever | 133 | /// PIO backed Uart receiver |
| 134 | pub struct PioUartRx<'d, PIO: Instance, const SM: usize> { | 134 | pub struct PioUartRx<'d, PIO: Instance, const SM: usize> { |
| 135 | sm_rx: StateMachine<'d, PIO, SM>, | 135 | sm_rx: StateMachine<'d, PIO, SM>, |
| 136 | } | 136 | } |
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 _; | |||
| 30 | /// Address of the version number of the ROM. | 30 | /// Address of the version number of the ROM. |
| 31 | const VERSION_NUMBER: *const u8 = 0x0000_0013 as _; | 31 | const VERSION_NUMBER: *const u8 = 0x0000_0013 as _; |
| 32 | 32 | ||
| 33 | /// Retrive rom content from a table using a code. | 33 | /// Retrieve rom content from a table using a code. |
| 34 | fn rom_table_lookup<T>(table: *const u16, tag: RomFnTableCode) -> T { | 34 | fn rom_table_lookup<T>(table: *const u16, tag: RomFnTableCode) -> T { |
| 35 | unsafe { | 35 | unsafe { |
| 36 | let rom_table_lookup_ptr: *const u32 = rom_hword_as_ptr(ROM_TABLE_LOOKUP_PTR); | 36 | 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> { | |||
| 47 | Self { inner } | 47 | Self { inner } |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | /// 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. | 50 | /// 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. |
| 51 | /// | 51 | /// |
| 52 | /// Leap year checking is enabled by default. | 52 | /// Leap year checking is enabled by default. |
| 53 | pub fn set_leap_year_check(&mut self, leap_year_check_enabled: bool) { | 53 | 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> { | |||
| 157 | 157 | ||
| 158 | /// Private function to apply SPI configuration (phase, polarity, frequency) settings. | 158 | /// Private function to apply SPI configuration (phase, polarity, frequency) settings. |
| 159 | /// | 159 | /// |
| 160 | /// Driver should be disabled before making changes and reenabled after the modifications | 160 | /// Driver should be disabled before making changes and re-enabled after the modifications |
| 161 | /// are applied. | 161 | /// are applied. |
| 162 | fn apply_config(inner: &Peri<'d, T>, config: &Config) { | 162 | fn apply_config(inner: &Peri<'d, T>, config: &Config) { |
| 163 | let p = inner.regs(); | 163 | 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> { | |||
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | /// Returns Ok(len) if no errors occurred. Returns Err((len, err)) if an error was | 317 | /// Returns Ok(len) if no errors occurred. Returns Err((len, err)) if an error was |
| 318 | /// encountered. in both cases, `len` is the number of *good* bytes copied into | 318 | /// encountered. In both cases, `len` is the number of *good* bytes copied into |
| 319 | /// `buffer`. | 319 | /// `buffer`. |
| 320 | fn drain_fifo(&mut self, buffer: &mut [u8]) -> Result<usize, (usize, Error)> { | 320 | fn drain_fifo(&mut self, buffer: &mut [u8]) -> Result<usize, (usize, Error)> { |
| 321 | let r = self.info.regs; | 321 | let r = self.info.regs; |
