From f80d82d14f9696679e40d4b7af6a70f33180ad0c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 13 Dec 2013 16:41:44 -0600 Subject: [PATCH] A10 serial driver (still needs some work). From Alan Carvalho de Assis --- configs/pcduino-a10/README.txt | 11 ++++++++--- configs/pcduino-a10/include/board.h | 21 +++++++++++++++++++++ configs/pcduino-a10/src/a1x_leds.c | 6 +++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/configs/pcduino-a10/README.txt b/configs/pcduino-a10/README.txt index b37de97c0a..59a0f64c80 100644 --- a/configs/pcduino-a10/README.txt +++ b/configs/pcduino-a10/README.txt @@ -187,10 +187,15 @@ pcDuino v1 Connectors Serial Console ============== - Two UART connections are available: + 1. UART0 is available on J5 Debug Port. - UART0 is available on J5 Debug Port. - UART2 is available on J11 + J15 Pin 1 Rx UART0-RX UART0_RX/IR1_RX/PB23 + J15 Pin 2 Tx UART0-TX UART0_TX/IR1_TX/PB22 + + 2. UART2 is available on J11 + + J11 Pin1 UART-Rx / GPIO0 UART2_RX EINT31/SPI1_MISO/UART2_RX/PI19 + J11 Pin2 UART-Tx / GPIO1 UART2_TX EINT30/SPI1_MOSI/UART2_TX/PI18 By default, the serial console will be provided on UART0 in all of these configurations. diff --git a/configs/pcduino-a10/include/board.h b/configs/pcduino-a10/include/board.h index 7b17bc0c0e..b5b0f3b715 100644 --- a/configs/pcduino-a10/include/board.h +++ b/configs/pcduino-a10/include/board.h @@ -42,6 +42,8 @@ #include +#include "chip/a1x_piocfg.h" + /************************************************************************************ * Definitions ************************************************************************************/ @@ -126,6 +128,25 @@ /* NAND *****************************************************************************/ /* GPIO pin disambiguation **********************************************************/ +/* UARTs ****************************************************************************/ +/* Two UART connections are available: + * + * 1. UART0 is available on J5 Debug Port. + * + * J15 Pin 1 Rx UART0-RX UART0_RX/IR1_RX/PB23 + * J15 Pin 2 Tx UART0-TX UART0_TX/IR1_TX/PB22 + * + * 2. UART2 is available on J11 + * + * J11 Pin1 UART-Rx / GPIO0 UART2_RX EINT31/SPI1_MISO/UART2_RX/PI19 + * J11 Pin2 UART-Tx / GPIO1 UART2_TX EINT30/SPI1_MOSI/UART2_TX/PI18 + */ + +#define PIO_UART0_RX PIO_UART0_RX_1 +#define PIO_UART0_TX PIO_UART0_TX_1 + +#define PIO_UART2_RX PIO_UART2_RX_1 +#define PIO_UART2_TX PIO_UART2_TX_1 /************************************************************************************ * Assembly Language Macros diff --git a/configs/pcduino-a10/src/a1x_leds.c b/configs/pcduino-a10/src/a1x_leds.c index 96a2abacd9..2596b45186 100644 --- a/configs/pcduino-a10/src/a1x_leds.c +++ b/configs/pcduino-a10/src/a1x_leds.c @@ -123,9 +123,9 @@ void a1x_led_initialize(void) { - a1x_configpio(PIO_LED1); - a1x_configpio(PIO_LED3); - a1x_configpio(PIO_LED4); + a1x_pio_config(PIO_LED1); + a1x_pio_config(PIO_LED3); + a1x_pio_config(PIO_LED4); } /****************************************************************************