Skip to content

Commit

Permalink
Merge pull request contiki-os#365 from g-oikonomou/cc2538-uart-init-fix
Browse files Browse the repository at this point in the history
Set peripheral mode for the correct CC2538 UART TX/RX pins
  • Loading branch information
g-oikonomou committed Oct 23, 2013
2 parents 4fd529e + e4a454b commit ce0b2ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpu/cc2538/dev/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ uart_init(void)
ioc_set_sel(UART_TX_PORT, UART_TX_PIN, IOC_PXX_SEL_UART_TXD);
ioc_set_over(UART_TX_PORT, UART_TX_PIN, IOC_OVERRIDE_OE);

/* Set PA[1:0] to peripheral mode */
REG(GPIO_A_BASE | GPIO_AFSEL) |= (0x00000002 | 0x00000001);
/* Set RX and TX pins to peripheral mode */
GPIO_PERIPHERAL_CONTROL(GPIO_PORT_TO_BASE(UART_TX_PORT), GPIO_PIN_MASK(UART_TX_PIN));
GPIO_PERIPHERAL_CONTROL(GPIO_PORT_TO_BASE(UART_RX_PORT), GPIO_PIN_MASK(UART_RX_PIN));

/*
* UART Interrupt Masks:
Expand Down

0 comments on commit ce0b2ca

Please sign in to comment.