Skip to content

Commit

Permalink
add DMA cndtr getter function
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Dec 28, 2022
1 parent 3a0c163 commit 113e26f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ pub trait Channel: private::Channel {
self.ch().ndtr.write(|w| w.ndt().bits(len));
}

/// Get the content of the number of data (NDTR) register
///
/// If the DMA has not been enabled yet, this will be the value which
/// was set with [`set_transfer_length`]. If the DMA is active, the value
/// indicates the number of remaining bytes to be transmitted. This value
/// is decremented by the hardware after each DMA transfer.
fn get_remaining_transfer_len(&self) -> u16 {
self.ch().ndtr.read().ndt().bits()
}

/// Set the word size.
///
/// # Panics
Expand Down

0 comments on commit 113e26f

Please sign in to comment.