Merge pull request #2461 from svastm/serial_asynch_f3

[STM32F3] Add asynchronous serial
pull/2527/head
Martin Kojtal 2016-08-23 14:14:10 +01:00 committed by GitHub
commit 22acfbf077
10 changed files with 656 additions and 177 deletions

View File

@ -714,7 +714,7 @@
"inherits": ["Target"], "inherits": ["Target"],
"progen": {"target": "nucleo-f302r8"}, "progen": {"target": "nucleo-f302r8"},
"detect_code": ["0705"], "detect_code": ["0705"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"], "device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2"] "release_versions": ["2"]
}, },
"NUCLEO_F303K8": { "NUCLEO_F303K8": {
@ -738,7 +738,7 @@
"inherits": ["Target"], "inherits": ["Target"],
"progen": {"target": "nucleo-f303re"}, "progen": {"target": "nucleo-f303re"},
"detect_code": ["0745"], "detect_code": ["0745"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"], "device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2", "5"] "release_versions": ["2", "5"]
}, },
"NUCLEO_F334R8": { "NUCLEO_F334R8": {
@ -750,7 +750,7 @@
"inherits": ["Target"], "inherits": ["Target"],
"progen": {"target": "nucleo-f334r8"}, "progen": {"target": "nucleo-f334r8"},
"detect_code": ["0735"], "detect_code": ["0735"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"], "device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2"] "release_versions": ["2"]
}, },
"NUCLEO_F401RE": { "NUCLEO_F401RE": {
@ -1024,7 +1024,7 @@
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"], "supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
"progen": {"target": "disco-f334c8"}, "progen": {"target": "disco-f334c8"},
"detect_code": ["0810"], "detect_code": ["0810"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"], "device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2"] "release_versions": ["2"]
}, },
"DISCO_F407VG": { "DISCO_F407VG": {

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel; 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 { struct spi_s {
SPIName spi; SPIName spi;
uint32_t bits; uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel; 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 { struct spi_s {
SPIName spi; SPIName spi;
uint32_t bits; uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel; 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 { struct spi_s {
SPIName spi; SPIName spi;
uint32_t bits; uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel; 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 { struct spi_s {
SPIName spi; SPIName spi;
uint32_t bits; uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel; 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 { struct spi_s {
SPIName spi; SPIName spi;
uint32_t bits; uint32_t bits;

View File

@ -66,17 +66,6 @@ struct dac_s {
uint32_t channel; 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 { struct spi_s {
SPIName spi; SPIName spi;
uint32_t bits; uint32_t bits;

View File

@ -49,6 +49,25 @@ struct pwmout_s {
uint8_t inverted; 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" #include "gpio_object.h"
#ifdef __cplusplus #ifdef __cplusplus

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,22 @@
#define TEST_SERIAL_ONE_TX_PIN D1 // UART2 #define TEST_SERIAL_ONE_TX_PIN D1 // UART2
#define TEST_SERIAL_TWO_RX_PIN D4 // UART5 #define TEST_SERIAL_TWO_RX_PIN D4 // UART5
#elif defined(TARGET_DISCO_F334C8)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_NUCLEO_F302R8)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_NUCLEO_F303RE)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_NUCLEO_F334R8)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_DISCO_F429ZI) #elif defined(TARGET_DISCO_F429ZI)
#define TEST_SERIAL_ONE_TX_PIN PD_5 // UART2 #define TEST_SERIAL_ONE_TX_PIN PD_5 // UART2
#define TEST_SERIAL_TWO_RX_PIN PG_9 // UART6 #define TEST_SERIAL_TWO_RX_PIN PG_9 // UART6