OpenScanDeviceLib
OpenScan Device Programming Interface
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
OpenScanDeviceLib.h File Reference

Public header for OpenScanDeviceLib. More...

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for OpenScanDeviceLib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  OScDev_DeviceImpl
 
struct  OScDev_ModuleImpl
 The module implementation function table. More...
 
struct  OScDev_SettingImpl
 
struct  OScDevInternal_Interface
 Interface function table for module to call OpenScanLib. More...
 

Macros

#define OScDev_API   static inline
 
#define OScDev_CHECK(err, call)   ((err = (call)) != OScDev_OK)
 Convenience macro for checking error return values. More...
 
#define OScDev_MAX_STR_LEN   (OScDev_MAX_STR_SIZE - 1)
 Maximum length for strings copied to provided buffer.
 
#define OScDev_MAX_STR_SIZE   512
 Buffer size for fixed-length strings.
 
#define OScDev_MODULE_IMPL   OScDev_ModuleImpl OScDevInternal_TheModuleImpl
 Define the device module implementation. More...
 
#define OScDev_RichError_OK   ((OScDev_RichError *)NULL)
 
#define OScDevInternal_ABI_VERSION   OScDevInternal_MAKE_VERSION(13, 0)
 Binary interface version between device module and OpenScanLib. More...
 
#define OScDevInternal_MAKE_VERSION(major, minor)    (((uint32_t)(major) << 16) | (uint16_t)(minor))
 Create an ABI version number. More...
 

Typedefs

typedef struct OScInternal_AcquisitionForDevice OScDev_Acquisition
 
typedef int32_t OScDev_ClockSource
 
typedef struct OScInternal_Device OScDev_Device
 
typedef struct OScDev_DeviceImpl OScDev_DeviceImpl
 
typedef int32_t OScDev_Error
 Error return value. More...
 
typedef int32_t OScDev_ErrorCodeFormat
 
typedef int32_t OScDev_LogLevel
 Log level.
 
typedef struct OScDev_ModuleImpl OScDev_ModuleImpl
 
typedef struct OScInternal_NumArray OScDev_NumArray
 Dynamic or static array of numbers. More...
 
typedef struct OScInternal_NumRange OScDev_NumRange
 Continuous or discrete numerical range. More...
 
typedef struct OScInternal_PtrArray OScDev_PtrArray
 Dynamic or static array of pointers. More...
 
typedef struct RERR_Error OScDev_RichError
 
typedef struct OScInternal_Setting OScDev_Setting
 
typedef struct OScDev_SettingImpl OScDev_SettingImpl
 
typedef int32_t OScDev_TriggerSource
 
typedef int32_t OScDev_ValueConstraint
 
typedef int32_t OScDev_ValueType
 

Enumerations

enum  { OScDev_LogLevel_Debug , OScDev_LogLevel_Info , OScDev_LogLevel_Warning , OScDev_LogLevel_Error }
 Constants for OScDev_LogLevel.
 
enum  {
  OScDev_ErrorCodeFormat_I32 = 1 , OScDev_ErrorCodeFormat_U32 = 2 , OScDev_ErrorCodeFormat_Hex32 = 4 , OScDev_ErrorCodeFormat_I16 = 8 ,
  OScDev_ErrorCodeFormat_U16 = 16 , OScDev_ErrorCodeFormat_Hex16 , OScDev_ErrorCodeFormat_HexNoPad = 1 << 31
}
 
enum  {
  OScDev_OK = 0 , OScDev_Error_Unknown = 10000 , OScDev_Error_Unsupported_Operation , OScDev_Error_Illegal_Argument ,
  OScDev_Error_Device_Module_Already_Exists , OScDev_Error_No_Such_Device_Module , OScDev_Error_Driver_Not_Available , OScDev_Error_Device_Already_Open ,
  OScDev_Error_Device_Not_Opened_For_LSM , OScDev_Error_Device_Does_Not_Support_Clock , OScDev_Error_Device_Does_Not_Support_Scanner , OScDev_Error_Device_Does_Not_Support_Detector ,
  OScDev_Error_Wrong_Value_Type , OScDev_Error_Setting_Not_Writable , OScDev_Error_Wrong_Constraint_Type , OScDev_Error_Unknown_Enum_Value_Name ,
  OScDev_Error_Acquisition_Running , OScDev_Error_Not_Armed , OScDev_Error_Waveform_Out_Of_Range , OScDev_Error_Waveform_Memory_Size_Mismatch ,
  OScDev_Error_Data_Left_In_Fifo_After_Reading_Image
}
 
enum  { OScDev_TriggerSource_Software , OScDev_TriggerSource_External }
 
enum  { OScDev_ClockSource_Internal , OScDev_ClockSource_External }
 
enum  {
  OScDev_ValueType_String , OScDev_ValueType_Bool , OScDev_ValueType_Int32 , OScDev_ValueType_Float64 ,
  OScDev_ValueType_Enum
}
 
enum  { OScDev_ValueConstraint_None , OScDev_ValueConstraint_DiscreteValues , OScDev_ValueConstraint_Range }
 

Functions

bool OScDev_Acquisition_CallFrameCallback (OScDev_Acquisition *acq, uint32_t channel, void *pixels)
 Send acquired data for one channel of a frame. More...
 
OScDev_Error OScDev_Acquisition_GetClockSource (OScDev_Acquisition *acq, OScDev_ClockSource *clock)
 Determine the scanner and detector clock source for the given acquisition. More...
 
OScDev_Error OScDev_Acquisition_GetClockStartTriggerSource (OScDev_Acquisition *acq, OScDev_TriggerSource *startTrigger)
 Determine the start trigger source for the clock for the given acquisition. More...
 
uint32_t OScDev_Acquisition_GetNumberOfFrames (OScDev_Acquisition *acq)
 Determine the requested number of frames for the given acquisition.
 
double OScDev_Acquisition_GetPixelRate (OScDev_Acquisition *acq)
 
uint32_t OScDev_Acquisition_GetResolution (OScDev_Acquisition *acq)
 
void OScDev_Acquisition_GetROI (OScDev_Acquisition *acq, uint32_t *xOffset, uint32_t *yOffset, uint32_t *width, uint32_t *height)
 
double OScDev_Acquisition_GetZoomFactor (OScDev_Acquisition *acq)
 
OScDev_Error OScDev_Acquisition_IsClockRequested (OScDev_Acquisition *acq, bool *isRequested)
 
OScDev_Error OScDev_Acquisition_IsDetectorRequested (OScDev_Acquisition *acq, bool *isRequested)
 
OScDev_Error OScDev_Acquisition_IsScannerRequested (OScDev_Acquisition *acq, bool *isRequested)
 
OScDev_Error OScDev_Device_Create (OScDev_Device **device, OScDev_DeviceImpl *impl, void *data)
 
void * OScDev_Device_GetImplData (OScDev_Device *device)
 
OScDev_RichError * OScDev_Error_AsRichError (OScDev_Error code)
 
OScDev_RichError * OScDev_Error_Create (const char *message)
 
OScDev_RichError * OScDev_Error_CreateWithCode (const char *domainName, int32_t code, const char *message)
 
void OScDev_Error_Destroy (OScDev_RichError *error)
 
void OScDev_Error_Format (OScDev_RichError *error, char *buffer, size_t bufsize)
 
void OScDev_Error_FormatRecursive (OScDev_RichError *error, char *buffer, size_t bufsize)
 
OScDev_RichError * OScDev_Error_GetCause (OScDev_RichError *error)
 
int32_t OScDev_Error_GetCode (OScDev_RichError *error)
 
const char * OScDev_Error_GetDomain (OScDev_RichError *error)
 
const char * OScDev_Error_GetMessage (OScDev_RichError *error)
 
OScDev_RichError * OScDev_Error_RegisterCodeDomain (const char *domainName, OScDev_ErrorCodeFormat codeFormat)
 
OScDev_Error OScDev_Error_ReturnAsCode (OScDev_RichError *error)
 
OScDev_RichError * OScDev_Error_Wrap (OScDev_RichError *cause, const char *message)
 
OScDev_RichError * OScDev_Error_WrapWithCode (OScDev_RichError *cause, const char *domainName, int32_t code, const char *message)
 
void OScDev_Log (OScDev_Device *device, OScDev_LogLevel level, const char *message)
 Log a message.
 
void OScDev_Log_Debug (OScDev_Device *device, const char *message)
 Log a debug-level message.
 
void OScDev_Log_Error (OScDev_Device *device, const char *message)
 Log an error-level message.
 
void OScDev_Log_Info (OScDev_Device *device, const char *message)
 Log an info-level message.
 
void OScDev_Log_Warning (OScDev_Device *device, const char *message)
 Log a warning-level message.
 
void OScDev_NumArray_Append (OScDev_NumArray *arr, double val)
 Append a value to an array.
 
double OScDev_NumArray_At (const OScDev_NumArray *arr, size_t index)
 
OScDev_NumArrayOScDev_NumArray_Create (void)
 Create an array of numbers.
 
OScDev_NumArrayOScDev_NumArray_CreateFromNaNTerminated (const double *nanTerminatedArray)
 
void OScDev_NumArray_Destroy (const OScDev_NumArray *arr)
 Destroy (free) an array of numbers.
 
bool OScDev_NumArray_Empty (const OScDev_NumArray *arr)
 
size_t OScDev_NumArray_Size (const OScDev_NumArray *arr)
 
void OScDev_NumRange_AppendDiscrete (OScDev_NumRange *range, double value)
 
OScDev_NumRangeOScDev_NumRange_CreateContinuous (double rMin, double rMax)
 
OScDev_NumRangeOScDev_NumRange_CreateDiscrete (void)
 
OScDev_NumRangeOScDev_NumRange_CreateDiscreteFromNaNTerminated (const double *nanTerminatedArray)
 
void OScDev_NumRange_Destroy (const OScDev_NumRange *range)
 
void OScDev_PtrArray_Append (OScDev_PtrArray *arr, void *obj)
 Append an object to an array.
 
void * OScDev_PtrArray_At (const OScDev_PtrArray *arr, size_t index)
 
OScDev_PtrArrayOScDev_PtrArray_Create (void)
 Create an array of objects.
 
OScDev_PtrArrayOScDev_PtrArray_CreateFromNullTerminated (void *const *nullTerminatedArray)
 
void OScDev_PtrArray_Destroy (const OScDev_PtrArray *arr)
 Destroy (free) an array of objects.
 
bool OScDev_PtrArray_Empty (const OScDev_PtrArray *arr)
 
size_t OScDev_PtrArray_Size (const OScDev_PtrArray *arr)
 
OScDev_Error OScDev_Setting_Create (OScDev_Setting **setting, const char *name, OScDev_ValueType valueType, OScDev_SettingImpl *impl, void *data)
 
void OScDev_Setting_Destroy (OScDev_Setting *setting)
 
void * OScDev_Setting_GetImplData (OScDev_Setting *setting)
 

Variables

struct OScDevInternal_InterfaceOScDevInternal_FunctionTable
 Pointer to the interface function table provided by OpenScanLib.
 
OScDev_ModuleImpl OScDevInternal_TheModuleImpl
 Pointer to the module implementation provided by the device module. More...
 

Detailed Description

Public header for OpenScanDeviceLib.

This header is to be included by modules implementing OpenScan devices.

Definition in file OpenScanDeviceLib.h.