/******************************************************************************
* [url=home.php?mod=space&uid=288409]@file[/url] main.c
* [url=home.php?mod=space&uid=895143]@version[/url] V1.00
* $Revision: 1 $
* $Date: 14/10/03 1:27p $
* [url=home.php?mod=space&uid=247401]@brief[/url] Software Development Template.
* @note
* Copyright (C) 2014 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include <stdio.h>
#include "M0518.h"
void SYS_Init(void)
{
/* Enable IP clock */
CLK->APBCLK = CLK_APBCLK_UART0_EN_Msk;
/* Update System Core Clock */
/* User can use SystemCoreClockUpdate() to calculate SystemCoreClock and cyclesPerUs automatically. */
SystemCoreClockUpdate();
/* Set GPB multi-function pins for UART0 RXD and TXD */
SYS->GPB_MFP = SYS_GPB_MFP_PB0_UART0_RXD | SYS_GPB_MFP_PB1_UART0_TXD;
}
int main()
{
int8_t ch;
/* Unlock protected registers */
SYS_UnlockReg();
SYS_Init();
/* Lock protected registers */
SYS_LockReg();
/* Init UART0 to 115200-8n1 for print message */
UART_Open(UART0, 115200);
printf("Simple Demo Code\n\n");
printf("Please Input Any Key\n\n");
do
{
printf("Input: ");
ch = getchar();
printf("%c\n", ch);
}
while(1);
}
/*** (C) COPYRIGHT 2014 Nuvoton Technology Corp. ***/
|