TME-104P-CSR-LX800-R1V5.doc
Rev 1.5
38 (44)
4.3
LIVE LED Programming
The LIVE LED can be programmed by users. Die cathode of the mounted LED is connected to a GPIO
pin of the Super I/O. If the input has ground potential the LED is on.
The Live-LED (red) can be controlled with bit 0 of I/O port 1220h (SIO GP10). The BIOS signals with
it that the POST is in progress. After that, the LED may be freely used by any application program.
The following program chances the state of the LIVE LED.
#include <stdio.h>
#include <sys/io.h>
#define PORT 0x1220
int main()
{
unsigned char DATA, LED;
iopl(3);
LED = inb(PORT) && 0x01; //Mask the BIT 0 of GPIO1x bank
DATA = inb(PORT);
if(LED == 0x01)
{
printf("\nLIVE LED was OFF\n");
outb(DATA - 1, PORT);
printf("...");
sleep(2);
printf("\nSwitched it ON\n");
}
else
{
printf("\nLIVE LED was ON\n");
outb(DATA + 1, PORT);
printf("...");
sleep(2);
printf("\nSwitched it OFF\n");
}
iopl(0);
return 0;
}