Skip to content

Commit c4a02b0

Browse files
authored
Merge pull request #2463 from svastm/serial_asynch_l0
[STM32L0] Add asynchronous serial
2 parents 3194cc2 + b5c3647 commit c4a02b0

File tree

9 files changed

+642
-169
lines changed

9 files changed

+642
-169
lines changed

hal/targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@
940940
"inherits": ["Target"],
941941
"progen": {"target": "nucleo-l053r8"},
942942
"detect_code": ["0715"],
943-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
943+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
944944
"default_lib": "small",
945945
"release_versions": ["2"]
946946
},
@@ -953,7 +953,7 @@
953953
"inherits": ["Target"],
954954
"progen": {"target": "nucleo-l073rz"},
955955
"detect_code": ["0760"],
956-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
956+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
957957
"release_versions": ["2", "5"]
958958
},
959959
"NUCLEO_L152RE": {

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/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_STM32L0/TARGET_NUCLEO_L011K4/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ struct analogin_s {
6060
uint32_t channel;
6161
};
6262

63-
struct serial_s {
64-
UARTName uart;
65-
int index; // Used by irq
66-
uint32_t baudrate;
67-
uint32_t databits;
68-
uint32_t stopbits;
69-
uint32_t parity;
70-
PinName pin_tx;
71-
PinName pin_rx;
72-
};
73-
7463
struct spi_s {
7564
SPIName spi;
7665
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ struct analogin_s {
6060
uint32_t channel;
6161
};
6262

63-
struct serial_s {
64-
UARTName uart;
65-
int index; // Used by irq
66-
uint32_t baudrate;
67-
uint32_t databits;
68-
uint32_t stopbits;
69-
uint32_t parity;
70-
PinName pin_tx;
71-
PinName pin_rx;
72-
};
73-
7463
struct spi_s {
7564
SPIName spi;
7665
uint32_t bits;

hal/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/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_STM32L0/TARGET_NUCLEO_L073RZ/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_STM32L0/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)