@@ -35,13 +35,29 @@ use crate::{
3535 I2C1 ,
3636 I2C2 ,
3737 I2C3 ,
38- USART1 ,
39- USART2 ,
4038 } ,
4139 rcc:: Rcc ,
42- serial,
4340} ;
4441
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+
4561#[ cfg( feature = "stm32l082" ) ]
4662use crate :: aes;
4763
@@ -521,13 +537,24 @@ impl_target!(
521537 // ADC
522538 adc:: DmaToken , Channel1 , 0 ;
523539 adc:: DmaToken , Channel2 , 0 ;
540+ ) ;
524541
542+ #[ cfg( any( feature = "io-STM32L051" , feature = "io-STM32L071" ) ) ]
543+ impl_target ! (
525544 // USART1
526545 serial:: Tx <USART1 >, Channel2 , 3 ;
527546 serial:: Tx <USART1 >, Channel4 , 3 ;
528547 serial:: Rx <USART1 >, Channel3 , 3 ;
529548 serial:: Rx <USART1 >, Channel5 , 3 ;
549+ ) ;
530550
551+ #[ cfg( any(
552+ feature = "io-STM32L021" ,
553+ feature = "io-STM32L031" ,
554+ feature = "io-STM32L051" ,
555+ feature = "io-STM32L071" ,
556+ ) ) ]
557+ impl_target ! (
531558 // USART2
532559 serial:: Tx <USART2 >, Channel4 , 4 ;
533560 serial:: Tx <USART2 >, Channel7 , 4 ;
0 commit comments