mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-28 21:00:59 +00:00
Add examples for polling DMA transfers.
Only in the SPI case, but the I2S case has the same API so this should be fine.
This commit is contained in:
parent
8baf4df20b
commit
a6835d9cec
@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Add some miscellaneous examples for the ESP32-H2 (#548)
|
||||
- Add initial support for PCNT in ESP32-H2 (#551)
|
||||
- Add initial support for RMT in ESP32-H2 (#556)
|
||||
- Add a fn to poll DMA transfers
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -98,6 +98,13 @@ fn main() -> ! {
|
||||
|
||||
let transfer = spi.dma_transfer(send, receive).unwrap();
|
||||
// here we could do something else while DMA transfer is in progress
|
||||
let mut i = 0;
|
||||
// Check is_done until the transfer is almost done (32000 bytes at 100kHz is
|
||||
// 2.56 seconds), then move to wait().
|
||||
while !transfer.is_done() && i < 10 {
|
||||
delay.delay_ms(250u32);
|
||||
i += 1;
|
||||
}
|
||||
// the buffers and spi is moved into the transfer and we can get it back via
|
||||
// `wait`
|
||||
(receive, send, spi) = transfer.wait();
|
||||
|
@ -99,6 +99,13 @@ fn main() -> ! {
|
||||
|
||||
let transfer = spi.dma_transfer(send, receive).unwrap();
|
||||
// here we could do something else while DMA transfer is in progress
|
||||
let mut i = 0;
|
||||
// Check is_done until the transfer is almost done (32000 bytes at 100kHz is
|
||||
// 2.56 seconds), then move to wait().
|
||||
while !transfer.is_done() && i < 10 {
|
||||
delay.delay_ms(250u32);
|
||||
i += 1;
|
||||
}
|
||||
// the buffers and spi is moved into the transfer and we can get it back via
|
||||
// `wait`
|
||||
(receive, send, spi) = transfer.wait();
|
||||
|
@ -106,6 +106,13 @@ fn main() -> ! {
|
||||
|
||||
let transfer = spi.dma_transfer(send, receive).unwrap();
|
||||
// here we could do something else while DMA transfer is in progress
|
||||
let mut i = 0;
|
||||
// Check is_done until the transfer is almost done (32000 bytes at 100kHz is
|
||||
// 2.56 seconds), then move to wait().
|
||||
while !transfer.is_done() && i < 10 {
|
||||
delay.delay_ms(250u32);
|
||||
i += 1;
|
||||
}
|
||||
// the buffers and spi is moved into the transfer and we can get it back via
|
||||
// `wait`
|
||||
(receive, send, spi) = transfer.wait();
|
||||
|
@ -107,6 +107,13 @@ fn main() -> ! {
|
||||
|
||||
let transfer = spi.dma_transfer(send, receive).unwrap();
|
||||
// here we could do something else while DMA transfer is in progress
|
||||
let mut i = 0;
|
||||
// Check is_done until the transfer is almost done (32000 bytes at 100kHz is
|
||||
// 2.56 seconds), then move to wait().
|
||||
while !transfer.is_done() && i < 10 {
|
||||
delay.delay_ms(250u32);
|
||||
i += 1;
|
||||
}
|
||||
// the buffers and spi is moved into the transfer and we can get it back via
|
||||
// `wait`
|
||||
(receive, send, spi) = transfer.wait();
|
||||
|
@ -98,6 +98,13 @@ fn main() -> ! {
|
||||
|
||||
let transfer = spi.dma_transfer(send, receive).unwrap();
|
||||
// here we could do something else while DMA transfer is in progress
|
||||
let mut i = 0;
|
||||
// Check is_done until the transfer is almost done (32000 bytes at 100kHz is
|
||||
// 2.56 seconds), then move to wait().
|
||||
while !transfer.is_done() && i < 10 {
|
||||
delay.delay_ms(250u32);
|
||||
i += 1;
|
||||
}
|
||||
// the buffers and spi is moved into the transfer and we can get it back via
|
||||
// `wait`
|
||||
(receive, send, spi) = transfer.wait();
|
||||
|
@ -106,6 +106,13 @@ fn main() -> ! {
|
||||
|
||||
let transfer = spi.dma_transfer(send, receive).unwrap();
|
||||
// here we could do something else while DMA transfer is in progress
|
||||
let mut i = 0;
|
||||
// Check is_done until the transfer is almost done (32000 bytes at 100kHz is
|
||||
// 2.56 seconds), then move to wait().
|
||||
while !transfer.is_done() && i < 10 {
|
||||
delay.delay_ms(250u32);
|
||||
i += 1;
|
||||
}
|
||||
// the buffers and spi is moved into the transfer and we can get it back via
|
||||
// `wait`
|
||||
(receive, send, spi) = transfer.wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user