Live Led Programming - Lippert 702-0008-10 Technical Manual

Cool literunner pc/104 cpu board
Table of Contents

Advertisement

4.4 LIVE LED Programming

The LIVE LED can be programmed by users. The 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.
That pin is set as simple I/O and can be easily reached over the port address.
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;
}
TME-104-CLR-LX800-R1V3.doc
Rev. 1.3
46(53)

Advertisement

Table of Contents
loading

This manual is also suitable for:

802-0008-10Clr-lx800902-0008-10

Table of Contents