Skip to content

Commit 297597c

Browse files
authored
Merge pull request #2415 from svastm/serial_asynch_f0
[STM32F0] Add asynchronous serial
2 parents e453b5e + 7e3d733 commit 297597c

File tree

11 files changed

+726
-243
lines changed

11 files changed

+726
-243
lines changed

hal/targets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@
656656
"inherits": ["Target"],
657657
"progen": {"target": "nucleo-f070rb"},
658658
"detect_code": ["0755"],
659-
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
659+
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
660660
"release_versions": ["2", "5"]
661661
},
662662
"NUCLEO_F072RB": {
@@ -668,7 +668,7 @@
668668
"inherits": ["Target"],
669669
"progen": {"target": "nucleo-f072rb"},
670670
"detect_code": ["0730"],
671-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
671+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
672672
"release_versions": ["2", "5"]
673673
},
674674
"NUCLEO_F091RC": {
@@ -680,7 +680,7 @@
680680
"inherits": ["Target"],
681681
"progen": {"target": "nucleo-f091rc"},
682682
"detect_code": ["0750"],
683-
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
683+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
684684
"release_versions": ["2", "5"]
685685
},
686686
"NUCLEO_F103RB": {

hal/targets/hal/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/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_STM32F0/TARGET_NUCLEO_F030R8/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_STM32F0/TARGET_NUCLEO_F031K6/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_STM32F0/TARGET_NUCLEO_F042K6/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_STM32F0/TARGET_NUCLEO_F070RB/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_STM32F0/TARGET_NUCLEO_F072RB/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_STM32F0/TARGET_NUCLEO_F091RC/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_STM32F0/common_objects.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,29 @@ 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
5574
}
5675
#endif
5776

5877
#endif
59-

0 commit comments

Comments
 (0)