Gadgeteer

Device Driver Authoring Guide

Version 1.2

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being Appendix B, GNU Free Documentation License, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in Appendix B, GNU Free Documentation License.

$Date: 2007-06-30 07:24:39 -0500 (Sat, 30 Jun 2007) $


Table of Contents

I. Introduction
1. Overview of Gadgeteer
Goals of Gadgeteer
Goals for Device Driver Authors
Portability
Maintainability
Efficiency
Modularity
2. Using the VR Juggler Portable Runtime
Buffered I/O
Serial Ports
Sockets
Threads
Programmer Reference
II. Programming
3. Drivers and the Input Manager
Drivers as Input Manager Plug-Ins
Device Types
Analog
Command
Digital
Gesture
Glove
Position
Simulator
String
The Input Mixer
4. Device Driver Conventions
Separation of Code
5. Writing Device Drivers
Identifying the Device Type
Implementing the Standalone Device Driver
Implementing the Gadgeteer Wrapper Class
Choose the Base Class(es)
Driver Plug-in Entry Points
6. Compiling the Driver Plug-in
7. Driver Configuration
Configuring the Input Manager
Driver Configuration Definition File
Driver Configuration File
Writing Code that Accepts the Configuration
getElementType()
config()
III. Appendices
A. Complete Device Driver Code
Standalone Driver
Gadgeteer Wrapper
Makefile Templates
B. GNU Free Documentation License
PREAMBLE
APPLICABILITY AND DEFINITIONS
VERBATIM COPYING
COPYING IN QUANTITY
MODIFICATIONS
COMBINING DOCUMENTS
COLLECTIONS OF DOCUMENTS
AGGREGATION WITH INDEPENDENT WORKS
TRANSLATION
TERMINATION
FUTURE REVISIONS OF THIS LICENSE
ADDENDUM: How to use this License for your documents
Bibliography
Glossary of Terms
Index

List of Examples

5.1. Spawning a Non-Member Function Thread
5.2. Spawning a Static Member Function Thread
5.3. Spawning a Member Function Thread
5.4. Implementation of sample() Member Function
5.5. Implementation of updateData() Member Function
5.6. Implementation of getGadgeteerVersion() Entry Point Function
5.7. Implementation of initDevice() Entry Point Function
6.1. Example Makefile for Device Driver Plug-in
7.1. Example Input Manager Configuration
7.2. button_device.jdef: Configuration Definition File for Simple Button Device
7.3. button_device.jconf: Configuration File for Simple Button Device
7.4. Implementation of getElementType() Member Function
7.5. Implementation of config() Member Function
A.1. buttondevice.h
A.2. buttondevice.cpp
A.3. Makefile.in for Gadgeteer Build System
A.4. Makefile for Use Outside Gadgeteer Source Tree
A.5. Visual C++ Project for Use Outside Gadgeteer Source Tree