macro_rules! dma_buffers {
($rx_size:expr, $tx_size:expr, burst = $burst:ident) => { ... };
($rx_size:expr, $tx_size:expr) => { ... };
($size:expr) => { ... };
}Available on crate feature
unstable only.Expand description
Convenience macro to create DMA buffers and descriptors.
With burst = SizeN, each buffer is aligned to N bytes. See
BurstSize.
ยงExamples
use esp_hal::dma_buffers;
// RX and TX buffers are 32000 bytes - passing only one parameter makes RX
// and TX the same size.
let (rx_buffer, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(32000, 32000);
// Buffers aligned to 64 bytes, for `DmaRxBuf::new_with_min_burst`.
let (rx_buffer, rx_descriptors, tx_buffer, tx_descriptors) =
dma_buffers!(32000, 32000, burst = Size64);