Skip to content

Commit

Permalink
spi docs rejig
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Aug 27, 2024
1 parent bcdbbd8 commit 79967fc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
14 changes: 3 additions & 11 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

use core::marker::PhantomData;

pub use dma::*;
#[cfg(not(any(esp32, esp32s2)))]
use enumset::EnumSet;
#[cfg(not(any(esp32, esp32s2)))]
Expand Down Expand Up @@ -87,14 +88,6 @@ use crate::{
system::PeripheralClockControl,
};

/// Prelude for the SPI (Master) driver
pub mod prelude {
pub use super::{
Instance as _esp_hal_spi_master_Instance,
InstanceDma as _esp_hal_spi_master_InstanceDma,
};
}

/// Enumeration of possible SPI interrupt events.
#[cfg(not(any(esp32, esp32s2)))]
#[derive(EnumSetType)]
Expand Down Expand Up @@ -944,8 +937,7 @@ where
}
}

/// DMA (Direct Memory Access) funtionality (Master).
pub mod dma {
mod dma {
use core::{
cmp::min,
sync::atomic::{fence, Ordering},
Expand Down Expand Up @@ -1845,7 +1837,7 @@ pub mod dma {

/// Async functionality
#[cfg(feature = "async")]
pub mod asynch {
mod asynch {
use core::{cmp::min, mem::take};

use super::*;
Expand Down
2 changes: 1 addition & 1 deletion hil-test/tests/spi_full_duplex_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use esp_hal::{
peripherals::{Peripherals, SPI2},
prelude::*,
spi::{
master::{dma::SpiDma, Spi},
master::{Spi, SpiDma},
FullDuplexMode,
SpiMode,
},
Expand Down
2 changes: 1 addition & 1 deletion hil-test/tests/spi_full_duplex_dma_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use esp_hal::{
peripherals::{Peripherals, SPI2},
prelude::*,
spi::{
master::{dma::SpiDmaBus, Spi},
master::{Spi, SpiDmaBus},
FullDuplexMode,
SpiMode,
},
Expand Down
2 changes: 1 addition & 1 deletion hil-test/tests/spi_full_duplex_dma_pcnt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use esp_hal::{
peripherals::{Peripherals, SPI2},
prelude::*,
spi::{
master::{dma::SpiDma, Spi},
master::{Spi, SpiDma},
FullDuplexMode,
SpiMode,
},
Expand Down
2 changes: 1 addition & 1 deletion hil-test/tests/spi_half_duplex_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use esp_hal::{
peripherals::{Peripherals, SPI2},
prelude::*,
spi::{
master::{dma::SpiDma, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi, SpiDma},
HalfDuplexMode,
SpiDataMode,
SpiMode,
Expand Down
2 changes: 1 addition & 1 deletion hil-test/tests/spi_half_duplex_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use esp_hal::{
peripherals::{Peripherals, SPI2},
prelude::*,
spi::{
master::{dma::SpiDma, Address, Command, HalfDuplexReadWrite, Spi},
master::{Address, Command, HalfDuplexReadWrite, Spi, SpiDma},
HalfDuplexMode,
SpiDataMode,
SpiMode,
Expand Down

0 comments on commit 79967fc

Please sign in to comment.