#include “NUC1xx.h"
#include “Driver\DrvSYS.h"
#include “Driver\DrvGPIO.h"
#include “Seven_Segment.h"

//=============================================================
// Display a number on 4-digit 7-seg.
//=============================================================

//=============================================================
// MAIN function
//=============================================================
int32_t main (void)
{

GPIO_T * tGPIO_C, *tGPIO_E;

tGPIO_C = (GPIO_T *)((uint32_t)GPIOA + (2*0x40));
tGPIO_E = (GPIO_T *)((uint32_t)GPIOA + (4*0x40));

int pattern1[12] = {0xE6, 0xEE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDE, 0x9B, 0xB3, 0xE3};
int pattern2[12] = {0xFF, 0xDF, 0xDE, 0xCE, 0xE6, 0xE3, 0xB3, 0xBB, 0xFE, 0xFF, 0xFF, 0xFF};

int i = 0;

while(1)
{

for(i = 0; i < 12; i++) {
tGPIO_E->DOUT = pattern1[i];
tGPIO_C->DOUT = 0xff20;
DrvSYS_Delay(500000);
tGPIO_C->DOUT = 0x0000;

tGPIO_E->DOUT = pattern2[i];
tGPIO_C->DOUT = 0xff10;
DrvSYS_Delay(500000);
tGPIO_C->DOUT = 0x0000;
}
}

}