Skip to content

Commit

Permalink
Merge pull request #2463 from svastm/serial_asynch_l0
Browse files Browse the repository at this point in the history
[STM32L0] Add asynchronous serial
  • Loading branch information
sg- authored Sep 18, 2016
2 parents 3194cc2 + b5c3647 commit c4a02b0
Show file tree
Hide file tree
Showing 9 changed files with 642 additions and 169 deletions.
4 changes: 2 additions & 2 deletions hal/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@
"inherits": ["Target"],
"progen": {"target": "nucleo-l053r8"},
"detect_code": ["0715"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"default_lib": "small",
"release_versions": ["2"]
},
Expand All @@ -953,7 +953,7 @@
"inherits": ["Target"],
"progen": {"target": "nucleo-l073rz"},
"detect_code": ["0760"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"NUCLEO_L152RE": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions hal/targets/hal/TARGET_STM/TARGET_STM32L0/common_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit c4a02b0

Please sign in to comment.