I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods

Click Here!
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / I-Opener Areas / I-Opener Technical Info Reference (MODERATED)
LED lights C source code

New MessageLED lights C source code (modified 0 times) hardware1
Posted by Roastbeef on 04-02-2000 00:18:46 A.M.

/*
* leds.c - Example app to play with i-opener LEDs
* Released to the Public Domain
* - Roastbeef 04/01/2000
*/
#include "stdio.h"
#include "stdlib.h"

main()
{
char c;
int byebye=0;

printf("LEDS - Toggle those i-Opener lights");
printf("by Roastbeef");
printf("Press '1' to toggle the email LED");
printf("Press '2' to toggle the phone LED");
printf("Any other key exits.");

while (!byebye) {
if (kbhit()) {
switch(getch()) {
case '1':
c=inp(0x404C);
c=c^0x01;
outp(0x404C,c);
break;
case '2':
c=inp(0x404C);
c=c^0x02;
outp(0x404C,c);
break;
default:
byebye=1;
}
}
}
}

Posted by Roastbeef on 04-01-2000 05:26:44 P.M.

Let me tell you how to control those lovely LEDs at the top of your unit:

The short story: I/O port x'404C', bit 0 controls the Mail LED, bit 1 controls the Telephone LED. Inverse logic (i.e. bit=0 turns the LED on, bit=1 turns the LED off) Note that there are other important things being controlled by this register. Read/Modify bits 0&1/Write... don't trash the other bits or your machine *WILL* hang.

The long story: Find the Via686 ACPI device (bus 0, device 0, function 4, should be vendor=1106 device=3057). At offset x'48' in PCI config space is the Power Management I/O base address (DWORD). Read the value, AND off the lower 7 bits. This is the base address. The GPIO control is at offset x'4C' from this base address.
Ta da!
--Roastbeef

Posted by Roastbeef on 04-02-2000 03:37:30 P.M.

I've just discovered where the base address is programmed in the BIOS. It's hard coded... so nothing you add to the system should change the 404C address. Sweet!
--Roastbeef

04-05-2000 00:49:50

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3