Here is the latest release of the ActiveWireš driver and APIs. This archive is as follows: ReadMe - This file (that you are reading). ActiveWireš Driver - Place it in your extensions folder within your active System Folder. It is the driver proper. ActiveWireš.ppc.lib - A CodeWarrior Pro 3 Power PC library which implements the API (described below). You will link your application with this file. ActiveWireAPI.h - A C++ class which allows you to open one or more ActiveWireš boards and to control them. ActiveWireSamples - A folder containing CodeWarrior Pro 3 projects (source and executables) which demonstrate using the ActiveWireš USB board. The ActiveWireSamples folder contains: AWBlinkLed.ppc - A Power PC console application which blinks the LED (assuming an LED is connected as described on the Getting Started page which came with your board). AWBlinkLed.mpc - CodeWarrior Pro 3 project for the above applet. AWBoard1.ppc - A Power PC console application which will open the first board on your system and continuously writes a incrementing 16 bit value to the IO pins. AWBoard2.ppc - A Power PC console application which will open the second board on your system and continuously reads from the IO pins and displays the read back value to the console window. AWTwoBoards.mpc - CodeWarrior Pro 3 project for the above applets. The API is farily simple. There are a handful of public calls: Open, Close, Direction, Read and Write. The first thing to do is to construct (allocate) an ActiveWire object. This is done in C++ as: ActiveWire myBoard; // Allocate an ActiveWire object ActiveWire::Open ================ Then connect the objec to a board with the Open call. error = myBoard.Open (0); // Open board 0 If there is a problem in using the board (driver does not exist, board does not exist, board is already open by someone else, etc), the open call will return an error. Otherwise, noErr (value of 0) will be returned. ActiveWire::Direction ===================== Next, define which pins are input and which are output. This is done with a 16 bit mask. Bit 0 is for I/O 0 through Bit 15 for I/O 15. Bits set to a 1 are outputs. The I/O direction can be changed at any time. For exmaple: error = myBoard.Direction (0xFF00); // Upper 8 bits are output, lower 8 are input ActiveWire::Write ================= Now, you can write data to the pins with the Write method. You can write one or more 16 bit values in a single Write call. The maximum you can write in one call is 4,096 bytes (this will go away in the future). Examples: error = myBoard.Write ("\x12\x34", 2); // Write 16 bit value 0x1234 out error = myBoard.Write (buffer, 200); // Write one hundred 16 bit values out (200 bytes) ActiveWire::Read ================= Reading back from the I/O pins is done with the Read method. You can read one or more 16 bit values in a single Read call. The maximum you can read in one call is 4,096 bytes (this will go away in the future). Examples: error = myBoard.Read (buffer, 2); // Read one 16 bit value error = myBoard.Read (buffer, 200); // Read one hundred 16 bit values out (200 bytes) ActiveWire::Close ================= When you are done with a board, close it. This allows other programs to use it. A good habit is to set the IO pins to inputs before closing. This alleviates the problem of outputs being shorted when connecting new boards/ devices/cables to the header pins. error = myBoard.Close (); // Close the board Other Notes =========== Asynchronous I/O will be supported in a future release. If the board is unplugged while the driver is open (or during data transfer), the operation, and all subsequent operations will fail. An error will be reported for operation in progress and all subsequent operations. There is no way to plug the board back in and resume the connection with it. You have to close the board and re-open it. Data Types ========== The convention for data types are as follows: abyte = 8 bit signed value ahalf = 16 bit signed value aword = 32 bit signed value ABYTE = 8 bit unsigned value AHALF = 16 bit unsigned value AWORD = 32 bit unsigned value If you need help, please email us at techsupport@activewireinc.com. Eric Brewer 02-Feb-2000