@@ -638,17 +638,27 @@ macro_rules! usart {
638638 }
639639}
640640
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+ ) ) ]
642648usart ! {
643- LPUART1 : ( lpuart1, apb1enr, lpuart1en, apb1_clk, Serial1Ext ) ,
649+ LPUART1 : ( lpuart1, apb1enr, lpuart1en, apb1_clk, Serial1LpExt ) ,
644650 USART2 : ( usart2, apb1enr, usart2en, apb1_clk, Serial2Ext ) ,
645651}
646652
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" ) ) ]
648655usart ! {
649- LPUART1 : ( lpuart1, apb1enr, lpuart1en, apb1_clk, Serial1LpExt ) ,
650656 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 ! {
652662 USART4 : ( usart4, apb1enr, usart4en, apb1_clk, Serial4Ext ) ,
653663 USART5 : ( usart5, apb1enr, usart5en, apb1_clk, Serial5Ext ) ,
654664}
0 commit comments