diff --git a/esp-hal/src/dma/gdma.rs b/esp-hal/src/dma/gdma.rs index e536c5c6b1..c271cc17fa 100644 --- a/esp-hal/src/dma/gdma.rs +++ b/esp-hal/src/dma/gdma.rs @@ -37,6 +37,11 @@ impl DmaChannel for AnyGdmaChannel { type Rx = AnyGdmaRxChannel; type Tx = AnyGdmaTxChannel; + fn set_priority(&self, priority: DmaPriority) { + AnyGdmaRxChannel(self.0).set_priority(priority); + AnyGdmaTxChannel(self.0).set_priority(priority); + } + unsafe fn split_internal(self, _: crate::private::Internal) -> (Self::Rx, Self::Tx) { (AnyGdmaRxChannel(self.0), AnyGdmaTxChannel(self.0)) } @@ -608,6 +613,10 @@ macro_rules! impl_channel { type Rx = AnyGdmaRxChannel; type Tx = AnyGdmaTxChannel; + fn set_priority(&self, priority: DmaPriority) { + AnyGdmaChannel($num).set_priority(priority); + } + unsafe fn split_internal(self, _: $crate::private::Internal) -> (Self::Rx, Self::Tx) { (AnyGdmaRxChannel($num), AnyGdmaTxChannel($num)) } diff --git a/esp-hal/src/dma/mod.rs b/esp-hal/src/dma/mod.rs index 37fde1b054..6e59366caf 100644 --- a/esp-hal/src/dma/mod.rs +++ b/esp-hal/src/dma/mod.rs @@ -1613,6 +1613,10 @@ pub trait DmaChannel: Peripheral
{ /// A description of the TX half of a DMA Channel. type Tx: DmaTxChannel; + /// Sets the priority of the DMA channel. + #[cfg(gdma)] + fn set_priority(&self, priority: DmaPriority); + /// Splits the DMA channel into its RX and TX halves. #[cfg(any(not(esp32c2), not(esp32s3)))] fn split(self) -> (Self::Rx, Self::Tx) {