Skip to content

Commit 6d628f6

Browse files
authored
Merge pull request #2751 from bcostm/serialFC_L0
STM32L0xx - Add Serial Flow Control
2 parents 2eb0b2c + 15f7a87 commit 6d628f6

File tree

7 files changed

+101
-9
lines changed

7 files changed

+101
-9
lines changed

hal/targets.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@
919919
"supported_form_factors": ["ARDUINO"],
920920
"detect_code": ["0780"],
921921
"progen": {"target":"nucleo-l011k4"},
922-
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
922+
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
923923
"default_lib": "small",
924924
"release_versions": ["2"]
925925
},
@@ -933,7 +933,7 @@
933933
"supported_form_factors": ["ARDUINO"],
934934
"detect_code": ["0790"],
935935
"progen": {"target": "nucleo-l031k6"},
936-
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
936+
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
937937
"default_lib": "small",
938938
"release_versions": ["2"]
939939
},
@@ -946,7 +946,7 @@
946946
"inherits": ["Target"],
947947
"progen": {"target": "nucleo-l053r8"},
948948
"detect_code": ["0715"],
949-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
949+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
950950
"default_lib": "small",
951951
"release_versions": ["2"]
952952
},
@@ -959,7 +959,7 @@
959959
"inherits": ["Target"],
960960
"progen": {"target": "nucleo-l073rz"},
961961
"detect_code": ["0760"],
962-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
962+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
963963
"release_versions": ["2", "5"]
964964
},
965965
"NUCLEO_L152RE": {
@@ -1101,7 +1101,7 @@
11011101
"extra_labels": ["STM", "STM32L0", "STM32L053C8"],
11021102
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
11031103
"progen": {"target": "disco-l053c8"},
1104-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1104+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
11051105
"default_lib": "small",
11061106
"release_versions": ["2"]
11071107
},

hal/targets/hal/TARGET_STM/TARGET_STM32L0/PeripheralPins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ extern const PinMap PinMap_PWM[];
5555

5656
extern const PinMap PinMap_UART_TX[];
5757
extern const PinMap PinMap_UART_RX[];
58+
extern const PinMap PinMap_UART_RTS[];
59+
extern const PinMap PinMap_UART_CTS[];
5860

5961
//*** SPI ***
6062

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/PeripheralPins.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
*******************************************************************************
3-
* Copyright (c) 2015, STMicroelectronics
3+
* Copyright (c) 2016, STMicroelectronics
44
* All rights reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without
@@ -121,6 +121,23 @@ const PinMap PinMap_UART_RX[] = {
121121
{NC, NC, 0}
122122
};
123123

124+
const PinMap PinMap_UART_RTS[] = {
125+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
126+
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
127+
{PB_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)},
128+
{PB_14, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
129+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
130+
{NC, NC, 0}
131+
};
132+
133+
const PinMap PinMap_UART_CTS[] = {
134+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
135+
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
136+
{PB_13, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
137+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
138+
{NC, NC, 0}
139+
};
140+
124141
//*** SPI ***
125142

126143
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/PeripheralPins.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,22 @@ const PinMap PinMap_UART_RX[] = {
130130
{NC, NC, 0}
131131
};
132132

133+
const PinMap PinMap_UART_RTS[] = {
134+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
135+
{PB_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
136+
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
137+
{PA_12, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
138+
{NC, NC, 0}
139+
};
140+
141+
const PinMap PinMap_UART_CTS[] = {
142+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
143+
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
144+
{PA_7, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
145+
{PA_11, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
146+
{NC, NC, 0}
147+
};
148+
133149
//*** SPI ***
134150

135151
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/PeripheralPins.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
*******************************************************************************
3-
* Copyright (c) 2015, STMicroelectronics
3+
* Copyright (c) 2016, STMicroelectronics
44
* All rights reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without
@@ -121,6 +121,22 @@ const PinMap PinMap_UART_RX[] = {
121121
{NC, NC, 0}
122122
};
123123

124+
const PinMap PinMap_UART_RTS[] = {
125+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
126+
{PB_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
127+
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
128+
{PA_12, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
129+
{NC, NC, 0}
130+
};
131+
132+
const PinMap PinMap_UART_CTS[] = {
133+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
134+
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
135+
{PA_7, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
136+
{PA_11, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
137+
{NC, NC, 0}
138+
};
139+
124140
//*** SPI ***
125141

126142
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/PeripheralPins.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
*******************************************************************************
3-
* Copyright (c) 2015, STMicroelectronics
3+
* Copyright (c) 2016, STMicroelectronics
44
* All rights reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without
@@ -133,6 +133,24 @@ const PinMap PinMap_UART_RX[] = {
133133
{NC, NC, 0}
134134
};
135135

136+
const PinMap PinMap_UART_RTS[] = {
137+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
138+
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
139+
{PB_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)},
140+
{PB_14, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
141+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
142+
{PD_2, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_LPUART1)},
143+
{NC, NC, 0}
144+
};
145+
146+
const PinMap PinMap_UART_CTS[] = {
147+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
148+
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
149+
{PB_13, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
150+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
151+
{NC, NC, 0}
152+
};
153+
136154
//*** SPI ***
137155

138156
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PeripheralPins.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mbed Microcontroller Library
22
*******************************************************************************
3-
* Copyright (c) 2015, STMicroelectronics
3+
* Copyright (c) 2016, STMicroelectronics
44
* All rights reserved.
55
*
66
* Redistribution and use in source and binary forms, with or without
@@ -167,6 +167,29 @@ const PinMap PinMap_UART_RX[] = {
167167
{NC, NC, 0}
168168
};
169169

170+
const PinMap PinMap_UART_RTS[] = {
171+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
172+
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
173+
{PB_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)},
174+
{PB_14, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
175+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
176+
{PA_15, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)},
177+
{PD_2, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_LPUART1)},
178+
{PB_3, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USART1)},
179+
{PB_5, UART_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)},
180+
{NC, NC, 0}
181+
};
182+
183+
const PinMap PinMap_UART_CTS[] = {
184+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
185+
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
186+
{PB_13, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
187+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
188+
{PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USART1)},
189+
{PB_7, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)},
190+
{NC, NC, 0}
191+
};
192+
170193
//*** SPI ***
171194

172195
const PinMap PinMap_SPI_MOSI[] = {

0 commit comments

Comments
 (0)