Appendix A
58
ECX-SLU0 / KLU0 Series Use r’s Manual
//Write the DO pin 1~4 to Low
into_PT_mode();
printf("Write DO_1~4 value to Low\n");
for (i=0; i<4; i++)
{
RetVal = read_mem_dword(MEM_BASE_AD addr_offset2[i]);
gGpioLvValue = RetVal & 0xFFFFFFFE;
write_mem_dword(MEM_BASE_ADDRESS2
+
addr_offset2[i],
gGpioLvValue);
}
printf("Read DO_1~4 value\n");
for (i=0; i<4; i++)
{
RetVal = read_mem_dword(MEM_BASE_AD addr_offset2[i]);
gGpioLvValue = RetVal & 0x1;
printf("DO_%d = %d\n",i ,gGpioLvValue > 0);
}
into_RL_mode();
return
0;
}