GPIO WDT BKL Programming
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 = Inportb (0xA02);
val = val & (1<<2);
if (val) printf ("Input of N_GPI2 is High");
else
Example: Get N_GPI6 input value.
val = SMBus_ReadByte (0x6E, 0x12);
val = val & (1<<1);
if (val) printf ("Input of N_GPI6 is High");
else
A-4
// Read value from N_GPI2 port.
// Read N_GPI2 address (bit 2).
printf ("Input of N_GPI2 is Low");
// Read value from N_GPI6 port through SMBus.
// Read N_GPI6 address (bit 1).
printf ("Input of N_GPI6 is Low");