Skip to content

Commit

Permalink
format doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajSadel committed Mar 6, 2025
1 parent c2007b7 commit cb3b548
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,10 @@ impl core::fmt::Display for ConfigError {
/// # use esp_hal::spi::master::{Config, Spi};
/// let mut spi = Spi::new(
/// peripherals.SPI2,
/// Config::default().with_frequency(Rate::from_khz(100)).
/// with_mode(Mode::_0) )?
/// Config::default()
/// .with_frequency(Rate::from_khz(100))
/// .with_mode(Mode::_0),
/// )?
/// .with_sck(peripherals.GPIO0)
/// .with_mosi(peripherals.GPIO1)
/// .with_miso(peripherals.GPIO2);
Expand Down Expand Up @@ -760,8 +762,10 @@ impl<'d> Spi<'d, Blocking> {
///
/// let mut spi = Spi::new(
/// peripherals.SPI2,
/// Config::default().with_frequency(Rate::from_khz(100)).
/// with_mode(Mode::_0) )?
/// Config::default()
/// .with_frequency(Rate::from_khz(100))
/// .with_mode(Mode::_0),
/// )?
/// .with_dma(dma_channel)
/// .with_buffers(dma_rx_buf, dma_tx_buf);
/// # Ok(())
Expand Down Expand Up @@ -1262,8 +1266,10 @@ mod dma {
///
/// let mut spi = Spi::new(
/// peripherals.SPI2,
/// Config::default().with_frequency(Rate::from_khz(100)).
/// with_mode(Mode::_0) )?
/// Config::default()
/// .with_frequency(Rate::from_khz(100))
/// .with_mode(Mode::_0),
/// )?
/// .with_dma(dma_channel)
/// .with_buffers(dma_rx_buf, dma_tx_buf);
/// # Ok(())
Expand Down

0 comments on commit cb3b548

Please sign in to comment.