#include "stdio.h"
#include "OB90A64U1.h"
#include "gpio.h"
#include "uart.h"
#include "timer16.h"

int main(void)
{
    SystemCoreClockUpdate();
    GPIO_SetPinMFType(OB_GPIO0, GPIO_PIN14, GPIO_MF_UART_RX);
    GPIO_SetPinMFType(OB_GPIO0, GPIO_PIN13, GPIO_MF_UART_TX);
    UART_Open(OB_UART0, 19200);
    printf("\n  Output 100ms (P0.3) \n\r");

    GPIO_SetPinMFType(OB_GPIO0, GPIO_PIN3, GPIO_MF_TIMER16_MAT); //MAT0
    TIMER16_SetExternalMatch(OB_CT16B0, TIMER16_EMATCH0, TIMER16_EMATCH_TOGGLE);
    TIMER16_ToggleOut(OB_CT16B0, TIMER16_EMATCH0, 100000);
    TIMER16_Enable(OB_CT16B0);
    while(1);
}
