From 79967fc9c45f60ff60e268b5e182351196a32f4b Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Tue, 27 Aug 2024 13:55:24 +0100 Subject: [PATCH] spi docs rejig --- esp-hal/src/spi/master.rs | 14 +++----------- hil-test/tests/spi_full_duplex_dma.rs | 2 +- hil-test/tests/spi_full_duplex_dma_async.rs | 2 +- hil-test/tests/spi_full_duplex_dma_pcnt.rs | 2 +- hil-test/tests/spi_half_duplex_read.rs | 2 +- hil-test/tests/spi_half_duplex_write.rs | 2 +- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index 1bdc519de1a..4a610c1dfaa 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -58,6 +58,7 @@ use core::marker::PhantomData; +pub use dma::*; #[cfg(not(any(esp32, esp32s2)))] use enumset::EnumSet; #[cfg(not(any(esp32, esp32s2)))] @@ -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)] @@ -944,8 +937,7 @@ where } } -/// DMA (Direct Memory Access) funtionality (Master). -pub mod dma { +mod dma { use core::{ cmp::min, sync::atomic::{fence, Ordering}, @@ -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::*; diff --git a/hil-test/tests/spi_full_duplex_dma.rs b/hil-test/tests/spi_full_duplex_dma.rs index b530e2e1a1f..7810c4de7b2 100644 --- a/hil-test/tests/spi_full_duplex_dma.rs +++ b/hil-test/tests/spi_full_duplex_dma.rs @@ -21,7 +21,7 @@ use esp_hal::{ peripherals::{Peripherals, SPI2}, prelude::*, spi::{ - master::{dma::SpiDma, Spi}, + master::{Spi, SpiDma}, FullDuplexMode, SpiMode, }, diff --git a/hil-test/tests/spi_full_duplex_dma_async.rs b/hil-test/tests/spi_full_duplex_dma_async.rs index 4a392c257e9..3dd9bc45998 100644 --- a/hil-test/tests/spi_full_duplex_dma_async.rs +++ b/hil-test/tests/spi_full_duplex_dma_async.rs @@ -34,7 +34,7 @@ use esp_hal::{ peripherals::{Peripherals, SPI2}, prelude::*, spi::{ - master::{dma::SpiDmaBus, Spi}, + master::{Spi, SpiDmaBus}, FullDuplexMode, SpiMode, }, diff --git a/hil-test/tests/spi_full_duplex_dma_pcnt.rs b/hil-test/tests/spi_full_duplex_dma_pcnt.rs index e304784240d..50e78fea918 100644 --- a/hil-test/tests/spi_full_duplex_dma_pcnt.rs +++ b/hil-test/tests/spi_full_duplex_dma_pcnt.rs @@ -30,7 +30,7 @@ use esp_hal::{ peripherals::{Peripherals, SPI2}, prelude::*, spi::{ - master::{dma::SpiDma, Spi}, + master::{Spi, SpiDma}, FullDuplexMode, SpiMode, }, diff --git a/hil-test/tests/spi_half_duplex_read.rs b/hil-test/tests/spi_half_duplex_read.rs index 330c8ff8054..eda40ba5e55 100644 --- a/hil-test/tests/spi_half_duplex_read.rs +++ b/hil-test/tests/spi_half_duplex_read.rs @@ -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, diff --git a/hil-test/tests/spi_half_duplex_write.rs b/hil-test/tests/spi_half_duplex_write.rs index 22e363d25b3..e62ecd94d3d 100644 --- a/hil-test/tests/spi_half_duplex_write.rs +++ b/hil-test/tests/spi_half_duplex_write.rs @@ -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,