All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - EIOTest.exe (BitsyPlus EIO: Driver sample)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 26 Feb 2003 :  15:13:19  Show Profile  Email Poster
EIOTest.exe


EIOTest.exe demonstrates the use of the Extended IO (EIO) WinCE Port of the ADS BitsyPlus.

The EIO can be controlled bitwise, each having a state (1=high, 0=low) and a direction (1=output, 0=input). EIOTest opens the port, sets half of the bits as inputs, half as outputs, then writes a test pattern across all lines.

EIO Read/Write Tests

EIOWriteTest and EIOReadTest are useful for testing the digital I/Os without a display. EIOWriteTest runs a walking-ones test on the EIOn outputs and reports stuck bits, while EIOReadTest simply reads from the ports. Both display output on the debug port.

Sample output from EIOWriteTest:
EIOWriteTest 720020-11561:
Runs walking-ones test on EIO outputs.
Bit #: 9 8 7 6 5 4 3 2 1 0
/ 0 0 0 0 0 0 0 0 1 0 (out=0x002)

Key APIs Used

CreateFile
WriteFile
ReadFile
DeviceIoControl

Lines of Code: 239


Source Download
EIOTest, Rev. 1 - 26feb03 (14k zip)
EIOReadTest, Rev. 1 - 28aug03 (52k zip)
EIOWriteTest, Rev. 1 - 29aug03 (14k zip)


modified March 31, 02 (ctacke) - added key APIs and LOC
Edited by akidder 29-Aug-2003: Add EIOReadTest and EIOWriteTest.

akidder

1519 Posts

Posted - 11 Mar 2003 :  13:59:23  Show Profile  Email Poster
Here's a quick overview of how to use the EIO1: driver (set/get the direction mask, read/write port):


// Open the driver
HANDLE hEIO = CreateFile( TEXT("EIO1:"),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
//
// Set direction mask so bits 0-3 are outputs, others are inputs
//
DWORD NumberOfBytes;
DWORD mask = 0x000F;
DeviceIoControl ( hEIO,
IOCTL_EIO_CONFIG_PORTS,
&mask,
sizeof(DWORD),
NULL,
0,
&NumberOfBytes,
NULL );
//
// Read the direction mask currently set
//
DeviceIoControl ( hEIO,
IOCTL_EIO_READ_CONFIG,
NULL,
0,
&mask,
sizeof(DWORD),
&NumberOfBytes,
NULL );
//
// Write to the port
//
DWORD state = 0x0000; // all off
WriteFile(hEIO, &state, sizeof(DWORD), &NumberOfBytes, NULL))
//
//
// Read from the port
//
ReadFile(hEIO, state, sizeof(DWORD), &NumberOfBytes, NULL))

Go to Top of Page

akidder

1519 Posts

Posted - 29 Aug 2003 :  12:43:07  Show Profile  Email Poster
EIOn Test Apps

We've added two test applications for the Bitsy Plus EIOn digital I/Os. See above for descriptions.
Go to Top of Page

ctacke

877 Posts

Posted - 09 Sep 2003 :  11:41:55  Show Profile  Email Poster
For an analogous sample for the BitsyX, see Topic 1133
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.03 seconds. Snitz Forums 2000