Other Parts Discussed in Thread: AM3359
Hi,
Iam trying to blink an LED by modifying in the corresponding parameters like pinmux and GPIO registers in GEL file. The following are the registers i modified. i put the led_blink function in OnTargetConnect().
#define CONF_GPMC_A5 (CONTROL_BASE_ADDR + 0x814)
#define CONF_GPMC_A6 (CONTROL_BASE_ADDR + 0x818)
#define CONF_GPMC_A7 (CONTROL_BASE_ADDR + 0x81C)
#define CONF_GPMC_A8 (CONTROL_BASE_ADDR + 0x820)
#define GPIO1 (0x4804C000)
#define GPIO_CTRL (GPIO1 + 0x130)
#define GPIO_OE (GPIO1 + 0x134)
#define GPIO_SETDATAOUT (GPIO1 + 0x194)
#define GPIO_CLEARDATAOUT (GPIO1 + 0x190)
Led_blink()
{
UWORD32 buf, *buf1,*buf2,*buf3,*buf4, i, j, k;
WR_MEM_32(CONF_GPMC_A5, 0x00000077);
WR_MEM_32(CONF_GPMC_A6, 0x00000077);
WR_MEM_32(CONF_GPMC_A7, 0x00000077);
WR_MEM_32(CONF_GPMC_A8, 0x00000077);
WR_MEM_32(GPIO_CTRL, 0x3);
WR_MEM_32(GPIO_OE, 0xFE1FFFFF);
GEL_TextOut("**** writing to the led .......... \n","Output",1,1,1);
while(1) {
WR_MEM_32(GPIO_SETDATAOUT, 0x1E000000);
GEL_TextOut("****ON*****\n","Output",1,1,1);
for(k=0;k<10;k++)
{
for(j=0;j<10000;j++);
}
WR_MEM_32(GPIO_CLEARDATAOUT, 0x1E000000);
k=0;
j=0;
GEL_TextOut("****OFF*****\n","Output",1,1,1);
}
}