![background image](http://html1.mh-extra.com/html/quanmax/keex-1850-series/keex-1850-series_user-manual_3450521059.webp)
Appendix A
59
KEEX-1850 Series User’s Manual
into_PT_mode();
printf("Write DO_1~4 value to High\n");
for (i=4; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal | 0x2;
write_mem_dword(MEM_BASE_A addr_offset[i], gGpioLvValue);
}
printf("Read DO_1~4 value\n");
for (i=4; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal & 0x2;
printf("DO_%d = %d\n",i-3 ,gGpioLvValue > 0);
}
into_RL_mode();
system("pause");
//Write the DO pin 1~4 to Low
into_PT_mode();
printf("Write DO_1~4 value to Low\n");
for (i=4; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal & 0xFFFFFFFD;
write_mem_dword(MEM_BASE_A addr_offset[i], gGpioLvValue);
}
printf("Read DO_1~4 value\n");
for (i=4; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_A addr_offset[i]);
gGpioLvValue = RetVal & 0x2;
printf("DO_%d = %d\n",i-3 ,gGpioLvValue > 0);
}
into_RL_mode();
return 0;
}