Skip to content

Commit e8cbec8

Browse files
Add a function to get DMA transfer words remaining (#142)
1 parent 8bc3297 commit e8cbec8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/dma.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ pub trait Channel: private::Channel {
165165
self.ch().ndtr.write(|w| unsafe { w.ndt().bits(len) });
166166
}
167167

168+
/// Get the number of words left to transfer.
169+
fn get_transfer_remaining(&mut self) -> u16 {
170+
self.ch().ndtr.read().ndt().bits()
171+
}
172+
168173
/// Set the word size.
169174
fn set_word_size(&mut self, wsize: WordSize) {
170175
self.ch().cr.modify(|_, w| unsafe {

0 commit comments

Comments
 (0)