#include <stdio.h>
#include "OB90A64U1.h"
#include "gpio.h"
#include "uart.h"
#include "DMA.h"

#define SFR_ADDR 0x50020014
#define RAM_ADDR1 0x20001000
#define RAM_ADDR2 0x20002000

void Dealay(uint32_t nCount)
{
    while(nCount--);
}

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("Move ADC register value to ram  (Use ADC to trigger DMA function) \r\n");
    DMA_Open_ADC(OB_DMA0,SFR_ADDR, RAM_ADDR1, 6 );

    printf("Move RAM_1 value to RAM_2  \r\n");
    DMA_Open_M(OB_DMA0,RAM_ADDR1, RAM_ADDR2, 6 );
    while(1);
}
