Skip to content

Commit

Permalink
Merge pull request #2571 from svastm/serial_asynch_f7
Browse files Browse the repository at this point in the history
STM32F7 - Add asynchronous serial
  • Loading branch information
sg- authored Sep 16, 2016
2 parents 1a91c1c + 15e60fc commit 75af749
Show file tree
Hide file tree
Showing 8 changed files with 673 additions and 170 deletions.
8 changes: 4 additions & 4 deletions hal/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@
},
"supported_form_factors": ["ARDUINO"],
"detect_code": ["0816"],
"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"],
"features": ["IPV4"],
"release_versions": ["2", "5"]
},
Expand All @@ -900,7 +900,7 @@
"macros": ["MBEDTLS_ENTROPY_HARDWARE_ALT"],
"progen": {"target": "nucleo-f767zi"},
"detect_code": ["0818"],
"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"],
"features": ["IPV4"],
"release_versions": ["2", "5"]
},
Expand Down Expand Up @@ -1107,7 +1107,7 @@
"macros": ["MBEDTLS_ENTROPY_HARDWARE_ALT"],
"progen": {"target": "disco-f746ng"},
"detect_code": ["0815"],
"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"],
"features": ["IPV4"],
"release_versions": ["2", "5"]
},
Expand All @@ -1119,7 +1119,7 @@
"default_toolchain": "ARM",
"progen": {"target": "disco-f769ni"},
"detect_code": ["0817"],
"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"],
"features": ["IPV4"],
"release_versions": ["2"]
},
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,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions hal/targets/hal/TARGET_STM/TARGET_STM32F7/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 75af749

Please sign in to comment.