Merge pull request #2465 from svastm/serial_asynch_l4

[STM32L4] Add asynchronous serial
pull/2527/head
Martin Kojtal 2016-08-23 11:01:57 +01:00 committed by GitHub
commit 21d55cd235
7 changed files with 646 additions and 222 deletions

View File

@ -964,7 +964,7 @@
"inherits": ["Target"],
"progen": {"target": "nucleo-l476rg"},
"detect_code": ["0765"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"STM32F3XX": {

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,22 +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;
#if DEVICE_SERIAL_FC
uint32_t hw_flow_ctl;
PinName pin_rts;
PinName pin_cts;
#endif
};
struct spi_s {
SPIName spi;
uint32_t bits;

View File

@ -66,22 +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;
#if DEVICE_SERIAL_FC
uint32_t hw_flow_ctl;
PinName pin_rts;
PinName pin_cts;
#endif
};
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

File diff suppressed because it is too large Load Diff

View File

@ -75,6 +75,9 @@
#define TEST_SERIAL_ONE_TX_PIN PB_6 // UART1
#define TEST_SERIAL_TWO_RX_PIN PG_9 // UART6
#elif defined(TARGET_NUCLEO_L476RG)
#define TEST_SERIAL_ONE_TX_PIN PB_10 // UART3
#define TEST_SERIAL_TWO_RX_PIN PA_10 // UART1
#elif defined(TARGET_RZ_A1H)
#define TEST_SERIAL_ONE_TX_PIN P8_14 // UART4
#define TEST_SERIAL_TWO_RX_PIN P8_11 // UART5