This is a brief overview of how to get a USB device driver written as rapidly as possible. Simtec Electronics have provided an example HID driver which can be used as a basis for other 3rd party proprietary module drivers and a radio application which may be used as a basis for application drivers. The terms of license are fairly broad. Simtec Electronics will not claim any interest in derivative works from this example code. Copyright is retained on the original driver source and Simtec Electronics reserve the right to develop this code as we see fit. While every precaution has been taken by Simtec Electronics to ensure the example code is as bug free as possible, no responsibility will be accepted for errors or omissions or consequential damages.
Probably the easiest to use and most tested interface is the C API. All our examples will use this API although all functionality is available through a set of SWI calls and drivers can be written in any language required. The provided RISC OS USB C API is intended for use with a C compiler. Acorn C compiler (tested with version 5.06) may be used to produce both application and module type driver. Current limitations at this time mean GCC cannot be used to produce module drivers.
The C library is provided as a set of header files and several AOF binary library files. These link objects have been compiled with both module and application link options and for debug and non-debug versions. In addition there are two further options, either fastlib or stdlib. These options are an attempt to reduce the calling overhead of function calls that ordinarily pass through the SWI vector a "fast call" method has been provided, to use this "fast call" all that is required is to ensure the USB library initialise is called (must be done in any case) and link against either the stdlib for SWI based calling or the fastlib for direct calling.