@@ -35,13 +35,29 @@ use crate::{
35
35
I2C1 ,
36
36
I2C2 ,
37
37
I2C3 ,
38
- USART1 ,
39
- USART2 ,
40
38
} ,
41
39
rcc:: Rcc ,
42
- serial,
43
40
} ;
44
41
42
+ #[ cfg( any( feature = "io-STM32L051" , feature = "io-STM32L071" ) ) ]
43
+ use crate :: pac:: USART1 ;
44
+
45
+ #[ cfg( any(
46
+ feature = "io-STM32L021" ,
47
+ feature = "io-STM32L031" ,
48
+ feature = "io-STM32L051" ,
49
+ feature = "io-STM32L071" ,
50
+ ) ) ]
51
+ use crate :: pac:: USART2 ;
52
+
53
+ #[ cfg( any(
54
+ feature = "io-STM32L021" ,
55
+ feature = "io-STM32L031" ,
56
+ feature = "io-STM32L051" ,
57
+ feature = "io-STM32L071" ,
58
+ ) ) ]
59
+ use crate :: serial;
60
+
45
61
#[ cfg( feature = "stm32l082" ) ]
46
62
use crate :: aes;
47
63
@@ -521,13 +537,24 @@ impl_target!(
521
537
// ADC
522
538
adc:: DmaToken , Channel1 , 0 ;
523
539
adc:: DmaToken , Channel2 , 0 ;
540
+ ) ;
524
541
542
+ #[ cfg( any( feature = "io-STM32L051" , feature = "io-STM32L071" ) ) ]
543
+ impl_target ! (
525
544
// USART1
526
545
serial:: Tx <USART1 >, Channel2 , 3 ;
527
546
serial:: Tx <USART1 >, Channel4 , 3 ;
528
547
serial:: Rx <USART1 >, Channel3 , 3 ;
529
548
serial:: Rx <USART1 >, Channel5 , 3 ;
549
+ ) ;
530
550
551
+ #[ cfg( any(
552
+ feature = "io-STM32L021" ,
553
+ feature = "io-STM32L031" ,
554
+ feature = "io-STM32L051" ,
555
+ feature = "io-STM32L071" ,
556
+ ) ) ]
557
+ impl_target ! (
531
558
// USART2
532
559
serial:: Tx <USART2 >, Channel4 , 4 ;
533
560
serial:: Tx <USART2 >, Channel7 , 4 ;
0 commit comments