Skip to content

Commit 3de19ee

Browse files
authored
Merge pull request #2419 from svastm/serial_asynch_f1
[STM32F1] Add asynchronous serial
2 parents 44edcf5 + e68b5f9 commit 3de19ee

File tree

7 files changed

+628
-142
lines changed

7 files changed

+628
-142
lines changed

hal/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@
692692
"inherits": ["Target"],
693693
"progen": {"target": "nucleo-f103rb"},
694694
"detect_code": ["0700"],
695-
"device_has": ["ANALOGIN", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
695+
"device_has": ["ANALOGIN", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
696696
"release_versions": ["2", "5"]
697697
},
698698
"NUCLEO_F207ZG": {

hal/targets/hal/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ struct analogin_s {
6060
uint8_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_STM32F1/TARGET_DISCO_F100RB/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ struct analogin_s {
6060
uint8_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_STM32F1/TARGET_NUCLEO_F103RB/objects.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ struct analogin_s {
6060
uint8_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_STM32F1/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)