#include <stdio.h>
#include "OB6627.h"
#include "uart.h"
#include "gpio.h"

int main(void)
{
    uint32_t nReady;
    uint8_t  nData;

    SystemCoreClockUpdate();
    GPIO_SetPinMFType(OB_GPIO2, GPIO_PIN0, GPIO_MF_UART1_RX);
    GPIO_SetPinMFType(OB_GPIO2, GPIO_PIN1, GPIO_MF_UART1_TX);
    UART_Open(OB_UART1, 19200);
    //--------------------------------------------------
    printf(" UART function test\n\r");
    printf(" CPU Clock = %dHz\n\r", SystemCoreClock);
    while(1)
    {
        nReady = scanf("%c\n", &nData);
        if (nReady != 0xFF)
            printf("Data = %c", nData);
    }
    //---------------------------
}
