
A-4
WDT, GPIO, DIO
MS-9A76
GPIO Sample Code
2.
General Purposed IO – GPIO/DIO
The GPIO port configuration addresses are listed in the following table:
Name
IO Port
IO address
Name
IO Port
IO address
N_GPI0
0xA05
Bit 7
N_GPO0
0xA05
Bit 3
N_GPI1
0xA05
Bit 2
N_GPO1
0xA05
Bit 4
N_GPI2
0xA05
Bit 1
N_GPO2
0xA05
Bit 5
N_GPI3
0xA05
Bit 0
N_GPO3
0xA05
Bit 6
2.1
Set output value of GPO
1.
Read the value from GPO port.
2.
Set the value of GPO address.
3.
Write the value back to GPO port.
Example:
Set
N_GPO0
output “high”
val = Inportb (
0xA05
);
// Read value from
N_GPO0
port.
val = val | (1<<
3
);
// Set
N_GPO0
address (bit 3) to 1 (output
“high”).
Outportb (
0xA05
, val);
// Write back to
N_GPO0
port.
Example:
Set
N_GPO1
output “low”
val = Inportb (
0xA05
);
// Read value from
N_GPO1
port.
val = val & (~(1<<
4
));
// Set
N_GPO1
address (bit 4) to 0 (output
“low”).
Outportb (
0xA05
, val);
// Write back to
N_GPO1
port.
2.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 = Inportb (
0xA05
);
// Read value from
N_GPI2
port.
val = val & (1<<
1
);
// Read
N_GPI2
address (bit 1).
if (val) printf (“Input of
N_GPI2
is High”);
else
printf (“Input of
N_GPI2
is Low”);
Summary of Contents for MS-9A76
Page 1: ...i MS 9A76 Industrial Data Machine ...
Page 8: ......
Page 20: ...1 12 Overview Block Diagram MS 9A76 Q170 C236 ...
Page 21: ...1 13 MS 9A76 Motherboard Jumpers JCMOS1 JAT1 JME1 JCOMP1 ...
Page 23: ...1 15 MS 9A76 Mechanical Overview 4 Slot SKU h h System Dimensions ...
Page 24: ...1 16 Overview h h System Dimensions with Wall Mount ...
Page 25: ...1 17 MS 9A76 h h PCI Express Card Dimensions ...
Page 26: ...1 18 Overview ...
Page 27: ...1 19 MS 9A76 h h PCI Card Dimensions ...
Page 28: ...1 20 Overview ...
Page 29: ...1 21 MS 9A76 Mechanical Overview 2 Slot SKU h h System Dimensions ...
Page 30: ...1 22 Overview h h System Dimensions with Wall Mount ...
Page 31: ...1 23 MS 9A76 h h PCI Express Card Dimensions ...
Page 32: ...1 24 Overview h h PCI Card Dimensions ...
Page 35: ...2 3 MS 9A76 4 Remove the top cover from the system ...
Page 45: ...2 13 MS 9A76 10 Route the cables through the cable routing clip ...
Page 51: ...2 19 MS 9A76 4 Connect the fan power connector to the motherboard ...
Page 54: ...2 22 Getting Started 4 Connect the fan power connector to the motherboard ...
Page 58: ......
Page 82: ......