STM32F3: STDIO_UART_TX and STDIO_UART_RX can be now user defined

pull/5795/head
jeromecoutant 2017-12-07 13:53:18 +01:00
parent 785862e69e
commit a7bddff5cc
14 changed files with 113 additions and 58 deletions

View File

@ -50,10 +50,6 @@ typedef enum {
UART_3 = (int)USART3_BASE
} UARTName;
#define STDIO_UART_TX PA_2
#define STDIO_UART_RX PA_3
#define STDIO_UART UART_2
typedef enum {
SPI_2 = (int)SPI2_BASE,
SPI_3 = (int)SPI3_BASE

View File

@ -123,6 +123,18 @@ typedef enum {
D14 = PB_9,
D15 = PB_8,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PA_2,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_3,
#endif
// Generic signals namings
LED1 = PB_13,
LED2 = PB_13,
@ -131,10 +143,10 @@ typedef enum {
USER_BUTTON = PC_13,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_2,
SERIAL_RX = PA_3,
USBTX = PA_2,
USBRX = PA_3,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8,
I2C_SDA = PB_9,
SPI_MOSI = PB_15,

View File

@ -49,13 +49,9 @@ typedef enum {
typedef enum {
UART_1 = (int)USART1_BASE,
UART_2 = (int)USART2_BASE,
UART_3 = (int)USART3_BASE // defined for compilation issue. UART3 is not present on STM32F303K8
UART_3 = (int)USART3_BASE
} UARTName;
#define STDIO_UART_TX PA_2
#define STDIO_UART_RX PA_15
#define STDIO_UART UART_2
typedef enum {
SPI_1 = (int)SPI1_BASE
} SPIName;

View File

@ -115,6 +115,18 @@ typedef enum {
D12 = PB_4,
D13 = PB_3,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PA_2,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_15,
#endif
// Generic signals namings
LED1 = PB_3,
LED2 = PB_3,
@ -123,10 +135,10 @@ typedef enum {
USER_BUTTON = 0x20, // no user button on the board
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_2,
SERIAL_RX = PA_15,
USBTX = PA_2,
USBRX = PA_15,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = PB_6,
I2C_SDA = PB_7,
SPI_MOSI = PB_5,

View File

@ -55,10 +55,6 @@ typedef enum {
UART_5 = (int)UART5_BASE
} UARTName;
#define STDIO_UART_TX PA_2
#define STDIO_UART_RX PA_3
#define STDIO_UART UART_2
typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,

View File

@ -177,6 +177,18 @@ typedef enum {
D14 = PB_9,
D15 = PB_8,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PA_2,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_3,
#endif
// Generic signals namings
LED1 = PE_9,
LED2 = PE_8,
@ -191,10 +203,10 @@ typedef enum {
USER_BUTTON = PA_0,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_2,
SERIAL_RX = PA_3,
USBTX = PA_2,
USBRX = PA_3,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8,
I2C_SDA = PB_9,
SPI_MOSI = PB_15,

View File

@ -55,10 +55,6 @@ typedef enum {
UART_5 = (int)UART5_BASE
} UARTName;
#define STDIO_UART_TX PA_2
#define STDIO_UART_RX PA_3
#define STDIO_UART UART_2
typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,

View File

@ -131,6 +131,18 @@ typedef enum {
D14 = PB_9,
D15 = PB_8,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PA_2,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_3,
#endif
// Generic signals namings
LED1 = PA_5,
LED2 = PA_5,
@ -139,10 +151,10 @@ typedef enum {
USER_BUTTON = PC_13,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_2,
SERIAL_RX = PA_3,
USBTX = PA_2,
USBRX = PA_3,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8,
I2C_SDA = PB_9,
SPI_MOSI = PA_7,

View File

@ -55,11 +55,6 @@ typedef enum {
UART_5 = (int)UART5_BASE
} UARTName;
#define STDIO_UART_TX SERIAL_TX
#define STDIO_UART_RX SERIAL_RX
#define STDIO_UART UART_3
typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,

View File

@ -198,6 +198,18 @@ typedef enum {
D14 = PB_9,
D15 = PB_8,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PD_8,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PD_9,
#endif
// Generic signals namings
LED1 = PB_0,
LED2 = PB_7,
@ -206,10 +218,10 @@ typedef enum {
USER_BUTTON = PC_13,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PD_8, // Virtual Com Port
SERIAL_RX = PD_9, // Virtual Com Port
USBTX = SERIAL_TX, // Virtual Com Port
USBRX = SERIAL_RX, // Virtual Com Port
SERIAL_TX = STDIO_UART_TX, // Virtual Com Port
SERIAL_RX = STDIO_UART_RX, // Virtual Com Port
USBTX = STDIO_UART_TX, // Virtual Com Port
USBRX = STDIO_UART_RX, // Virtual Com Port
I2C_SCL = D15,
I2C_SDA = D14,
SPI_MOSI = D11,

View File

@ -52,10 +52,6 @@ typedef enum {
UART_3 = (int)USART3_BASE
} UARTName;
#define STDIO_UART_TX PB_3
#define STDIO_UART_RX PB_4
#define STDIO_UART UART_2
typedef enum {
SPI_1 = (int)SPI1_BASE
} SPIName;

View File

@ -113,6 +113,18 @@ typedef enum {
// D14 = PB_9,
// D15 = PB_8,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PB_3,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PB_4,
#endif
// Generic signals namings
LED1 = PB_6,
LED2 = PB_7,
@ -121,10 +133,10 @@ typedef enum {
USER_BUTTON = PA_0,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PB_3,
SERIAL_RX = PB_4,
USBTX = PB_3,
USBRX = PB_4,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8,
I2C_SDA = PB_9,
SPI_MOSI = PA_7,

View File

@ -52,10 +52,6 @@ typedef enum {
UART_3 = (int)USART3_BASE
} UARTName;
#define STDIO_UART_TX PA_2
#define STDIO_UART_RX PA_3
#define STDIO_UART UART_2
typedef enum {
SPI_1 = (int)SPI1_BASE
} SPIName;

View File

@ -126,6 +126,18 @@ typedef enum {
D14 = PB_9,
D15 = PB_8,
// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PA_2,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_3,
#endif
// Generic signals namings
LED1 = PA_5,
LED2 = PA_5,
@ -134,10 +146,10 @@ typedef enum {
USER_BUTTON = PC_13,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_2,
SERIAL_RX = PA_3,
USBTX = PA_2,
USBRX = PA_3,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8,
I2C_SDA = PB_9,
SPI_MOSI = PA_7,