29
29
//! adc::set_align(config::Align::Right);
30
30
//! ```
31
31
32
- use crate :: pac:: adc1:: { cfgr, smpr1:: SMP1_A , smpr2:: SMP10_A } ;
32
+ use crate :: pac:: adc1:: { cfgr, smpr1:: SMP1 , smpr2:: SMP10 } ;
33
33
use core:: convert:: TryFrom ;
34
34
35
35
/// The place in the sequence a given channel should be captured.
@@ -166,24 +166,24 @@ pub enum Resolution {
166
166
Six ,
167
167
}
168
168
169
- impl From < Resolution > for cfgr:: RES_A {
169
+ impl From < Resolution > for cfgr:: RES {
170
170
fn from ( r : Resolution ) -> Self {
171
171
match r {
172
- Resolution :: Twelve => cfgr:: RES_A :: Bits12 ,
173
- Resolution :: Ten => cfgr:: RES_A :: Bits10 ,
174
- Resolution :: Eight => cfgr:: RES_A :: Bits8 ,
175
- Resolution :: Six => cfgr:: RES_A :: Bits6 ,
172
+ Resolution :: Twelve => cfgr:: RES :: Bits12 ,
173
+ Resolution :: Ten => cfgr:: RES :: Bits10 ,
174
+ Resolution :: Eight => cfgr:: RES :: Bits8 ,
175
+ Resolution :: Six => cfgr:: RES :: Bits6 ,
176
176
}
177
177
}
178
178
}
179
179
180
- impl From < cfgr:: RES_A > for Resolution {
181
- fn from ( r : cfgr:: RES_A ) -> Self {
180
+ impl From < cfgr:: RES > for Resolution {
181
+ fn from ( r : cfgr:: RES ) -> Self {
182
182
match r {
183
- cfgr:: RES_A :: Bits12 => Resolution :: Twelve ,
184
- cfgr:: RES_A :: Bits10 => Resolution :: Ten ,
185
- cfgr:: RES_A :: Bits8 => Resolution :: Eight ,
186
- cfgr:: RES_A :: Bits6 => Resolution :: Six ,
183
+ cfgr:: RES :: Bits12 => Resolution :: Twelve ,
184
+ cfgr:: RES :: Bits10 => Resolution :: Ten ,
185
+ cfgr:: RES :: Bits8 => Resolution :: Eight ,
186
+ cfgr:: RES :: Bits6 => Resolution :: Six ,
187
187
}
188
188
}
189
189
}
@@ -239,28 +239,28 @@ pub enum ExternalTrigger {
239
239
Tim3Cc4 ( TriggerMode ) ,
240
240
}
241
241
242
- impl From < ExternalTrigger > for cfgr:: EXTSEL_A {
242
+ impl From < ExternalTrigger > for cfgr:: EXTSEL {
243
243
fn from ( et : ExternalTrigger ) -> Self {
244
244
match et {
245
- ExternalTrigger :: Tim1Cc1 ( _) => cfgr:: EXTSEL_A :: Tim1Cc1 ,
246
- ExternalTrigger :: Tim1Cc2 ( _) => cfgr:: EXTSEL_A :: Tim1Cc2 ,
247
- ExternalTrigger :: Tim1Cc3 ( _) => cfgr:: EXTSEL_A :: Tim1Cc3 ,
248
- ExternalTrigger :: Tim2Cc2 ( _) => cfgr:: EXTSEL_A :: Tim2Cc2 ,
249
- ExternalTrigger :: Tim3Trgo ( _) => cfgr:: EXTSEL_A :: Tim3Trgo ,
250
- ExternalTrigger :: Exti11 ( _) => cfgr:: EXTSEL_A :: Exti11 ,
251
- ExternalTrigger :: HrtimAdcTrg1 ( _) => cfgr:: EXTSEL_A :: HrtimAdctrg1 ,
252
- ExternalTrigger :: HrtimAdcTrg3 ( _) => cfgr:: EXTSEL_A :: HrtimAdctrg3 ,
253
- ExternalTrigger :: Tim1Trgo ( _) => cfgr:: EXTSEL_A :: Tim1Trgo ,
254
- ExternalTrigger :: Tim1Trgo2 ( _) => cfgr:: EXTSEL_A :: Tim1Trgo2 ,
255
- ExternalTrigger :: Tim2Trgo ( _) => cfgr:: EXTSEL_A :: Tim2Trgo ,
256
- ExternalTrigger :: Tim6Trgo ( _) => cfgr:: EXTSEL_A :: Tim6Trgo ,
257
- ExternalTrigger :: Tim15Trgo ( _) => cfgr:: EXTSEL_A :: Tim15Trgo ,
258
- ExternalTrigger :: Tim3Cc4 ( _) => cfgr:: EXTSEL_A :: Tim3Cc4 ,
245
+ ExternalTrigger :: Tim1Cc1 ( _) => cfgr:: EXTSEL :: Tim1Cc1 ,
246
+ ExternalTrigger :: Tim1Cc2 ( _) => cfgr:: EXTSEL :: Tim1Cc2 ,
247
+ ExternalTrigger :: Tim1Cc3 ( _) => cfgr:: EXTSEL :: Tim1Cc3 ,
248
+ ExternalTrigger :: Tim2Cc2 ( _) => cfgr:: EXTSEL :: Tim2Cc2 ,
249
+ ExternalTrigger :: Tim3Trgo ( _) => cfgr:: EXTSEL :: Tim3Trgo ,
250
+ ExternalTrigger :: Exti11 ( _) => cfgr:: EXTSEL :: Exti11 ,
251
+ ExternalTrigger :: HrtimAdcTrg1 ( _) => cfgr:: EXTSEL :: HrtimAdctrg1 ,
252
+ ExternalTrigger :: HrtimAdcTrg3 ( _) => cfgr:: EXTSEL :: HrtimAdctrg3 ,
253
+ ExternalTrigger :: Tim1Trgo ( _) => cfgr:: EXTSEL :: Tim1Trgo ,
254
+ ExternalTrigger :: Tim1Trgo2 ( _) => cfgr:: EXTSEL :: Tim1Trgo2 ,
255
+ ExternalTrigger :: Tim2Trgo ( _) => cfgr:: EXTSEL :: Tim2Trgo ,
256
+ ExternalTrigger :: Tim6Trgo ( _) => cfgr:: EXTSEL :: Tim6Trgo ,
257
+ ExternalTrigger :: Tim15Trgo ( _) => cfgr:: EXTSEL :: Tim15Trgo ,
258
+ ExternalTrigger :: Tim3Cc4 ( _) => cfgr:: EXTSEL :: Tim3Cc4 ,
259
259
}
260
260
}
261
261
}
262
262
263
- impl From < ExternalTrigger > for cfgr:: EXTEN_A {
263
+ impl From < ExternalTrigger > for cfgr:: EXTEN {
264
264
fn from ( et : ExternalTrigger ) -> Self {
265
265
match et {
266
266
ExternalTrigger :: Tim1Cc1 ( n)
@@ -301,12 +301,12 @@ pub enum TriggerMode {
301
301
BothEdges ,
302
302
}
303
303
304
- impl From < TriggerMode > for cfgr:: EXTEN_A {
304
+ impl From < TriggerMode > for cfgr:: EXTEN {
305
305
fn from ( tm : TriggerMode ) -> Self {
306
306
match tm {
307
- TriggerMode :: RisingEdge => cfgr:: EXTEN_A :: RisingEdge ,
308
- TriggerMode :: FallingEdge => cfgr:: EXTEN_A :: FallingEdge ,
309
- TriggerMode :: BothEdges => cfgr:: EXTEN_A :: BothEdges ,
307
+ TriggerMode :: RisingEdge => cfgr:: EXTEN :: RisingEdge ,
308
+ TriggerMode :: FallingEdge => cfgr:: EXTEN :: FallingEdge ,
309
+ TriggerMode :: BothEdges => cfgr:: EXTEN :: BothEdges ,
310
310
}
311
311
}
312
312
}
@@ -335,20 +335,20 @@ pub enum DataAlignment {
335
335
Left ,
336
336
}
337
337
338
- impl From < DataAlignment > for cfgr:: ALIGN_A {
338
+ impl From < DataAlignment > for cfgr:: ALIGN {
339
339
fn from ( a : DataAlignment ) -> Self {
340
340
match a {
341
- DataAlignment :: Right => cfgr:: ALIGN_A :: Right ,
342
- DataAlignment :: Left => cfgr:: ALIGN_A :: Left ,
341
+ DataAlignment :: Right => cfgr:: ALIGN :: Right ,
342
+ DataAlignment :: Left => cfgr:: ALIGN :: Left ,
343
343
}
344
344
}
345
345
}
346
346
347
- impl From < cfgr:: ALIGN_A > for DataAlignment {
348
- fn from ( a : cfgr:: ALIGN_A ) -> Self {
347
+ impl From < cfgr:: ALIGN > for DataAlignment {
348
+ fn from ( a : cfgr:: ALIGN ) -> Self {
349
349
match a {
350
- cfgr:: ALIGN_A :: Right => DataAlignment :: Right ,
351
- cfgr:: ALIGN_A :: Left => DataAlignment :: Left ,
350
+ cfgr:: ALIGN :: Right => DataAlignment :: Right ,
351
+ cfgr:: ALIGN :: Left => DataAlignment :: Left ,
352
352
}
353
353
}
354
354
}
@@ -435,20 +435,20 @@ pub enum OverrunMode {
435
435
Overwrite ,
436
436
}
437
437
438
- impl From < cfgr:: OVRMOD_A > for OverrunMode {
439
- fn from ( a : cfgr:: OVRMOD_A ) -> Self {
438
+ impl From < cfgr:: OVRMOD > for OverrunMode {
439
+ fn from ( a : cfgr:: OVRMOD ) -> Self {
440
440
match a {
441
- cfgr:: OVRMOD_A :: Preserve => OverrunMode :: Preserve ,
442
- cfgr:: OVRMOD_A :: Overwrite => OverrunMode :: Overwrite ,
441
+ cfgr:: OVRMOD :: Preserve => OverrunMode :: Preserve ,
442
+ cfgr:: OVRMOD :: Overwrite => OverrunMode :: Overwrite ,
443
443
}
444
444
}
445
445
}
446
446
447
- impl From < OverrunMode > for cfgr:: OVRMOD_A {
447
+ impl From < OverrunMode > for cfgr:: OVRMOD {
448
448
fn from ( a : OverrunMode ) -> Self {
449
449
match a {
450
- OverrunMode :: Preserve => cfgr:: OVRMOD_A :: Preserve ,
451
- OverrunMode :: Overwrite => cfgr:: OVRMOD_A :: Overwrite ,
450
+ OverrunMode :: Preserve => cfgr:: OVRMOD :: Preserve ,
451
+ OverrunMode :: Overwrite => cfgr:: OVRMOD :: Overwrite ,
452
452
}
453
453
}
454
454
}
@@ -542,62 +542,62 @@ impl From<SampleTime> for f32 {
542
542
}
543
543
}
544
544
545
- impl From < SampleTime > for SMP1_A {
545
+ impl From < SampleTime > for SMP1 {
546
546
fn from ( t : SampleTime ) -> Self {
547
547
match t {
548
- SampleTime :: Cycles1C5 => Self :: Cycles15 ,
549
- SampleTime :: Cycles2C5 => Self :: Cycles25 ,
550
- SampleTime :: Cycles4C5 => Self :: Cycles45 ,
551
- SampleTime :: Cycles7C5 => Self :: Cycles75 ,
552
- SampleTime :: Cycles19C5 => Self :: Cycles195 ,
553
- SampleTime :: Cycles61C5 => Self :: Cycles615 ,
554
- SampleTime :: Cycles181C5 => Self :: Cycles1815 ,
555
- SampleTime :: Cycles601C5 => Self :: Cycles6015 ,
548
+ SampleTime :: Cycles1C5 => Self :: Cycles1_5 ,
549
+ SampleTime :: Cycles2C5 => Self :: Cycles2_5 ,
550
+ SampleTime :: Cycles4C5 => Self :: Cycles4_5 ,
551
+ SampleTime :: Cycles7C5 => Self :: Cycles7_5 ,
552
+ SampleTime :: Cycles19C5 => Self :: Cycles19_5 ,
553
+ SampleTime :: Cycles61C5 => Self :: Cycles61_5 ,
554
+ SampleTime :: Cycles181C5 => Self :: Cycles181_5 ,
555
+ SampleTime :: Cycles601C5 => Self :: Cycles601_5 ,
556
556
}
557
557
}
558
558
}
559
559
560
- impl From < SampleTime > for SMP10_A {
560
+ impl From < SampleTime > for SMP10 {
561
561
fn from ( t : SampleTime ) -> Self {
562
562
match t {
563
- SampleTime :: Cycles1C5 => Self :: Cycles15 ,
564
- SampleTime :: Cycles2C5 => Self :: Cycles25 ,
565
- SampleTime :: Cycles4C5 => Self :: Cycles45 ,
566
- SampleTime :: Cycles7C5 => Self :: Cycles75 ,
567
- SampleTime :: Cycles19C5 => Self :: Cycles195 ,
568
- SampleTime :: Cycles61C5 => Self :: Cycles615 ,
569
- SampleTime :: Cycles181C5 => Self :: Cycles1815 ,
570
- SampleTime :: Cycles601C5 => Self :: Cycles6015 ,
563
+ SampleTime :: Cycles1C5 => Self :: Cycles1_5 ,
564
+ SampleTime :: Cycles2C5 => Self :: Cycles2_5 ,
565
+ SampleTime :: Cycles4C5 => Self :: Cycles4_5 ,
566
+ SampleTime :: Cycles7C5 => Self :: Cycles7_5 ,
567
+ SampleTime :: Cycles19C5 => Self :: Cycles19_5 ,
568
+ SampleTime :: Cycles61C5 => Self :: Cycles61_5 ,
569
+ SampleTime :: Cycles181C5 => Self :: Cycles181_5 ,
570
+ SampleTime :: Cycles601C5 => Self :: Cycles601_5 ,
571
571
}
572
572
}
573
573
}
574
574
575
- impl From < SMP1_A > for SampleTime {
576
- fn from ( t : SMP1_A ) -> Self {
575
+ impl From < SMP1 > for SampleTime {
576
+ fn from ( t : SMP1 ) -> Self {
577
577
match t {
578
- SMP1_A :: Cycles15 => Self :: Cycles1C5 ,
579
- SMP1_A :: Cycles25 => Self :: Cycles2C5 ,
580
- SMP1_A :: Cycles45 => Self :: Cycles4C5 ,
581
- SMP1_A :: Cycles75 => Self :: Cycles7C5 ,
582
- SMP1_A :: Cycles195 => Self :: Cycles19C5 ,
583
- SMP1_A :: Cycles615 => Self :: Cycles61C5 ,
584
- SMP1_A :: Cycles1815 => Self :: Cycles181C5 ,
585
- SMP1_A :: Cycles6015 => Self :: Cycles601C5 ,
578
+ SMP1 :: Cycles1_5 => Self :: Cycles1C5 ,
579
+ SMP1 :: Cycles2_5 => Self :: Cycles2C5 ,
580
+ SMP1 :: Cycles4_5 => Self :: Cycles4C5 ,
581
+ SMP1 :: Cycles7_5 => Self :: Cycles7C5 ,
582
+ SMP1 :: Cycles19_5 => Self :: Cycles19C5 ,
583
+ SMP1 :: Cycles61_5 => Self :: Cycles61C5 ,
584
+ SMP1 :: Cycles181_5 => Self :: Cycles181C5 ,
585
+ SMP1 :: Cycles601_5 => Self :: Cycles601C5 ,
586
586
}
587
587
}
588
588
}
589
589
590
- impl From < SMP10_A > for SampleTime {
591
- fn from ( t : SMP10_A ) -> Self {
590
+ impl From < SMP10 > for SampleTime {
591
+ fn from ( t : SMP10 ) -> Self {
592
592
match t {
593
- SMP10_A :: Cycles15 => Self :: Cycles1C5 ,
594
- SMP10_A :: Cycles25 => Self :: Cycles2C5 ,
595
- SMP10_A :: Cycles45 => Self :: Cycles4C5 ,
596
- SMP10_A :: Cycles75 => Self :: Cycles7C5 ,
597
- SMP10_A :: Cycles195 => Self :: Cycles19C5 ,
598
- SMP10_A :: Cycles615 => Self :: Cycles61C5 ,
599
- SMP10_A :: Cycles1815 => Self :: Cycles181C5 ,
600
- SMP10_A :: Cycles6015 => Self :: Cycles601C5 ,
593
+ SMP10 :: Cycles1_5 => Self :: Cycles1C5 ,
594
+ SMP10 :: Cycles2_5 => Self :: Cycles2C5 ,
595
+ SMP10 :: Cycles4_5 => Self :: Cycles4C5 ,
596
+ SMP10 :: Cycles7_5 => Self :: Cycles7C5 ,
597
+ SMP10 :: Cycles19_5 => Self :: Cycles19C5 ,
598
+ SMP10 :: Cycles61_5 => Self :: Cycles61C5 ,
599
+ SMP10 :: Cycles181_5 => Self :: Cycles181C5 ,
600
+ SMP10 :: Cycles601_5 => Self :: Cycles601C5 ,
601
601
}
602
602
}
603
603
}
@@ -776,7 +776,7 @@ pub enum ConversionMode {
776
776
// Scan,
777
777
}
778
778
779
- impl From < ConversionMode > for cfgr:: CONT_A {
779
+ impl From < ConversionMode > for cfgr:: CONT {
780
780
fn from ( mode : ConversionMode ) -> Self {
781
781
match mode {
782
782
ConversionMode :: Single | ConversionMode :: Discontinuous ( _) => Self :: Single ,
@@ -785,7 +785,7 @@ impl From<ConversionMode> for cfgr::CONT_A {
785
785
}
786
786
}
787
787
788
- impl From < ConversionMode > for cfgr:: DISCEN_A {
788
+ impl From < ConversionMode > for cfgr:: DISCEN {
789
789
fn from ( mode : ConversionMode ) -> Self {
790
790
match mode {
791
791
ConversionMode :: Single | ConversionMode :: Continuous => Self :: Disabled ,
@@ -794,11 +794,11 @@ impl From<ConversionMode> for cfgr::DISCEN_A {
794
794
}
795
795
}
796
796
797
- impl From < cfgr:: CONT_A > for ConversionMode {
798
- fn from ( mode : cfgr:: CONT_A ) -> Self {
797
+ impl From < cfgr:: CONT > for ConversionMode {
798
+ fn from ( mode : cfgr:: CONT ) -> Self {
799
799
match mode {
800
- cfgr:: CONT_A :: Single => ConversionMode :: Single ,
801
- cfgr:: CONT_A :: Continuous => ConversionMode :: Continuous ,
800
+ cfgr:: CONT :: Single => ConversionMode :: Single ,
801
+ cfgr:: CONT :: Continuous => ConversionMode :: Continuous ,
802
802
}
803
803
}
804
804
}
0 commit comments