Skip to content

Commit 22acfbf

Browse files
authored
Merge pull request #2461 from svastm/serial_asynch_f3
[STM32F3] Add asynchronous serial
2 parents 21d55cd + c660821 commit 22acfbf

File tree

10 files changed

+658
-179
lines changed

10 files changed

+658
-179
lines changed

hal/targets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@
714714
"inherits": ["Target"],
715715
"progen": {"target": "nucleo-f302r8"},
716716
"detect_code": ["0705"],
717-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
717+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
718718
"release_versions": ["2"]
719719
},
720720
"NUCLEO_F303K8": {
@@ -738,7 +738,7 @@
738738
"inherits": ["Target"],
739739
"progen": {"target": "nucleo-f303re"},
740740
"detect_code": ["0745"],
741-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
741+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
742742
"release_versions": ["2", "5"]
743743
},
744744
"NUCLEO_F334R8": {
@@ -750,7 +750,7 @@
750750
"inherits": ["Target"],
751751
"progen": {"target": "nucleo-f334r8"},
752752
"detect_code": ["0735"],
753-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
753+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
754754
"release_versions": ["2"]
755755
},
756756
"NUCLEO_F401RE": {
@@ -1024,7 +1024,7 @@
10241024
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
10251025
"progen": {"target": "disco-f334c8"},
10261026
"detect_code": ["0810"],
1027-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1027+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
10281028
"release_versions": ["2"]
10291029
},
10301030
"DISCO_F407VG": {

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ struct dac_s {
6666
uint32_t channel;
6767
};
6868

69-
struct serial_s {
70-
UARTName uart;
71-
int index; // Used by irq
72-
uint32_t baudrate;
73-
uint32_t databits;
74-
uint32_t stopbits;
75-
uint32_t parity;
76-
PinName pin_tx;
77-
PinName pin_rx;
78-
};
79-
8069
struct spi_s {
8170
SPIName spi;
8271
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F334C8/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ struct dac_s {
6666
uint32_t channel;
6767
};
6868

69-
struct serial_s {
70-
UARTName uart;
71-
int index; // Used by irq
72-
uint32_t baudrate;
73-
uint32_t databits;
74-
uint32_t stopbits;
75-
uint32_t parity;
76-
PinName pin_tx;
77-
PinName pin_rx;
78-
};
79-
8069
struct spi_s {
8170
SPIName spi;
8271
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ struct dac_s {
6666
uint32_t channel;
6767
};
6868

69-
struct serial_s {
70-
UARTName uart;
71-
int index; // Used by irq
72-
uint32_t baudrate;
73-
uint32_t databits;
74-
uint32_t stopbits;
75-
uint32_t parity;
76-
PinName pin_tx;
77-
PinName pin_rx;
78-
};
79-
8069
struct spi_s {
8170
SPIName spi;
8271
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ struct dac_s {
6666
uint32_t channel;
6767
};
6868

69-
struct serial_s {
70-
UARTName uart;
71-
int index; // Used by irq
72-
uint32_t baudrate;
73-
uint32_t databits;
74-
uint32_t stopbits;
75-
uint32_t parity;
76-
PinName pin_tx;
77-
PinName pin_rx;
78-
};
79-
8069
struct spi_s {
8170
SPIName spi;
8271
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ struct dac_s {
6666
uint32_t channel;
6767
};
6868

69-
struct serial_s {
70-
UARTName uart;
71-
int index; // Used by irq
72-
uint32_t baudrate;
73-
uint32_t databits;
74-
uint32_t stopbits;
75-
uint32_t parity;
76-
PinName pin_tx;
77-
PinName pin_rx;
78-
};
79-
8069
struct spi_s {
8170
SPIName spi;
8271
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,6 @@ struct dac_s {
6666
uint32_t channel;
6767
};
6868

69-
struct serial_s {
70-
UARTName uart;
71-
int index; // Used by irq
72-
uint32_t baudrate;
73-
uint32_t databits;
74-
uint32_t stopbits;
75-
uint32_t parity;
76-
PinName pin_tx;
77-
PinName pin_rx;
78-
};
79-
8069
struct spi_s {
8170
SPIName spi;
8271
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32F3/common_objects.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ struct pwmout_s {
4949
uint8_t inverted;
5050
};
5151

52+
struct serial_s {
53+
UARTName uart;
54+
int index; // Used by irq
55+
uint32_t baudrate;
56+
uint32_t databits;
57+
uint32_t stopbits;
58+
uint32_t parity;
59+
PinName pin_tx;
60+
PinName pin_rx;
61+
#if DEVICE_SERIAL_ASYNCH
62+
uint32_t events;
63+
#endif
64+
#if DEVICE_SERIAL_FC
65+
uint32_t hw_flow_ctl;
66+
PinName pin_rts;
67+
PinName pin_cts;
68+
#endif
69+
};
70+
5271
#include "gpio_object.h"
5372

5473
#ifdef __cplusplus

0 commit comments

Comments
 (0)