mirror of https://github.com/ARMmbed/mbed-os.git
M252: Support configurability of USB/STDIO UART pins
- STDIO_UART and STDIO_UART_TX/STDIO_UART_RX - USB_UART and USBTX/USBRXpull/13382/head
parent
f7e4a75041
commit
a76f5dcbdf
|
|
@ -20,6 +20,7 @@
|
||||||
#define MBED_PERIPHERALNAMES_H
|
#define MBED_PERIPHERALNAMES_H
|
||||||
|
|
||||||
#include "cmsis.h"
|
#include "cmsis.h"
|
||||||
|
#include "PinNames.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -77,7 +78,16 @@ typedef enum {
|
||||||
UART_2 = (int) NU_MODNAME(UART2_BASE, 2, 0),
|
UART_2 = (int) NU_MODNAME(UART2_BASE, 2, 0),
|
||||||
|
|
||||||
/* NOTE: board-specific */
|
/* NOTE: board-specific */
|
||||||
STDIO_UART = UART_0
|
#if defined(MBED_CONF_TARGET_USB_UART)
|
||||||
|
USB_UART = MBED_CONF_TARGET_USB_UART,
|
||||||
|
#else
|
||||||
|
USB_UART = NC,
|
||||||
|
#endif
|
||||||
|
#if defined(MBED_CONF_TARGET_STDIO_UART)
|
||||||
|
STDIO_UART = MBED_CONF_TARGET_STDIO_UART
|
||||||
|
#else
|
||||||
|
STDIO_UART = USB_UART
|
||||||
|
#endif
|
||||||
} UARTName;
|
} UARTName;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
||||||
|
|
@ -107,10 +107,26 @@ typedef enum {
|
||||||
/* Other board-specific naming */
|
/* Other board-specific naming */
|
||||||
|
|
||||||
/* UART naming */
|
/* UART naming */
|
||||||
USBTX = PB_13,
|
#if defined(MBED_CONF_TARGET_USB_UART_TX)
|
||||||
USBRX = PB_12,
|
USBTX = MBED_CONF_TARGET_USB_UART_TX,
|
||||||
|
#else
|
||||||
|
USBTX = NC,
|
||||||
|
#endif
|
||||||
|
#if defined(MBED_CONF_TARGET_USB_UART_RX)
|
||||||
|
USBRX = MBED_CONF_TARGET_USB_UART_RX,
|
||||||
|
#else
|
||||||
|
USBRX = NC,
|
||||||
|
#endif
|
||||||
|
#if defined(MBED_CONF_TARGET_STDIO_UART_TX)
|
||||||
|
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
|
||||||
|
#else
|
||||||
STDIO_UART_TX = USBTX,
|
STDIO_UART_TX = USBTX,
|
||||||
|
#endif
|
||||||
|
#if defined(MBED_CONF_TARGET_STDIO_UART_RX)
|
||||||
|
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
|
||||||
|
#else
|
||||||
STDIO_UART_RX = USBRX,
|
STDIO_UART_RX = USBRX,
|
||||||
|
#endif
|
||||||
SERIAL_TX = D10,
|
SERIAL_TX = D10,
|
||||||
SERIAL_RX = D13,
|
SERIAL_RX = D13,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5656,6 +5656,30 @@
|
||||||
"IAR"
|
"IAR"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
|
"usb-uart": {
|
||||||
|
"help": "Configure USB_UART. USB_UART and USB_UART_TX/USB_UART_RX must be consistent.",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"usb-uart-tx": {
|
||||||
|
"help": "Configure USBTX. USB_UART and USBTX/USBRX must be consistent.",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"usb-uart-rx": {
|
||||||
|
"help": "Configure USBRX. USB_UART and USBTX/USBRX must be consistent.",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"stdio-uart": {
|
||||||
|
"help": "Configure STDIO_UART. STDIO_UART and STDIO_UART_TX/STDIO_UART_RX must be consistent. STDIO_UART defaults to USB_UART.",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"stdio-uart-tx": {
|
||||||
|
"help": "Configure STDIO_UART_TX. STDIO_UART and STDIO_UART_TX/STDIO_UART_RX must be consistent. STDIO_UART_TX defaults to USBTX.",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
|
"stdio-uart-rx": {
|
||||||
|
"help": "Configure STDIO_UART_RX. STDIO_UART and STDIO_UART_TX/STDIO_UART_RX must be consistent. STDIO_UART_RX defaults to USBRX.",
|
||||||
|
"value": null
|
||||||
|
},
|
||||||
"gpio-irq-debounce-enable": {
|
"gpio-irq-debounce-enable": {
|
||||||
"help": "Enable GPIO IRQ debounce",
|
"help": "Enable GPIO IRQ debounce",
|
||||||
"value": 0
|
"value": 0
|
||||||
|
|
@ -5733,7 +5757,12 @@
|
||||||
"2",
|
"2",
|
||||||
"5"
|
"5"
|
||||||
],
|
],
|
||||||
"device_name": "M252KG6AE"
|
"device_name": "M252KG6AE",
|
||||||
|
"overrides": {
|
||||||
|
"usb-uart": "UART_0",
|
||||||
|
"usb-uart-tx": "PB_13",
|
||||||
|
"usb-uart-rx": "PB_12"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"TMPM4G9": {
|
"TMPM4G9": {
|
||||||
"inherits": [
|
"inherits": [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue