MSI MS-C903 User Manual page 61

Industrial data machine
Table of Contents

Advertisement

Example: Set N_GPO1 output "low"
val = SMBus_ReadByte (0x6E, 0x11);
val = val & (~(1<<5));
SMBus_WriteByte (0x6E, 0x11, val);
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 = SMBus_ReadByte (0x6E, 0x22);
val = val & (1<<6);
if (val)
printf ("Input of N_GPI2 is High");
printf ("Input of N_GPI2 is Low");
else
Example: Get N_GPI3 input value.
val = SMBus_ReadByte (0x6E, 0x22);
val = val & (1<<7);
if (val)
printf ("Input of N_GPI3 is High");
printf ("Input of N_GPI3 is Low");
else
// Read value from N_GPO1 port through SMBus..
// Set N_GPO1 address (bit 5) to 0 (output "low").
// Write back to N_GPO1 port through SMBus.
// Read value from N_GPI2 port through SMBus.
// Read N_GPI2 address (bit 6).
// Read value from N_GPI3 port through SMBus.
// Read N_GPI3 address (bit 7).
GPIO WDT BKL SMBus Programming
61

Advertisement

Table of Contents
loading

Table of Contents