Occasionally a customer will want a finer degree of control than provided by OmniDriver, our default production-strength device driver. Some OEM integrators don’t just want to control the spectrometer through the driver, they want to control every aspect of the driver itself.
For the ultimate hacker, we offer SeaBreeze, an open-source (MIT license) C/C device driver which lets you control every byte of data passing between your application and the spectrometer, from enumeration of the device descriptors up to the final endpoint flush. This is obviously not a trivial undertaking, and is recommended only for OEMs and K&R enthusiasts for whom the added edge in power and versatility is worth the extra investiture in time.
Here are some things which SeaBreeze can do, yet its beefier cousin OmniDriver would balk at:
- Is the driver missing a function you want? Feel free to add it.
- Does the driver have a bunch of bloat tied to spectrometer models you neither use nor care about? Rip it out.
- Want to change all API strings to Mandarin? Dive right in.
- Want to build on an ARM µC like Raspberry Pi, TI OMAP or Blackfin? Go ahead, we do it all the time.
- Want to trace every single byte exchanged at the USB level? Knock yourself out.
- Want to cross-compile to VxWorks or other RTOS? Should be a breeze, with existing support for GCC, LLVM, and Visual Studio built-in.
As you can see, the decision is ultimately up to you: are you the garage hacker looking for a developer toolkit, or do you prefer the shrink-wrapped commercial experience? Whichever your needs, Ocean drivers are here to float your boat.
The quickest way to get a feel for SeaBreeze is to browse the online documentation, but following is a quick overview.
Supported Platforms and Sample Code
SeaBreeze compiles out-of-the-box on Windows (XP, 7, 8.1), Linux and MacOS X. SeaBreeze itself represents 15KSLOC of C and C, with another 12KSLOC of sample code and supporting material.
It includes makefiles and solution files for GCC and Visual Studio 2005, 2010 and 2012. The Visual Studio solutions automatically build GUI installers for 32-bit and 64-bit Windows. On Windows SeaBreeze compiles to a DLL, on Linux an .so and on MacOS X a .dylib.
The distribution ships with built-in test applications (in C) to demonstrate basic functionality against connected spectrometers, as well as sample code (C, C , and C#) showing specifics of how to collect and graph spectra, access the raw USB API, marshall and demarshall OceanBinaryProtocol (OBP) message structures, juggle multiple spectrometers in different threads at different integration times, apply timeouts to blocking operations, and other common operations.
In its base distribution, SeaBreeze is able to control “most” features of “most” Ocean Optics spectrometers, with bindings for “many” languages on “virtually all” operating systems and platforms.
Why “most” and not “all”? Because if it supported every feature of every spectrometer, it would be indistinguishable from OmniDriver, its conceptual big brother. And for embedded environments, that means bloat: extra code size, extra load time, extra compile time, extra everything, the opposite of what most developers want on resource-constrained hardware.
What does “most” mean? That means SeaBreeze can enumerate and connect to all our best-selling spectrometers:
- NIRQuest (256/512)
On each of those spectrometers, it provides convenience functions to access the most essential command-and-control functions for basic spectroscopy tasks, including:
- read model and serial number
- read the number of pixels
- read wavelength calibration
- set integration time
- get spectra
- read the minimum supported integration time
- read the list of optically-masked (electrical dark) pixels
- set trigger mode
- set lamp/strobe enable
- configure continuous strobe timing
- read and write irradiance calibration
- control the thermal-electric cooler
- open and close integrated shutters
What doesn’t it do? Well, it can do just about anything, but you may have to put a bit more work into it. For instance, it doesn’t provide built-in functions to read the FPGA firmware version, read or set GPIO pins, set the Hardware Trigger Delay, or read the spectrometer’s internal PCB temperature. Happily, it does provide direct USB read/write functions, which you can use with each spectrometer’s data sheet to access and control every possible option supported by that hardware.