Skip to content

Commit

Permalink
reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed Feb 6, 2025
1 parent 31a4280 commit 61bfe35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ impl<'d> Spi<'d, Blocking> {
/// Constructs an SPI instance in 8bit dataframe mode.
///
/// # Errors
///
/// See [`Spi::apply_config`].
pub fn new(
spi: impl Peripheral<P = impl PeripheralInstance> + 'd,
Expand Down Expand Up @@ -1017,6 +1018,7 @@ where
/// Change the bus configuration.
///
/// # Errors.
///
/// If frequency passed in config exceeds
#[cfg_attr(not(esp32h2), doc = " 80MHz")]
#[cfg_attr(esp32h2, doc = " 48MHz")]
Expand Down Expand Up @@ -1595,6 +1597,7 @@ mod dma {
/// Change the bus configuration.
///
/// # Errors.
///
/// If frequency passed in config exceeds
#[cfg_attr(not(esp32h2), doc = " 80MHz")]
#[cfg_attr(esp32h2, doc = " 48MHz")]
Expand Down Expand Up @@ -2064,6 +2067,7 @@ mod dma {
/// Change the bus configuration.
///
/// # Errors.
///
/// If frequency passed in config exceeds
#[cfg_attr(not(esp32h2), doc = " 80MHz")]
#[cfg_attr(esp32h2, doc = " 48MHz")]
Expand Down
11 changes: 8 additions & 3 deletions esp-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ where
/// Note that this also changes the configuration of the TX half.
///
/// # Errors
///
/// [`ConfigError::UnsupportedFifoThreshold`] will be returned if the RX
/// FIFO threshold passed in `Config` exceeds the maximum value (
#[cfg_attr(esp32, doc = "0x7F")]
Expand Down Expand Up @@ -1035,6 +1036,7 @@ impl<'d> Uart<'d, Blocking> {
/// ```
///
/// # Errors
///
/// See [`Uart::apply_config`].
pub fn new(
uart: impl Peripheral<P = impl Instance> + 'd,
Expand Down Expand Up @@ -1227,7 +1229,8 @@ where

/// Change the configuration.
///
/// # Errors.
/// # Errors
///
/// [`ConfigError::UnsupportedFifoThreshold`] will be returned in the cases
/// described in [`UartRx::apply_config`] and
/// [`ConfigError::UnsupportedBaudrate`] if baud rate passed in config
Expand Down Expand Up @@ -2343,6 +2346,7 @@ impl Info {
/// Configures the RX-FIFO threshold
///
/// # Errors
///
/// [`Err(ConfigError::UnsupportedFifoThreshold)`][ConfigError::UnsupportedFifoThreshold] if provided value exceeds maximum value
/// for SOC :
/// - `esp32` **0x7F**
Expand Down Expand Up @@ -2379,7 +2383,8 @@ impl Info {
/// `timeout` - the number of symbols ("bytes") to wait for before
/// triggering a timeout. Pass None to disable the timeout.
///
/// # Errors
/// # Errors
///
/// [`Err(ConfigError::UnsupportedTimeout)`][ConfigError::UnsupportedTimeout] if the provided value exceeds
/// the maximum value for SOC :
/// - `esp32`: Symbol size is fixed to 8, do not pass a value > **0x7F**.
Expand Down Expand Up @@ -2631,7 +2636,7 @@ impl Info {
}

fn verify_baudrate(&self, clk: u32, config: &Config) -> Result<(), ConfigError> {
// taken from https://github.com/espressif/esp-idf/blob/master/components/hal/esp32c6/include/hal/uart_ll.h#L433-L444
// taken from https://github.com/espressif/esp-idf/blob/c5865270b50529cd32353f588d8a917d89f3dba4/components/hal/esp32c6/include/hal/uart_ll.h#L433-L444
// (it's different for different chips)
let clkdiv_reg = self.regs().clkdiv().read();
let clkdiv_frag = clkdiv_reg.frag().bits() as u32;
Expand Down

0 comments on commit 61bfe35

Please sign in to comment.