Skip to content

Commit 5b5da03

Browse files
authored
Merge pull request #2616 from bcostm/serialfc_F3
STM32F3xx - Add Serial Flow Control pins + enable it
2 parents ca0b47a + 2c97fea commit 5b5da03

File tree

8 files changed

+107
-13
lines changed

8 files changed

+107
-13
lines changed

hal/targets.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@
717717
"inherits": ["Target"],
718718
"progen": {"target": "nucleo-f302r8"},
719719
"detect_code": ["0705"],
720-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
720+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
721721
"default_lib": "small",
722722
"release_versions": ["2"]
723723
},
@@ -732,7 +732,7 @@
732732
"progen": {"target": "nucleo-f303k8"},
733733
"detect_code": ["0775"],
734734
"default_lib": "small",
735-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
735+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
736736
"release_versions": ["2"]
737737
},
738738
"NUCLEO_F303RE": {
@@ -744,7 +744,7 @@
744744
"inherits": ["Target"],
745745
"progen": {"target": "nucleo-f303re"},
746746
"detect_code": ["0745"],
747-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
747+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
748748
"release_versions": ["2", "5"]
749749
},
750750
"NUCLEO_F303ZE": {
@@ -769,7 +769,7 @@
769769
"inherits": ["Target"],
770770
"progen": {"target": "nucleo-f334r8"},
771771
"detect_code": ["0735"],
772-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
772+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
773773
"default_lib": "small",
774774
"release_versions": ["2"]
775775
},
@@ -1040,7 +1040,7 @@
10401040
"extra_labels": ["STM", "STM32F3", "STM32F303", "STM32F303VC"],
10411041
"macros": ["DEVICE_RTC_LSI=1"],
10421042
"supported_toolchains": ["GCC_ARM"],
1043-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"]
1043+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"]
10441044
},
10451045
"DISCO_F334C8": {
10461046
"inherits": ["Target"],
@@ -1051,9 +1051,9 @@
10511051
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
10521052
"progen": {"target": "disco-f334c8"},
10531053
"detect_code": ["0810"],
1054-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1054+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
10551055
"default_lib": "small",
1056-
"release_versions": ["2"]
1056+
"release_versions": ["2"]
10571057
},
10581058
"DISCO_F407VG": {
10591059
"inherits": ["Target"],

hal/targets/hal/TARGET_STM/TARGET_STM32F3/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_STM32F3/TARGET_DISCO_F303VC/PeripheralPins.c

Lines changed: 21 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
@@ -228,6 +228,26 @@ const PinMap PinMap_UART_RX[] = {
228228
{NC, NC, 0}
229229
};
230230

231+
const PinMap PinMap_UART_RTS[] = {
232+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
233+
{PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
234+
{PD_12, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
235+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
236+
{PF_6, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
237+
{PD_4, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
238+
{NC, NC, 0}
239+
};
240+
241+
const PinMap PinMap_UART_CTS[] = {
242+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
243+
{PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
244+
{PD_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
245+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
246+
{PA_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
247+
{PD_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
248+
{NC, NC, 0}
249+
};
250+
231251
//*** SPI ***
232252

233253
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F334C8/PeripheralPins.c

Lines changed: 15 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,20 @@ 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_AF7_USART2)},
172+
{PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
173+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
174+
{NC, NC, 0}
175+
};
176+
177+
const PinMap PinMap_UART_CTS[] = {
178+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
179+
{PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
180+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
181+
{PA_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
182+
{NC, NC, 0}
183+
};
170184

171185
//*** SPI ***
172186

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/PeripheralPins.c

Lines changed: 16 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
@@ -171,6 +171,21 @@ const PinMap PinMap_UART_RX[] = {
171171
{NC, NC, 0}
172172
};
173173

174+
const PinMap PinMap_UART_RTS[] = {
175+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
176+
{PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
177+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
178+
{NC, NC, 0}
179+
};
180+
181+
const PinMap PinMap_UART_CTS[] = {
182+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
183+
{PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
184+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
185+
{PA_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
186+
{NC, NC, 0}
187+
};
188+
174189
//*** SPI ***
175190

176191
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/PeripheralPins.c

Lines changed: 14 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
@@ -144,6 +144,19 @@ const PinMap PinMap_UART_RX[] = {
144144
{NC, NC, 0}
145145
};
146146

147+
const PinMap PinMap_UART_RTS[] = {
148+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
149+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
150+
{NC, NC, 0}
151+
};
152+
153+
const PinMap PinMap_UART_CTS[] = {
154+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
155+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
156+
{PA_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
157+
{NC, NC, 0}
158+
};
159+
147160
//*** SPI ***
148161

149162
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/PeripheralPins.c

Lines changed: 16 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
@@ -214,6 +214,21 @@ const PinMap PinMap_UART_RX[] = {
214214
{NC, NC, 0}
215215
};
216216

217+
const PinMap PinMap_UART_RTS[] = {
218+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
219+
{PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
220+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
221+
{NC, NC, 0}
222+
};
223+
224+
const PinMap PinMap_UART_CTS[] = {
225+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
226+
{PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
227+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
228+
{PA_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
229+
{NC, NC, 0}
230+
};
231+
217232
//*** SPI ***
218233

219234
const PinMap PinMap_SPI_MOSI[] = {

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/PeripheralPins.c

Lines changed: 16 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
@@ -185,6 +185,21 @@ const PinMap PinMap_UART_RX[] = {
185185
{NC, NC, 0}
186186
};
187187

188+
const PinMap PinMap_UART_RTS[] = {
189+
{PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
190+
{PB_14, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
191+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
192+
{NC, NC, 0}
193+
};
194+
195+
const PinMap PinMap_UART_CTS[] = {
196+
{PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
197+
{PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
198+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
199+
{PA_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
200+
{NC, NC, 0}
201+
};
202+
188203
//*** SPI ***
189204

190205
const PinMap PinMap_SPI_MOSI[] = {

0 commit comments

Comments
 (0)