Skip to content

Commit a48a6f7

Browse files
authored
Merge pull request #2464 from svastm/serial_asynch_l1
[STM32L1] Add asynchronous serial
2 parents f147f6f + ae5824b commit a48a6f7

File tree

7 files changed

+655
-156
lines changed

7 files changed

+655
-156
lines changed

hal/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@
949949
"inherits": ["Target"],
950950
"progen": {"target": "nucleo-l152re"},
951951
"detect_code": ["0710"],
952-
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
952+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
953953
"release_versions": ["2", "5"]
954954
},
955955
"NUCLEO_L432KC": {

hal/targets/hal/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ struct dac_s {
6464
PinName pin;
6565
};
6666

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

hal/targets/hal/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ struct dac_s {
6464
PinName pin;
6565
};
6666

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

hal/targets/hal/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ struct dac_s {
6464
PinName pin;
6565
};
6666

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

hal/targets/hal/TARGET_STM/TARGET_STM32L1/common_objects.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ struct pwmout_s {
4747
uint32_t pulse;
4848
};
4949

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

5271
#ifdef __cplusplus

0 commit comments

Comments
 (0)