📄 lvbus.h
字号:
#ifndef ___LVBUS_H
#define ___LVBUS_H
#include <lvdef.h>
#ifdef __UNIX__
#define LVBUSAPI(x) x
#else
#ifdef _LVBUS_DLL
#define LVBUSAPI(x) __declspec(dllexport) x __stdcall
#else
#ifdef _MSC_VER
#define LVBUSAPI(x) x
#else
#define LVBUSAPI(x) x __stdcall
#endif
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
LVBUSAPI(U32BIT) LvBus_GetBusId(void);
LVBUSAPI(LVSTATUS) LvBus_EnumDevice(int Index, U32BIT *VendId, U32BIT *DevId, char *Desc, int SizeOfDesc);
LVBUSAPI(LVSTATUS) LvBus_ReadRegister(int Device, U32BIT Address, U32BIT Param, U32BIT *Val);
LVBUSAPI(LVSTATUS) LvBus_WriteRegister(int Device, U32BIT Address, U32BIT Param, U32BIT *Val);
LVBUSAPI(LVSTATUS) LvBus_GetSmoothDesc(int Index, char *Desc, int SizeOfDesc);
LVBUSAPI(LVSTATUS) LvBus_ReadBlockRegister(int Device, U32BIT Address, U32BIT Param, U32BIT *Val, U32BIT NrVal);
LVBUSAPI(LVSTATUS) LvBus_GetSensorDesc(int Index, char *Desc, int SizeOfDesc);
LVBUSAPI(LVSTATUS) LvBus_RxFile(int Device, char *RemoteFileName, char *LocalFileName);
LVBUSAPI(LVSTATUS) LvBus_TxFile(int Device, char *RemoteFileName, char *LocalFileName);
LVBUSAPI(LVSTATUS) LvBus_GetCapability(int Device, U32BIT *CapArray, int *CapArraySize);
#ifdef _MSC_VER
typedef U32BIT (__stdcall *FnLvBus_GetBusId)(void);
typedef LVSTATUS (__stdcall *FnLvBus_EnumDevice)(int Index, U32BIT *VendId, U32BIT *DevId, char *IpBuffer, int SizeOfIp);
typedef LVSTATUS (__stdcall *FnLvBus_ReadRegister)(int Device, U32BIT Address, U32BIT Param, U32BIT *Val);
typedef LVSTATUS (__stdcall *FnLvBus_WriteRegister)(int Device, U32BIT Address, U32BIT Param, U32BIT *Val);
typedef LVSTATUS (__stdcall *FnLvBus_GetSmoothDesc)(int Index, char *Desc, int SizeOfDesc);
typedef LVSTATUS (__stdcall *FnLvBus_ReadBlockRegister)(int Device, U32BIT Address, U32BIT Param, U32BIT *Val, U32BIT NrVal);
typedef LVSTATUS (__stdcall *FnLvBus_GetSensorDesc)(int Index, char *Desc, int SizeOfDesc);
typedef LVSTATUS (__stdcall *FnLvBus_RxFile)(int Device, char *RemoteFileName, char *LocalFileName);
typedef LVSTATUS (__stdcall *FnLvBus_TxFile)(int Device, char *RemoteFileName, char *LocalFileName);
typedef LVSTATUS (__stdcall *FnLvBus_GetCapability)(int Device, U32BIT *CapArray, int *CapArraySize);
#else
typedef LVBUSAPI(U32BIT) (*FnLvBus_GetBusId)(void);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_EnumDevice)(int Index, U32BIT *VendId, U32BIT *DevId, char *IpBuffer, int SizeOfIp);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_ReadRegister)(int Device, U32BIT Address, U32BIT Param, U32BIT *Val);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_WriteRegister)(int Device, U32BIT Address, U32BIT Param, U32BIT *Val);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_GetSmoothDesc)(int Index, char *Desc, int SizeOfDesc);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_ReadBlockRegister)(int Device, U32BIT Address, U32BIT Param, U32BIT *Val, U32BIT NrVal);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_GetSensorDesc)(int Index, char *Desc, int SizeOfDesc);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_RxFile)(int Device, char *RemoteFileName, char *LocalFileName);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_TxFile)(int Device, char *RemoteFileName, char *LocalFileName);
typedef LVBUSAPI(LVSTATUS) (*FnLvBus_GetCapability)(int Device, U32BIT *CapArray, int *CapArraySize);
#endif
typedef struct _tagLvBusInterface {
FnLvBus_GetBusId GetBusId;
FnLvBus_EnumDevice EnumDevice;
FnLvBus_ReadRegister ReadRegister;
FnLvBus_WriteRegister WriteRegister;
FnLvBus_GetSmoothDesc GetSmoothDesc;
FnLvBus_ReadBlockRegister ReadBlockRegister;
FnLvBus_GetSensorDesc GetSensorDesc;
FnLvBus_RxFile RxFile;
FnLvBus_TxFile TxFile;
FnLvBus_GetCapability GetCapability;
} LvBusInterface;
// ------------------------------------------------------------
// Image acquisition configuration
// Defines the properties of the acquisition from the camera.
typedef struct _tagLvBusAcquisition LvBusAcquisition;
typedef struct _tagLvBusImageInfo LvBusImageInfo;
typedef void (WINAPI* LvBusGrabCallbackFunction) (U32BIT ImgNr, U32BIT CurrentImgNr, void *ChanHandle, LvBusAcquisition *ImgCfg, LvBusImageInfo* ImgInfo);
typedef struct _tagLvBusTimeStamp {
U32BIT High;
U32BIT Low;
} LvBusTimeStamp;
typedef struct _tagLvBusImageInfo {
U32BIT Status;
U32BIT PixelType;
U32BIT SizeX;
U32BIT SizeY;
U32BIT OffsetX;
U32BIT OffsetY;
U32BIT SeqStatus;
LvBusTimeStamp TimeStamp;
U32BIT FrameNumber;
LVRAWPTR Reserved[4];
} LvBusImageInfo;
// acquisition mode (binning, partial, etc.)
typedef struct _tagLvBusAcqSize {
U32BIT Mode;
U32BIT Width;
U32BIT Height;
U32BIT Clock;
LVRAWPTR Reserved[4];
} LvBusAcqSize;
typedef struct _tagLvBusImgParam {
U32BIT StartX; // Image X origin in pixels
U32BIT StartY; // Image Y origin in lines
U32BIT Width; // Image X width in pixels
U32BIT Height; // Image Y width in lines
U32BIT LineIncrement; // Raw format=ImgWidth*PixelSize.
// Better implementations can use this value to avoid
// reformatting at app level.
U32BIT ColorFormat; // ColF_ definitions in dsydef.h
LVRAWPTR Reserved[4];
} LvBusImgParam;
// Network Parameter
typedef struct _tagLvBusNetwork {
// param==0 --> take default/ini-Entries
// param!=0 --> value is then param-1
U32BIT PktSize; // this packet size includes all headers (gvp/udp/ip) and can now be euqal the MTU
U32BIT PktDelay; // defines the delay between two packets
U32BIT FrameDelay;
U32BIT ChunkDelay;
LVRAWPTR Reserved[4];
} LvBusNetwork;
// Network Parameter
typedef struct _tagLvBusProcess {
LVRAWPTR UserParam; // Parameter for user app
LvBusGrabCallbackFunction GrabCallback; // Callback function.
LVRAWPTR Reserved[4];
} LvBusProcess;
typedef struct _tagLvBusMemory {
U32BIT NrBuffer; // Nr of acqusition buffers
U32BIT *LockTable;
U32BIT *CurrentFrame;
U8BIT *BaseMemPtr;
U32BIT BaseMemSize;
LVRAWPTR *LkBuffers;
LVRAWPTR Reserved[3];
} LvBusMemory;
typedef struct _tagLvBusAcquisition {
U32BIT Size; // Size of the structure. sizeof(LvBusAcquisition)+(NrBuffer-1)*sizeof(U8BIT *)
U32BIT Flags; // Flags and modifiers.
LVRAWPTR Reserved[4];
LvBusAcqSize AcqSize;
LvBusImgParam Img;
LvBusNetwork Net;
LvBusProcess Process;
LvBusMemory Mem;
// mst, 5.1.07: hold buffer offsets instead of fix buffer pointers, need this for buffer locking by driver
U32BIT BuffOff[1];
} LvBusAcquisition;
#ifdef __cplusplus
};
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -