@@ -101,11 +101,21 @@ impl<const BASE: usize, const CH: u8> Dma<BASE, CH> {
101
101
unsafe { Self :: NDT . write_volatile ( ndt) }
102
102
}
103
103
104
+ #[ inline]
105
+ pub fn num_data_xfer ( & self ) -> u32 {
106
+ unsafe { Self :: NDT . read_volatile ( ) }
107
+ }
108
+
104
109
#[ inline]
105
110
pub fn set_cr ( & mut self , cr : Cr ) {
106
111
unsafe { Self :: CR . write_volatile ( cr. raw ( ) ) }
107
112
}
108
113
114
+ #[ inline]
115
+ pub fn cr ( & self ) -> Cr {
116
+ Cr :: new ( unsafe { Self :: CR . read_volatile ( ) } )
117
+ }
118
+
109
119
#[ inline]
110
120
pub fn set_mux_cr_reqid ( & mut self , req_id : u8 ) {
111
121
unsafe { Self :: MUX_CR . write_volatile ( req_id as u32 ) }
@@ -133,7 +143,9 @@ pub(crate) mod sealed {
133
143
fn set_periph_addr ( & mut self , pa : u32 ) ;
134
144
fn set_mem_addr ( & mut self , ma : u32 ) ;
135
145
fn set_num_data_xfer ( & mut self , ndt : u32 ) ;
146
+ fn num_data_xfer ( & self ) -> u32 ;
136
147
fn set_cr ( & mut self , cr : Cr ) ;
148
+ fn cr ( & self ) -> Cr ;
137
149
fn set_mux_cr_reqid ( & mut self , req_id : u8 ) ;
138
150
fn sync_ovr ( & self ) -> bool ;
139
151
fn clr_sync_ovr ( & mut self ) ;
@@ -256,10 +268,18 @@ macro_rules! dma_ch {
256
268
self . dma. set_num_data_xfer( ndt)
257
269
}
258
270
#[ inline]
271
+ fn num_data_xfer( & self ) -> u32 {
272
+ self . dma. num_data_xfer( )
273
+ }
274
+ #[ inline]
259
275
fn set_cr( & mut self , cr: Cr ) {
260
276
self . dma. set_cr( cr)
261
277
}
262
278
#[ inline]
279
+ fn cr( & self ) -> Cr {
280
+ self . dma. cr( )
281
+ }
282
+ #[ inline]
263
283
fn set_mux_cr_reqid( & mut self , req_id: u8 ) {
264
284
self . dma. set_mux_cr_reqid( req_id)
265
285
}
0 commit comments