From a3412a0b81fea569dabfad5aba0a812e1c4f56d7 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Wed, 6 Apr 2011 05:53:18 -0400 Subject: [PATCH] set the UART1 pin directions in uart1_init() patch from Hedde Bosman --- src/default_lowlevel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/default_lowlevel.c b/src/default_lowlevel.c index 918567bbe..452771085 100644 --- a/src/default_lowlevel.c +++ b/src/default_lowlevel.c @@ -50,6 +50,14 @@ void uart1_init(uint16_t inc, uint16_t mod, uint8_t samp) { *UART1_UCON = 0; *UART1_UBRCNT = ( inc << 16 ) | mod; + /* TX and CTS as outputs */ + GPIO->PAD_DIR_SET.GPIO_14 = 1; + GPIO->PAD_DIR_SET.GPIO_16 = 1; + + /* RX and RTS as inputs */ + GPIO->PAD_DIR_RESET.GPIO_15 = 1; + GPIO->PAD_DIR_RESET.GPIO_17 = 1; + /* see Section 11.5.1.2 Alternate Modes */ /* you must enable the peripheral first BEFORE setting the function in GPIO_FUNC_SEL */ /* From the datasheet: "The peripheral function will control operation of the pad IF */