
Appendix A
56
ECX-SLU0 / KLU0 Series Use r’s Manual
//DO_2: memory address 0xFDAE0468 bit0 //
//DO_3: memory address 0xFDAE0470 bit0 //
//DO_4: memory address 0xFDAE0478 bit0 //
// //
//==============================================================
======//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned long DWORD;
DWORD MEM_BASE_ADDRESS1 = 0xFDAC0000;
DWORD MEM_BASE_ADDRESS2 = 0xFDAE0000;
DWORD addr_offset1[4] = {0x4C0, //DI_1
0x4C8, //DI_2
0x4D0, //DI_3
0x4D8}; //DI_4
DWORD addr_offset2[4] = {0x460, //DO_1
0x468, //DO_2
0x470, //DO_3
0x478}; //DO_4
DWORD addr=0;
int main()
{
DWORD RetVal = 0;
DWORD gGpioLvValue = 0;
int
i=0;
//Read the DI pin 1~4 vaulue
into_PT_mode();//into the protect mode
printf("Read DI_1~4 value\n");
for (i=0; i<4; i++)
{
RetVal = read_mem_dword(MEM_BASE_AD addr_offset1[i]);