X-Git-Url: https://git.sur5r.net/?p=armstart-ibdap;a=blobdiff_plain;f=src%2Fuart.c;fp=src%2Fuart.c;h=d140382902e407f96a93c796eef645e3a341d343;hp=0000000000000000000000000000000000000000;hb=8dc27fcbb690f5a27358b78782f7d217253b5235;hpb=7cdc866d982b6bb662fa3b2eceb621f5369267d2 diff --git a/src/uart.c b/src/uart.c new file mode 100644 index 0000000..d140382 --- /dev/null +++ b/src/uart.c @@ -0,0 +1,23 @@ +/* + * uart.c + * + * Created on: Jun 26, 2015 + * Author: yliu + */ + +#include "LPC11Uxx.h" + +void init_uart () { + /* + LPC_IOCON->PIO0_18 = 1; // PIO0_18 used for RXD + LPC_IOCON->PIO0_19 = 1; // PIO0_19 used for TXD + + // Setup UART for 115.2K8N1 + Chip_UART_Init(LPC_USART); + LPC_SYSCON->SYSAHBCLKCTRL |= 1 << 12; + Chip_UART_SetBaud(LPC_USART, 115200); + Chip_UART_ConfigData(LPC_USART, (UART_LCR_WLEN8 | UART_LCR_SBS_1BIT)); + Chip_UART_SetupFIFOS(LPC_USART, (UART_FCR_FIFO_EN | UART_FCR_TRG_LEV2)); + Chip_UART_TXEnable(LPC_USART); + */ +}