Skip to content

Commit c9db4ba

Browse files
committed
[STM32F1] Add asynchronous serial
1 parent 5c14cb9 commit c9db4ba

File tree

5 files changed

+623
-141
lines changed

5 files changed

+623
-141
lines changed

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)