All Forums
 Microsoft Windows CE
 CE Drivers
 BitsyX LED Driver (Sample Stream Interface Driver)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 26 Feb 2004 :  16:55:00  Show Profile  Email Poster
LED.dll


This is a sample stream interface driver for controlling the LED on the ADS BitsyX system. By using port name "LED1:" you can control the LED.

This driver has several features:
  • The LED state can be set or read
  • An IOCTL for starting/stopping a heartbeat (periodic blink)
  • An IOCTL allowing you to "blink" any number, by counting LED flashes
  • Easy driver initialization using regsvrce.exe (see notes in LED.CPP for details)

    Note: This driver only controls the LED on the BitsyX itself. The LED on ADS personality boards is a charge indicator for the battery charging circuit and is not controllable from software.

To initialize the driver, simply copy LED.dll to your device's \Windows folder and then run "regsvrce.exe LED.dll" from the Run dialog. (regsvrce.exe is included in the zip file for your convenience).

Key APIs Used

VirtualAlloc
VirtualCopy
ReadFile
WriteFile
DeviceIoControl
CreateFile
RegCreateKey
RegSetValue

Lines of Code: 428


Source Download
Rev 1 (15k zip).

ctacke

877 Posts

Posted - 12 Aug 2008 :  17:59:42  Show Profile  Email Poster
There's a bug in the source code. LED.cpp line 541 reads:

ret = RegSetValueEx(key, _T("Prefix"), 0, REG_SZ, buffer, (_tcslen(DRIVER_LIBRARY) + 1) * sizeof(TCHAR));


and it should read:


ret = RegSetValueEx(key, _T("Prefix"), 0, REG_SZ, buffer, (_tcslen(DRIVER_PREFIX) + 1) * sizeof(TCHAR));

Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000