#include "stdio.h"
#include "OB90A64U1.h"
#include "timer32.h"
#include "gpio.h"
#include "uart.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);

    GPIO_SetPinMFType(OB_GPIO0, GPIO_PIN10, GPIO_MF_TIMER32_MAT);
    TIMER32_SetExternalMatch(OB_CT32B0, TIMER32_EMATCH2, TIMER32_EMATCH_TOGGLE);
    TIMER32_ToggleOut(OB_CT32B0, TIMER32_EMATCH2, 100000); // uint = us
    TIMER32_Enable(OB_CT32B0);
    while(1);
}
