Skip to content

Commit

Permalink
Erase channel in Camera and Aes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Fischer committed Sep 30, 2024
1 parent 007e7a9 commit 4b0f36e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- I8080 driver now decides bus width at transfer time rather than construction time. (#2171)
- Replaced `AnyPin` with `InputSignal` and `OutputSignal` and renamed `ErasedPin` to `AnyPin` (#2128)
- Replaced the `ErasedTimer` enum with the `AnyTimer` struct. (#2144)
- `Camera` and `AesDma` now support erasing the DMA channel type (#2258)
- Changed the parameters of `Spi::with_pins` to no longer be optional (#2133)
- Renamed `DummyPin` to `NoPin` and removed all internal logic from it. (#2133)
- The `NO_PIN` constant has been removed. (#2133)
Expand Down
7 changes: 6 additions & 1 deletion esp-hal/src/aes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ pub mod dma {
},
};

#[cfg(gdma)]
type DefaultChannel = crate::dma::AnyDmaChannel;
#[cfg(pdma)]
type DefaultChannel = (); // Replace with PDMA channel once support is added.

const ALIGN_SIZE: usize = core::mem::size_of::<u32>();

/// Specifies the block cipher modes available for AES operations.
Expand All @@ -270,7 +275,7 @@ pub mod dma {
}

/// A DMA capable AES instance.
pub struct AesDma<'d, C>
pub struct AesDma<'d, C = DefaultChannel>
where
C: DmaChannel,
C::P: AesPeripheral,
Expand Down
3 changes: 2 additions & 1 deletion esp-hal/src/lcd_cam/cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ use crate::{
clock::Clocks,
dma::{
dma_private::{DmaSupport, DmaSupportRx},
AnyDmaChannel,
ChannelRx,
DescriptorChain,
DmaChannel,
Expand Down Expand Up @@ -126,7 +127,7 @@ pub struct Cam<'d> {
}

/// Represents the camera interface with DMA support.
pub struct Camera<'d, CH: DmaChannel> {
pub struct Camera<'d, CH: DmaChannel = AnyDmaChannel> {
lcd_cam: PeripheralRef<'d, LCD_CAM>,
rx_channel: ChannelRx<'d, CH>,
rx_chain: DescriptorChain,
Expand Down

0 comments on commit 4b0f36e

Please sign in to comment.