SLU0 / KLU0 Series Use r’s Manual
gGpioLvValue = RetVal & 0x2;
printf("DI_%d = %d\n",i+1 ,gGpioLvValue > 0);
}
into_RL_mode();
s ys tem ("paus e");
//Read the DO pin 1~4 value
into_PT_mode();
printf("Read DO_1~4 value\n");
for (i=0; i<4; i++)
{
RetVal = read_mem_dword(MEM_BASE_ADDRESS2 + addr_offset2[i]);
gGpioLvValue = RetVal & 0x1;
printf("DO_%d = %d\n",i ,gGpioLvValue > 0);
}
into_RL_mode();
s ys tem ("paus e");
//Write the DO pin 1~4 to High
into_PT_mode();
printf("Write DO_1~4 value to High\n");
for (i=4; i<8; i++)
{
RetVal = read_mem_dword(MEM_BASE_ADDRESS2 + addr_offset2[i]);
gGpioLvValue = RetVal | 0x1;
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_ADDRESS2 + addr_offset2[i]);
gGpioLvValue = RetVal & 0x1;
printf("DO_%d = %d\n",i ,gGpioLvValue > 0);
}
into_RL_mode();
s ys tem ("paus e");