



#define CSL_GPIO_CFG_REGS 0x0260BF00
#define CSL_GPIO_DIR        (*(unsigned int*)(CSL_GPIO_CFG_REGS + 0x010))
#define GPIO_SET_DATA       (*(unsigned int*)(CSL_GPIO_CFG_REGS + 0x018))
#define GPIO_CLEAR_DATA     (*(unsigned int*)(CSL_GPIO_CFG_REGS + 0x01C))

typedef uint32_t unsigned int;

void cycleDelay (uint32_t count);
static uint32_t readTime32(void);


int main(void)
{
    int i;


    CSL_GPIO_DIR = 0xFFFE;

    while(1){
        GPIO_SET_DATA = 0x1;
        for (i=0;i<100;i++);
        GPIO_CLEAR_DATA = 0x1;
        for (i=0;i<100;i++);
    }



	return 0;
}


/*****************************************************************************
* Function: Utility function a cycle clock
****************************************************************************/
static uint32_t readTime32(void)
{
uint32_t timeVal;

#if defined (_TMS320C6X)
timeVal = TSCL;
#elif __ARM_ARCH_7A__
__asm__ __volatile__ ("MRC p15, 0, %0, c9, c13, 0\t\n": "=r"(timeVal));
#else
/* M4 specific implementation*/
static uint32_t simuTimer = 0;
simuTimer++;
timeVal = simuTimer;
#endif
return timeVal;
}

/*****************************************************************************
* Function: Utility function to introduce delay
****************************************************************************/
void cycleDelay (uint32_t count)
{
uint32_t start = (uint32_t)readTime32();

while (((uint32_t)readTime32() - start) < count);
}
