Spinapi drivers for Linux
---------------

Table of Contents
-----------------
1. Overview
2. Linux Support

Overview:
=========

This archive contains a unified driver which will work for PB24, PBDDS-I, PBDDS-II, PBDDS-III, 
PulseBlasterESR, PulseBlasterESR-PRO, PulseBlasterESR-PRO-II and RadioProcessor boards. 
The included driver will function on
x86/x86_64/ARM Linux. Example programs which use spinapi are included for each 
supported model.

The contents of each directory is explained below:

spinapi_source - contains the source code for the spinapi library


Linux support:
==============

Spinapi can be used with Linux on x86/x86_64/ARM processors. To get your programs running on 
x86 Linux:

1. In the spinapi_source/ directory, type "make". You maybe required to provide permission as 
root. This will create a file called "libspinapi.a" which you can link your programs against to 
use SpinCore hardware. Note that if you want to compile for x86_64 or ARM, you need to copy the 
correct library file to the FTD2XX/Linux directory.  The library files are present in subdirectories
of the FTD2XX/Linux directory.
1.1 To install the library and header files to system paths, please run "make install" with root
privilege.

2. Install libusb
   Under debian based systems, run:
        sudo apt-get install libusb-dev

3. To compile your program, you must link with the spinapi, math, libdl, pthread, and usb libraries
(and sometimes rt).
 
For example, when compiling the "pb24_ex1.c" example program, you would use a command like (assuming 
both libspinapi.a and pb24_ex1.c are in the current directory):

    gcc -opb24_ex1 pb24_ex1.c -L. -lspinapi -lm -ldl -lusb -lpthread -lrt

This will create an executable called "pb24_ex1".

4. When running programs, you MUST have superuser privileges (i.e.: run as root). This is 
because the spinapi library needs to be able to gain access to the low-level hardware resources.
