You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The uart-dma example does not show how to send data with different length using dma.
Is this not supported by this crate or is it even a hardware limitation?
example:
[...]letdata_to_send = [&b"Hello"[..],// These are to be sent one at a time to simulate sending messages of different sizes&b"I"[..],&b"am Bob the Bot"[..],];// Setup DMA for USART2 TX with dma channel 1.
let mut transfer =
streams
.0.into_memory_to_peripheral_transfer(tx.enable_dma(),&mut tx_buffer[..], config);
transfer.start(|_tx| {});loop{while !transfer.get_transfer_complete_flag(){}
delay_syst.delay(1000.millis());
led.toggle().unwrap();
transfer.restart(|_tx| {});// <---------- Do something here to either change buffer to data_to_send[i],// , or copy to tx_buffer (assuming it is large enough) and tell `transfer` the new data length}
The text was updated successfully, but these errors were encountered:
To me I think it would have made more sense if the uart and dma stream were combined into a "uart-with-dma" rather than a "dma-stream-thing that happens to wrap an uart".
So instead of
letmut transfer =
streams
.0.into_memory_to_peripheral_transfer(tx.enable_dma(),&mut tx_buffer[..], config);
since Tx<UART2, PIN, DMA> can then impl core::fmt::Write, set senseful dma configs automatically etc since it has more knowledge of how the dma channel will be used.
The uart-dma example does not show how to send data with different length using dma.
Is this not supported by this crate or is it even a hardware limitation?
example:
The text was updated successfully, but these errors were encountered: