PCM-37E12 Windows CE 5.0 Driver
Alpha Release Version 0.01
Introduction
Welcome to the first release of the Windows CE 5.0 driver for the PCM-37E12 PC/104 board from EMAC Inc. This document contains brief (for now anyway) instructions on how to begin testing and using the Windows CE port of the original Linux based 37E12 software suite.
Limitations
The current implementation of the CE version of the 37E12 driver is provided as a stream-interface driver. Resource requirements, such as the IRQ number and IO address, are described using the registry entries contained in the PC10437E12.reg file in the PC10437E12 project. These resources are then allocated using various CE functions, all of which are x86 centric. This approach will not work for XScale platforms that use a separate IDE controller chip, accessed through specialized registers in the XScale processor. Future versions of the driver will use a “bus agnostic” approach to allow the same driver to simultaneously support physical access to the 37E12 board attached to different host platform types (x86 and XScale based).
Directory Organization
Since this version is largely a port of the Linux version, the original directory structure has been retained for the CE version. The means that in some cases the same file can be built under both CE and Linux using the UNDER_CE compiler macro to select OS specific code. I was careful to avoid using a large number of #ifdef’s, however, so on many occasions it was necessary to start a new file exclusively for CE. In this case the file resides in a “wince” subdirectory under the location of the original file.
With regard to the CE driver itself, located in the .\pcm37e12\driver\wince directory, it was necessary to create an entirely separate driver. No source files from the CE stream-interface driver are shared with the corresponding Linux character mode driver.
Building the Drivers in Platform Builder
This release consists of three distinct modules, listed below:
- AtoD:
Located in .\pcm37e12\applications\wince\AtoD, this module provides a console application for testing the analog to digital capabilities of the 37E12 board. The primary source file for this application was adapted from the Linux version.
- PC10437E12:
Located in .\pcm37e12\driver\wince, this module contains an implementation of a CE stream-interface driver that provides low-level (non-packetized) I/O to the 37E12 board.
- E12Packet:
Located in .\pcm37e12\libraries\wince, this project contains an object module library for the parsing of received packets, and the composition of outgoing packets. It is based largely on the original Linux packet library.
Once you have built and successfully booted a CE kernel image for your target platform, you may extract the source tree from this release into the PBWorkspaces directory for your target platform. Once this is complete, navigate to each of the directories referenced above, and select the file with the extension .pbpxml using the Project | Insert | Existing Project option. This file provides a self contained description of the build requirements of each module, including registry entries, .BIB entries, and pre and post link requirements. The alternative method of building modules through the use of SOURCES and DIRS files is not used in this project. When there is a need to package individual projects, .pbpxml projects offer a more self contained solution.
Running the Sample Application
Once all of the projects have been inserted into your platform (using Platform Builder), build each module and verify that the build process proceeds without error. You may then attach the target device to get the kernel image loaded.
The AtoD sample application, included in this release, requires a target device with both a display and a keyboard. Load AtoD by running the program “cmd.exe” and typing “AtoD” on the command line. Then press the return key on the keyboard connected to the target platform. This will cause each of the 37E12 analog to digital channels to be read and the current digital values displayed. Pressing the return key again will repeat this process. Entering a “q” character before pressing the return key will cause the application to return to the console window command line.
Support for the Existing PCM-37E12 API
The functions prefixed with E12_ are used in the implementation of each of the sample applications provided in the Linux distribution of the 37E12 driver. These functions have been ported to CE and are included in the e12packet.lib object module library. In this release, only the AtoD sample application has been ported to CE, but with the availability of the E12_ supporting functions, future releases will include CE versions of the other applications.