Skip to content

Commit

Permalink
Merge pull request #2415 from svastm/serial_asynch_f0
Browse files Browse the repository at this point in the history
[STM32F0] Add asynchronous serial
  • Loading branch information
sg- authored Sep 24, 2016
2 parents e453b5e + 7e3d733 commit 297597c
Show file tree
Hide file tree
Showing 11 changed files with 726 additions and 243 deletions.
6 changes: 3 additions & 3 deletions hal/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": {
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 @@ -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
20 changes: 19 additions & 1 deletion hal/targets/hal/TARGET_STM/TARGET_STM32F0/common_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,29 @@ 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
}
#endif

#endif

Loading

0 comments on commit 297597c

Please sign in to comment.