Skip to content

Commit

Permalink
Add DMA functions to IRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfFan committed Jan 26, 2024
1 parent 58b2329 commit 9fc2c4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- ESP32-S3: Added support for 80Mhz PSRAM (#1069)
- ESP32-C3/S3: Add workaround for USB pin exchange on usb-serial-jtag (#1104).
- ESP32C6: Added LP_UART initialization (#1113)
- Add `optimize-spi-in-iram` feature to `esp-hal-common` (#1096)

### Changed

- Set up interrupts for the DMA and async enabled peripherals only when `async` feature is provided (#1042)
Expand Down
6 changes: 6 additions & 0 deletions esp-hal-common/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ pub mod dma {
/// This will return a [SpiDmaTransfer] owning the buffer(s) and the SPI
/// instance. The maximum amount of data to be sent is 32736
/// bytes.
#[cfg_attr(feature = "optimize-spi-in-iram", ram)]
pub fn dma_write<TXBUF>(
mut self,
words: TXBUF,
Expand All @@ -1063,6 +1064,7 @@ pub mod dma {
/// This will return a [SpiDmaTransfer] owning the buffer(s) and the SPI
/// instance. The maximum amount of data to be received is 32736
/// bytes.
#[cfg_attr(feature = "optimize-spi-in-iram", ram)]
pub fn dma_read<RXBUF>(
mut self,
mut words: RXBUF,
Expand Down Expand Up @@ -1129,6 +1131,7 @@ pub mod dma {
C::P: SpiPeripheral,
M: IsHalfDuplex,
{
#[cfg_attr(feature = "optimize-spi-in-iram", ram)]
pub fn read<RXBUF>(
mut self,
data_mode: SpiDataMode,
Expand Down Expand Up @@ -1202,6 +1205,7 @@ pub mod dma {
})
}

#[cfg_attr(feature = "optimize-spi-in-iram", ram)]
pub fn write<TXBUF>(
mut self,
data_mode: SpiDataMode,
Expand Down Expand Up @@ -1846,6 +1850,7 @@ where
Ok(words)
}

#[cfg_attr(feature = "optimize-spi-in-iram", ram)]
fn start_write_bytes_dma<'w>(
&mut self,
ptr: *const u8,
Expand Down Expand Up @@ -1876,6 +1881,7 @@ where
Ok(())
}

#[cfg_attr(feature = "optimize-spi-in-iram", ram)]
fn start_read_bytes_dma<'w>(
&mut self,
ptr: *mut u8,
Expand Down

0 comments on commit 9fc2c4a

Please sign in to comment.