Appendix A
62
ECX-APL0 Series User’s Manual
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
RetVal = RetVal & 0xFFFFFCFF;
gGpioLvValue = RetVal | 0x200; //Set RX Disable(Bit9)
write_mem_dword(MEM_BASE_A addr_offset[i], gGpioLvValue);
}
//Write the DIO pin 1~8 to High
printf("Write DIO_1~8 value to High\n");
for (i=0; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal | 0x1;
write_mem_dword(MEM_BASE_A addr_offset[i], gGpioLvValue);
}
printf("Read DIO_1~8 value\n");
for (i=0; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal & 0x1;
printf("DIO_%d = %d\n",i+1 ,gGpioLvValue > 0);
}
into_RL_mode();
system("pause");
//Write the DIO pin 1~8 to Low
into_PT_mode();
printf("Write DIO_1~8 value to Low\n");
for (i=0; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal & 0xFFFFFFFE;
write_mem_dword(MEM_BASE_A addr_offset[i], gGpioLvValue);
}
printf("Read DIO_1~8 value\n");
for (i=0; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);