65
val=0;
addr=
0xE0690810
;
GetPhysLong((PBYTE)
addr, &val);
// Read value from
N_GPO1
port.
val = val & (DWORD)(~(1
<<
0)
);;
// Set
N_GPO1
address (bit 0) to 0
(output “low”).
SetPhysLong((PBYTE)addr, val);
// Write back to
N_GPO1
port.
4.1.2 Read input value from GPI
1.
Read the value from GPI port.
2.
Get the value of GPI address.
Example:
Get
N_GPI2
input value.
val=0;
GetPhysLong((PBYTE)
0xE0690860
, &val);
// Read value from
N_GPI2
port.
val =
val & (DWORD)(1
<<
1
)) != 0
// Read
N_GPI2
address (bit 1).
if (val)
printf (“Input of
N_GPI2
is High”);
else
printf (“Input of
N_GPI2
is Low”);
4.2 WDT Sample Code
The base address (WDT_BASE) of WDT configuration registers is
0xA10.
4.2.1 Set WDT Time Unit
val = Inportb (WD 0x05);
// Read current WDT setting
val = val | 0x08;
// minute mode. val = val & 0xF7 if second mode
Outportb (WD 0x05, val);
// Write back WDT setting
4.2.2 Set WDT Time
Outportb (WD 0x06,
Time
);
// Write WDT time, value 1 to 255.
4.2.3 Enable WDT
val = Inportb (WD 0x0A);
// Read current WDT_PME setting
val = val | 0x01;
// Enable WDT OUT: WDOUT_EN (bit 0) set to 1.
Summary of Contents for MX610H
Page 17: ...17 1 5 3 Mainboard Layout Back Panel...
Page 22: ...22 1 6 1 Installing CPU...
Page 23: ...23...