Skip to content

Commit

Permalink
STM32F4: STDIO_UART_TX and STDIO_UART_RX can be now user defined
Browse files Browse the repository at this point in the history
NB for UBLOX targets: usb_rx and usb_tx config name are still available
in order to not break current applications.
  • Loading branch information
jeromecoutant committed Jan 8, 2018
1 parent 59b4b22 commit 9c6e7c0
Show file tree
Hide file tree
Showing 39 changed files with 329 additions and 171 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ typedef enum {
UART_6 = (int)USART6_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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ typedef enum {
ADC_VREF = 0xF1,
ADC_VBAT = 0xF2,

// 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 = PD_12,
LED2 = PD_13,
Expand All @@ -122,10 +134,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 = PA_7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ typedef enum {
UART_6 = (int)USART6_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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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,
Expand All @@ -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 = PA_7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ typedef enum {
UART_6 = (int)USART6_BASE,
} UARTName;

#define STDIO_UART_TX PC_6
#define STDIO_UART_RX PC_7
#define STDIO_UART UART_6

typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,25 @@ 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 = PC_6,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PC_7,
#endif

// Generic signals namings
LED1 = PB_3,
LED2 = PD_8,
LED3 = PD_9,
LED4 = PD_10,
USBTX = PC_6, /* USART6 */
USBRX = PC_7,
USBTX = STDIO_UART_TX, /* USART6 */
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8, /* I2C1 */
I2C_SDA = PB_9,
SPI_MOSI = PC_3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ typedef enum {
UART_6 = (int)USART6_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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ typedef enum {
ADC_VREF = 0xF1,
ADC_VBAT = 0xF2,

// 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 = PD_13,
LED2 = PD_12,
Expand All @@ -207,10 +219,10 @@ typedef enum {
USER_BUTTON = PA_0,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_2, /* USART2 */
SERIAL_RX = PA_3,
USBTX = PA_2, /* USART2 */
USBRX = PA_3,
SERIAL_TX = STDIO_UART_TX, /* USART2 */
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX, /* USART2 */
USBRX = STDIO_UART_RX,
I2C_SCL = PB_8, /* I2C1 */
I2C_SDA = PB_9,
SPI_MOSI = PA_7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ typedef enum {
UART_6 = (int)USART6_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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ typedef enum {
UART_6 = (int)USART6_BASE
} UARTName;

#define STDIO_UART_TX PA_9
#define STDIO_UART_RX PA_10
#define STDIO_UART UART_1

typedef enum {
SPI_1 = (int)SPI1_BASE, ELMO_RF_SPI2 = SPI_1,
SPI_2 = (int)SPI2_BASE, ELMO_SPI1 = SPI_2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ typedef enum {
D14 = PC_9,
D15 = PA_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_9,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PA_10,
#endif

// Generic signals namings
LED1 = PB_0,
LED2 = PB_1,
Expand All @@ -133,10 +145,10 @@ typedef enum {
USER_BUTTON = PB_7,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PA_9,
SERIAL_RX = PA_10,
USBTX = PA_9,
USBRX = PA_10,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = D15,
I2C_SDA = D14,
SPI_MOSI = D11,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ typedef enum {
UART_6 = (int)USART6_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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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,
Expand All @@ -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 = PA_7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ typedef enum {
UART_6 = (int)USART6_BASE
} UARTName;

#define STDIO_UART_TX PD_8
#define STDIO_UART_RX PD_9
#define STDIO_UART UART_3

typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,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,
Expand All @@ -184,10 +196,10 @@ typedef enum {
USER_BUTTON = PC_13,
// Standardized button names
BUTTON1 = USER_BUTTON,
SERIAL_TX = PD_8,
SERIAL_RX = PD_9,
USBTX = SERIAL_TX,
USBRX = SERIAL_RX,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = D15,
I2C_SDA = D14,
SPI_MOSI = D11,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ typedef enum {
UART_10 = (int)UART10_BASE
} UARTName;

#define STDIO_UART_TX PG_14
#define STDIO_UART_RX PG_9
#define STDIO_UART UART_6

typedef enum {
SPI_1 = (int)SPI1_BASE,
SPI_2 = (int)SPI2_BASE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,18 @@ typedef enum {
D14 = PB_11,
D15 = PB_10,

// STDIO for console print
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
STDIO_UART_TX = PG_14,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
STDIO_UART_RX = PG_9,
#endif

// Generic signals namings
LED1 = PC_5, // Green = LD3 on the board
LED2 = PE_3, // Red = LD4 on the board
Expand All @@ -230,10 +242,10 @@ typedef enum {
LED_RED = LED2,
USER_BUTTON = PA_0,
BUTTON1 = USER_BUTTON,
SERIAL_TX = PG_14,
SERIAL_RX = PG_9,
USBTX = SERIAL_TX,
USBRX = SERIAL_RX,
SERIAL_TX = STDIO_UART_TX,
SERIAL_RX = STDIO_UART_RX,
USBTX = STDIO_UART_TX,
USBRX = STDIO_UART_RX,
I2C_SCL = D15,
I2C_SDA = D14,
SPI_MOSI = D11,
Expand Down
Loading

0 comments on commit 9c6e7c0

Please sign in to comment.