@@ -101,11 +101,21 @@ impl<const BASE: usize, const CH: u8> Dma<BASE, CH> {
101101 unsafe { Self :: NDT . write_volatile ( ndt) }
102102 }
103103
104+ #[ inline]
105+ pub fn num_data_xfer ( & self ) -> u32 {
106+ unsafe { Self :: NDT . read_volatile ( ) }
107+ }
108+
104109 #[ inline]
105110 pub fn set_cr ( & mut self , cr : Cr ) {
106111 unsafe { Self :: CR . write_volatile ( cr. raw ( ) ) }
107112 }
108113
114+ #[ inline]
115+ pub fn cr ( & self ) -> Cr {
116+ Cr :: new ( unsafe { Self :: CR . read_volatile ( ) } )
117+ }
118+
109119 #[ inline]
110120 pub fn set_mux_cr_reqid ( & mut self , req_id : u8 ) {
111121 unsafe { Self :: MUX_CR . write_volatile ( req_id as u32 ) }
@@ -133,7 +143,9 @@ pub(crate) mod sealed {
133143 fn set_periph_addr ( & mut self , pa : u32 ) ;
134144 fn set_mem_addr ( & mut self , ma : u32 ) ;
135145 fn set_num_data_xfer ( & mut self , ndt : u32 ) ;
146+ fn num_data_xfer ( & self ) -> u32 ;
136147 fn set_cr ( & mut self , cr : Cr ) ;
148+ fn cr ( & self ) -> Cr ;
137149 fn set_mux_cr_reqid ( & mut self , req_id : u8 ) ;
138150 fn sync_ovr ( & self ) -> bool ;
139151 fn clr_sync_ovr ( & mut self ) ;
@@ -256,10 +268,18 @@ macro_rules! dma_ch {
256268 self . dma. set_num_data_xfer( ndt)
257269 }
258270 #[ inline]
271+ fn num_data_xfer( & self ) -> u32 {
272+ self . dma. num_data_xfer( )
273+ }
274+ #[ inline]
259275 fn set_cr( & mut self , cr: Cr ) {
260276 self . dma. set_cr( cr)
261277 }
262278 #[ inline]
279+ fn cr( & self ) -> Cr {
280+ self . dma. cr( )
281+ }
282+ #[ inline]
263283 fn set_mux_cr_reqid( & mut self , req_id: u8 ) {
264284 self . dma. set_mux_cr_reqid( req_id)
265285 }
0 commit comments