Skip to content

Commit 21d55cd

Browse files
authored
Merge pull request #2465 from svastm/serial_asynch_l4
[STM32L4] Add asynchronous serial
2 parents ccfe2c8 + e7b1b76 commit 21d55cd

File tree

7 files changed

+648
-224
lines changed

7 files changed

+648
-224
lines changed

hal/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@
964964
"inherits": ["Target"],
965965
"progen": {"target": "nucleo-l476rg"},
966966
"detect_code": ["0765"],
967-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
967+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
968968
"release_versions": ["2", "5"]
969969
},
970970
"STM32F3XX": {

hal/targets/hal/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/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_STM32L4/TARGET_NUCLEO_L432KC/objects.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +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-
#if DEVICE_SERIAL_FC
79-
uint32_t hw_flow_ctl;
80-
PinName pin_rts;
81-
PinName pin_cts;
82-
#endif
83-
};
84-
8569
struct spi_s {
8670
SPIName spi;
8771
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/objects.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +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-
#if DEVICE_SERIAL_FC
79-
uint32_t hw_flow_ctl;
80-
PinName pin_rts;
81-
PinName pin_cts;
82-
#endif
83-
};
84-
8569
struct spi_s {
8670
SPIName spi;
8771
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32L4/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)