set the UART1 pin directions in uart1_init()

patch from Hedde Bosman
This commit is contained in:
Mariano Alvira 2011-04-06 05:53:18 -04:00
parent 81a0a0356d
commit a3412a0b81

View file

@ -50,6 +50,14 @@ void uart1_init(uint16_t inc, uint16_t mod, uint8_t samp) {
*UART1_UCON = 0; *UART1_UCON = 0;
*UART1_UBRCNT = ( inc << 16 ) | mod; *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 */ /* see Section 11.5.1.2 Alternate Modes */
/* you must enable the peripheral first BEFORE setting the function in GPIO_FUNC_SEL */ /* 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 */ /* From the datasheet: "The peripheral function will control operation of the pad IF */