Merge pull request #2415 from svastm/serial_asynch_f0

[STM32F0] Add asynchronous serial
pull/2808/head
Sam Grove 2016-09-24 16:22:55 -05:00 committed by GitHub
commit 297597c7f4
11 changed files with 725 additions and 242 deletions

View File

@ -656,7 +656,7 @@
"inherits": ["Target"],
"progen": {"target": "nucleo-f070rb"},
"detect_code": ["0755"],
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"NUCLEO_F072RB": {
@ -668,7 +668,7 @@
"inherits": ["Target"],
"progen": {"target": "nucleo-f072rb"},
"detect_code": ["0730"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"NUCLEO_F091RC": {
@ -680,7 +680,7 @@
"inherits": ["Target"],
"progen": {"target": "nucleo-f091rc"},
"detect_code": ["0750"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"NUCLEO_F103RB": {

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -60,17 +60,6 @@ struct analogin_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -60,17 +60,6 @@ struct analogin_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -60,17 +60,6 @@ struct analogin_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -60,17 +60,6 @@ struct analogin_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -49,6 +49,25 @@ struct pwmout_s {
uint8_t inverted;
};
struct serial_s {
UARTName uart;
int index; // Used by irq
uint32_t baudrate;
uint32_t databits;
uint32_t stopbits;
uint32_t parity;
PinName pin_tx;
PinName pin_rx;
#if DEVICE_SERIAL_ASYNCH
uint32_t events;
#endif
#if DEVICE_SERIAL_FC
uint32_t hw_flow_ctl;
PinName pin_rts;
PinName pin_cts;
#endif
};
#include "gpio_object.h"
#ifdef __cplusplus
@ -56,4 +75,3 @@ struct pwmout_s {
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -63,6 +63,18 @@
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_NUCLEO_F070RB)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_NUCLEO_F072RB)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_NUCLEO_F091RC)
#define TEST_SERIAL_ONE_TX_PIN PB_6 // UART1
#define TEST_SERIAL_TWO_RX_PIN PC_7 // UART7
#elif defined(TARGET_NUCLEO_F207ZG)
#define TEST_SERIAL_ONE_TX_PIN PC_12 // UART5
#define TEST_SERIAL_TWO_RX_PIN PC_11 // UART4