@@ -638,17 +638,27 @@ macro_rules! usart {
638
638
}
639
639
}
640
640
641
- #[ cfg( feature = "stm32l0x1" ) ]
641
+ // LPUART1 and USART2 are available on category 1/2/3/5 MCUs
642
+ #[ cfg( any(
643
+ feature = "io-STM32L021" ,
644
+ feature = "io-STM32L031" ,
645
+ feature = "io-STM32L051" ,
646
+ feature = "io-STM32L071" ,
647
+ ) ) ]
642
648
usart ! {
643
- LPUART1 : ( lpuart1, apb1enr, lpuart1en, apb1_clk, Serial1Ext ) ,
649
+ LPUART1 : ( lpuart1, apb1enr, lpuart1en, apb1_clk, Serial1LpExt ) ,
644
650
USART2 : ( usart2, apb1enr, usart2en, apb1_clk, Serial2Ext ) ,
645
651
}
646
652
647
- #[ cfg( any( feature = "stm32l0x2" , feature = "stm32l0x3" ) ) ]
653
+ // USART1 is available on category 3/5 MCUs
654
+ #[ cfg( any( feature = "io-STM32L051" , feature = "io-STM32L071" ) ) ]
648
655
usart ! {
649
- LPUART1 : ( lpuart1, apb1enr, lpuart1en, apb1_clk, Serial1LpExt ) ,
650
656
USART1 : ( usart1, apb2enr, usart1en, apb1_clk, Serial1Ext ) ,
651
- USART2 : ( usart2, apb1enr, usart2en, apb1_clk, Serial2Ext ) ,
657
+ }
658
+
659
+ // USART4 and USART5 are available on category 5 MCUs
660
+ #[ cfg( feature = "io-STM32L071" ) ]
661
+ usart ! {
652
662
USART4 : ( usart4, apb1enr, usart4en, apb1_clk, Serial4Ext ) ,
653
663
USART5 : ( usart5, apb1enr, usart5en, apb1_clk, Serial5Ext ) ,
654
664
}
0 commit comments