@@ -369,22 +369,27 @@ where
369
369
TIM : Instance + WithPwm ,
370
370
PINS : Pins < TIM , P > ,
371
371
{
372
+ #[ inline]
372
373
pub fn enable ( & mut self , channel : Channel ) {
373
374
TIM :: enable_channel ( PINS :: check_used ( channel) as u8 , true )
374
375
}
375
376
377
+ #[ inline]
376
378
pub fn disable ( & mut self , channel : Channel ) {
377
379
TIM :: enable_channel ( PINS :: check_used ( channel) as u8 , false )
378
380
}
379
381
382
+ #[ inline]
380
383
pub fn set_polarity ( & mut self , channel : Channel , p : Polarity ) {
381
384
TIM :: set_channel_polarity ( PINS :: check_used ( channel) as u8 , p) ;
382
385
}
383
386
387
+ #[ inline]
384
388
pub fn get_duty ( & self , channel : Channel ) -> u16 {
385
389
TIM :: read_cc_value ( PINS :: check_used ( channel) as u8 ) as u16
386
390
}
387
391
392
+ #[ inline]
388
393
pub fn set_duty ( & mut self , channel : Channel , duty : u16 ) {
389
394
TIM :: set_cc_value ( PINS :: check_used ( channel) as u8 , duty as u32 )
390
395
}
@@ -412,6 +417,7 @@ where
412
417
self . tim . cnt_reset ( ) ;
413
418
}
414
419
420
+ #[ inline]
415
421
pub fn set_complementary_polarity ( & mut self , channel : Channel , p : Polarity ) {
416
422
TIM :: set_channel_polarity ( PINS :: check_complementary_used ( channel) as u8 , p) ;
417
423
}
@@ -550,30 +556,37 @@ where
550
556
TIM : Instance + WithPwm ,
551
557
PINS : Pins < TIM , P > ,
552
558
{
559
+ #[ inline]
553
560
pub fn enable ( & mut self , channel : Channel ) {
554
561
TIM :: enable_channel ( PINS :: check_used ( channel) as u8 , true )
555
562
}
556
563
564
+ #[ inline]
557
565
pub fn disable ( & mut self , channel : Channel ) {
558
566
TIM :: enable_channel ( PINS :: check_used ( channel) as u8 , false )
559
567
}
560
568
569
+ #[ inline]
561
570
pub fn set_polarity ( & mut self , channel : Channel , p : Polarity ) {
562
571
TIM :: set_channel_polarity ( PINS :: check_used ( channel) as u8 , p) ;
563
572
}
564
573
574
+ #[ inline]
565
575
pub fn get_duty ( & self , channel : Channel ) -> u16 {
566
576
TIM :: read_cc_value ( PINS :: check_used ( channel) as u8 ) as u16
567
577
}
568
578
579
+ #[ inline]
569
580
pub fn get_duty_time ( & self , channel : Channel ) -> TimerDurationU32 < FREQ > {
570
581
TimerDurationU32 :: from_ticks ( TIM :: read_cc_value ( PINS :: check_used ( channel) as u8 ) )
571
582
}
572
583
584
+ #[ inline]
573
585
pub fn set_duty ( & mut self , channel : Channel , duty : u16 ) {
574
586
TIM :: set_cc_value ( PINS :: check_used ( channel) as u8 , duty. into ( ) )
575
587
}
576
588
589
+ #[ inline]
577
590
pub fn set_duty_time ( & mut self , channel : Channel , duty : TimerDurationU32 < FREQ > ) {
578
591
TIM :: set_cc_value ( PINS :: check_used ( channel) as u8 , duty. ticks ( ) )
579
592
}
@@ -592,6 +605,7 @@ where
592
605
self . tim . cnt_reset ( ) ;
593
606
}
594
607
608
+ #[ inline]
595
609
pub fn set_complementary_polarity ( & mut self , channel : Channel , p : Polarity ) {
596
610
TIM :: set_channel_polarity ( PINS :: check_complementary_used ( channel) as u8 , p) ;
597
611
}
0 commit comments