CooCox UART test (USB 5V0 to TTL 3V3 3 pin (Gnd, TxD, RxD) adaptor)
void UartPrintExp();
// ***********************************************************************
// Program - Fong Blink
// Function - Blink LED
// Author - TL Fong
// Build - 2013.08.19.01
// Date - 2013aug19hkt0917
// Hardware - LPC1114/102, LPC1114/301
// Software - GCC ARM 4.7, CoIDE 1.7.4, CoLinkEx 1.1, Flash Magic v7.51
// ***********************************************************************
void BlinkExp();
void FongBlink011();
int main()
{
// BlinkExp(); // 2013aug18
//FongBlink011(); // 2013aug19
UartPrintExp();
return 0;
}
#include "lpc11xx_uart.h"
/* CooCox UART Print Example 2013aug19 */
void UartPrintExp()
{
UART_CFG_Type cfg;
UART_FIFO_CFG_Type UARTFIFOConfigStruct;
/* Assign UART Pins */
UART_PinsInit();
cfg.Baud_rate = 115200;
cfg.Parity = UART_PARITY_NONE;
cfg.Databits = UART_DATABIT_8;
cfg.Stopbits = UART_STOPBIT_1;
UART_FIFOConfigStructInit(&UARTFIFOConfigStruct);
UART_Init(LPC_UART, &cfg);
UART_FIFOConfig(LPC_UART, &UARTFIFOConfigStruct);
/* Enable Transmit */
UART_TxCmd(LPC_UART,ENABLE);
UART_Send(LPC_UART, (uint8_t *)"Hello, World! 01", \
sizeof("Hello, World! 01") - 1, NONE_BLOCKING);
}
.END
No comments:
Post a Comment