PulseBlasterESR-PRO
Using C Functions to Program the PulseBlasterESR-PRO
A series of functions have been written to control the board and facilitate the construction of pulse
program instructions. It should be noted that the pb_inst C function accepts any delay value greater than 17
ns. Since the clock period is 3.3 ns for a 300 MHz clock, values which are not integer multiples of the clock
will be rounded to the closest integer multiple.
In order to use these functions, the DLL (spinapi.dll), the library file (libspinapi.a for MinGW, spinapilibgcc
for Borland, and spinapi.lib for MSVC), and the header file (spinapi.h), must be in the working directory of your
C compiler
int pb_init();
Initializes the PulseBlasterESR-PRO board. Needs to be called before calling any functions using the
device. It returns a 0 on success or a negative number on an error.
int pb_close();
Releases the PulseBlasterESR-PRO board. Needs to be called as last command in pulse program.
It returns a 0 on success or a negative number on an error.
void pb_core_clock(double clock_freq);
Used to set the clock frequency of the board. The variable
clock_frequency
is specified in MHz
when no units are entered. Valid units are MHz, kHz, and Hz. The default clock value is 400 MHz.
You only need to call this function if you are not using a 400 board.
int pb_start_programming(int device);
Used to initialize the system to receive programming information. It accepts a parameter referencing
the target for the instructions. The only valid value for
device
is PULSE_PROGRAM. It returns a 0 on
success or a negative number on an error.
2
These functions and library files have been generated and tested with MinGW (
www.mingw.com)
, Borland 5.5 (
www.borland.com)
, MS
Visual Studio 2003 (msdn.microsoft.com) compilers.
2019/09/26