@@ -193,8 +193,8 @@ macro_rules! dac_helper {
193193 pub fn enable( self ) -> $CX<MODE_BITS , Enabled > {
194194 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
195195
196- dac. dac_mcr. modify( |_, w| unsafe { w. $mode( ) . bits( MODE_BITS ) } ) ;
197- dac. dac_cr. modify( |_, w| w. $en( ) . set_bit( ) ) ;
196+ dac. dac_mcr( ) . modify( |_, w| unsafe { w. $mode( ) . bits( MODE_BITS ) } ) ;
197+ dac. dac_cr( ) . modify( |_, w| w. $en( ) . set_bit( ) ) ;
198198
199199 $CX {
200200 _enabled: PhantomData ,
@@ -204,8 +204,8 @@ macro_rules! dac_helper {
204204 pub fn enable_generator( self , config: GeneratorConfig ) -> $CX<MODE_BITS , WaveGenerator > {
205205 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
206206
207- dac. dac_mcr. modify( |_, w| unsafe { w. $mode( ) . bits( MODE_BITS ) } ) ;
208- dac. dac_cr. modify( |_, w| unsafe {
207+ dac. dac_mcr( ) . modify( |_, w| unsafe { w. $mode( ) . bits( MODE_BITS ) } ) ;
208+ dac. dac_cr( ) . modify( |_, w| unsafe {
209209 w. $wave( ) . bits( config. mode) ;
210210 w. $ten( ) . set_bit( ) ;
211211 w. $mamp( ) . bits( config. amp) ;
@@ -235,19 +235,19 @@ macro_rules! dac_helper {
235235 T : DelayUs <u32 >,
236236 {
237237 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
238- dac. dac_cr. modify( |_, w| w. $en( ) . clear_bit( ) ) ;
239- dac. dac_mcr. modify( |_, w| unsafe { w. $mode( ) . bits( 0 ) } ) ;
240- dac. dac_cr. modify( |_, w| w. $cen( ) . set_bit( ) ) ;
238+ dac. dac_cr( ) . modify( |_, w| w. $en( ) . clear_bit( ) ) ;
239+ dac. dac_mcr( ) . modify( |_, w| unsafe { w. $mode( ) . bits( 0 ) } ) ;
240+ dac. dac_cr( ) . modify( |_, w| w. $cen( ) . set_bit( ) ) ;
241241 let mut trim = 0 ;
242242 while true {
243- dac. dac_ccr. modify( |_, w| unsafe { w. $trim( ) . bits( trim) } ) ;
243+ dac. dac_ccr( ) . modify( |_, w| unsafe { w. $trim( ) . bits( trim) } ) ;
244244 delay. delay_us( 64_u32 ) ;
245- if dac. dac_sr. read( ) . $cal_flag( ) . bit( ) {
245+ if dac. dac_sr( ) . read( ) . $cal_flag( ) . bit( ) {
246246 break ;
247247 }
248248 trim += 1 ;
249249 }
250- dac. dac_cr. modify( |_, w| w. $cen( ) . clear_bit( ) ) ;
250+ dac. dac_cr( ) . modify( |_, w| w. $cen( ) . clear_bit( ) ) ;
251251
252252 $CX {
253253 _enabled: PhantomData ,
@@ -257,7 +257,7 @@ macro_rules! dac_helper {
257257 /// Disable the DAC channel
258258 pub fn disable( self ) -> $CX<MODE_BITS , Disabled > {
259259 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
260- dac. dac_cr. modify( |_, w| unsafe {
260+ dac. dac_cr( ) . modify( |_, w| unsafe {
261261 w. $en( ) . clear_bit( ) . $wave( ) . bits( 0 ) . $ten( ) . clear_bit( )
262262 } ) ;
263263
@@ -272,20 +272,20 @@ macro_rules! dac_helper {
272272 impl <const MODE_BITS : u8 , ED > DacOut <u16 > for $CX<MODE_BITS , ED > {
273273 fn set_value( & mut self , val: u16 ) {
274274 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
275- dac. $dhrx. write( |w| unsafe { w. bits( val as u32 ) } ) ;
275+ dac. $dhrx( ) . write( |w| unsafe { w. bits( val as u32 ) } ) ;
276276 }
277277
278278 fn get_value( & mut self ) -> u16 {
279279 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
280- dac. $dac_dor. read( ) . bits( ) as u16
280+ dac. $dac_dor( ) . read( ) . bits( ) as u16
281281 }
282282 }
283283
284284 /// Wave generator state implementation
285285 impl <const MODE_BITS : u8 > $CX<MODE_BITS , WaveGenerator > {
286286 pub fn trigger( & mut self ) {
287287 let dac = unsafe { & ( * <$DAC>:: ptr( ) ) } ;
288- dac. dac_swtrgr. write( |w| { w. $swtrig( ) . set_bit( ) } ) ;
288+ dac. dac_swtrgr( ) . write( |w| { w. $swtrig( ) . set_bit( ) } ) ;
289289 }
290290 }
291291 ) +
0 commit comments