13#ifndef _MIG_GRABBER_H_
14#define _MIG_GRABBER_H_
18#define MIG_PARAM_VIDEO_FMT 1
19#define MIG_PARAM_PIXEL_ORDER 2
20#define MIG_PARAM_HOR_RES 3
21#define MIG_PARAM_VER_RES 4
22#define MIG_PARAM_BITS_PER_PIXEL 5
23#define MIG_PARAM_SRC_BITS_PER_PIXEL 6
24#define MIG_PARAM_HOR_BACK_PORCH 7
25#define MIG_PARAM_HOR_FRONT_PORCH 8
26#define MIG_PARAM_VER_BACK_PORCH 9
27#define MIG_PARAM_VER_FRONT_PORCH 10
29#define MIG_PARAM_I2C_SLAVE_ADDR 11
30#define MIG_PARAM_I2C_ADDR_TYPE_WORD 12
31#define MIG_PARAM_I2C_DATA_TYPE_WORD 13
32#define MIG_PARAM_I2C_CHECK_ACK 14
33#define MIG_PARAM_I2C_REPEAT_START 15
34#define MIG_PARAM_I2C_SPEED_KHZ 16
36#define MIG_PARAM_FLIP_IMAGE 20
37#define MIG_PARAM_CHK_CAM_READY_SIG 21
38#define MIG_PARAM_DESERIALIZER_SEL 22
39#define MIG_PARAM_UPDATE_ENCODER_USE 23
41#define MIG_PARAM_BOARD_VERSION_FW 31
42#define MIG_PARAM_BOARD_VERSION_FPGA 32
44#define MIG_PARAM_BOARD_USB_RESET 33
46#define MIG_PARAM_FMODEL_NO 41
48#define MIG_PARAM_ENABLE_ENCODER_COUNT 51
50#define MIG_PARAM_BOARD_PRESET 61
51#define MIG_PARAM_MIPI_LANE_SET 62
52#define MIG_PARAM_MIPI_VIRTUAL_CH_SEL 63
56#define MIG_PARAM_GPIO_1 71
57#define MIG_PARAM_GPIO_2 72
58#define MIG_PARAM_GPIO_3 73
59#define MIG_PARAM_GPIO_4 74
60#define MIG_PARAM_GPIO_5 75
61#define MIG_PARAM_GPIO_6 76
62#define MIG_PARAM_GPIO_7 77
92typedef void* MIG_HANDLE;
93typedef void* MIG_PMSG;
128typedef void (__stdcall* _CbTerminalLog)(
int BoardId,
wchar_t* pLog);
132 typedef int (__stdcall* _SetCbTerminalLog)(
int BoardId, _CbTerminalLog fn);
133 typedef int (__stdcall* _GetMigSdkVersion)();
135 typedef int (__stdcall* _EnumerateBoard)(
_BOARD_LIST* pDest);
136 typedef int (__stdcall* _GetNumOfBoard)();
137 typedef int (__stdcall* _GetBoardId)(
int nUsbIndex);
138 typedef void (__stdcall* _GetErrStr)(
int nErrCode,
char* pBuff,
int sizeBuff);
139 typedef int (__stdcall* _SetParamInt)(
int BoardId,
int type,
int val);
140 typedef int (__stdcall* _GetParamInt)(
int BoardId,
int type);
141 typedef int (__stdcall* _SetParamDouble)(
int BoardId,
int type,
double val);
142 typedef double (__stdcall* _GetParamDouble)(
int BoardId,
int type);
143 typedef int (__stdcall* _OpenGrabber)(
int BoardId,
int nGrabberType, MIG_HANDLE hwndParent);
144 typedef void (__stdcall* _SetConfigPathName)(
int BoardId,
const char* pConfigFilePath);
145 typedef int (__stdcall* _CloseGrabber)(
int BoardId);
146 typedef BOOL (__stdcall* _IsGrabberOpened)(
int BoardId);
147 typedef int (__stdcall* _GetGrabberType)(
int BoardId);
149 typedef int (__stdcall* _GetSerialNo)(
int BoardId,
char* pSn,
int sizeSN);
150 typedef BOOL (__stdcall* _IsVirtual)(
int BoardId);
151 typedef int (__stdcall* _SetVideoConf)(
int BoardId,
_MIG_VIDEO_CONF* pConf);
152 typedef int (__stdcall* _SetI2cConf)(
int BoardId,
_MIG_I2C_CONF* pConf);
154 typedef int (__stdcall* _Grab)(
int BoardId,
int nNbImage, DWORD dwTimeOut_ms);
155 typedef int (__stdcall* _GrabContinuous)(
int BoardId);
156 typedef BOOL (__stdcall* _GrabInProgress)(
int BoardId);
157 typedef int (__stdcall* _HaltGrab)(
int BoardId);
158 typedef int (__stdcall* _WaitForFrameDone)(
int BoardId, DWORD dwTimeOut_ms);
159 typedef int (__stdcall* _GetSrcBitsPerPixel)(
int BoardId);
160 typedef int (__stdcall* _GetBytesPerPixel)(
int BoardId);
161 typedef int (__stdcall* _GetImageSizeBytes)(
int BoardId);
162 typedef int (__stdcall* _GetImage)(
int BoardId,
unsigned char* pDstBuffer,
int dstWidth,
int dstHeight,
int dstPitchBytes);
163 typedef BOOL (__stdcall* _PutImage)(
int BoardId,
unsigned char* pSrcBuffer,
int srcWidth,
int srcHeight,
int srcPitchBytes);
164 typedef int (__stdcall* _ImportImage)(
int BoardId,
const char* pPathName);
165 typedef int (__stdcall* _ExportImage)(
int BoardId,
const char* pPathName);
166 typedef int (__stdcall* _RegisterEvent)(
int BoardId, MIG_HANDLE hEv,
int nMigEvent);
167 typedef void (__stdcall* _UnregisterEvent)(
int BoardId,
int nMigEvent);
169 typedef int (__stdcall* _i2cRead)(
int BoardId,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
170 typedef int (__stdcall* _i2cWrite)(
int BoardId,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
171 typedef int (__stdcall* _i2cR)(
int BoardId,
unsigned char slave,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
172 typedef int (__stdcall* _i2cW)(
int BoardId,
unsigned char slave,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
174 typedef int (__stdcall* _i2c2_R)(
int BoardId,
unsigned char slave,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
175 typedef int (__stdcall* _i2c2_W)(
int BoardId,
unsigned char slave,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
177 typedef int (__stdcall* _bulk_i2cReset)(
int BoardId);
178 typedef int (__stdcall* _bulk_i2cSet)(
int BoardId,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
179 typedef int (__stdcall* _bulk_i2cSetDelay)(
int BoardId, WORD wDelay_ms);
180 typedef int (__stdcall* _bulk_i2cRun)(
int BoardId);
181 typedef int (__stdcall* _pwrSetMode)(
int BoardId,
int mode);
182 typedef int (__stdcall* _pwrReset)(
int BoardId);
183 typedef int (__stdcall* _pwrGetNumOfChannel)(
int BoardId);
184 typedef int (__stdcall* _pwrGetMinVoltage)(
int BoardId,
int nPwrChannel,
int* pnMinVoltage_mV);
185 typedef int (__stdcall* _pwrGetMaxVoltage)(
int BoardId,
int nPwrChannel,
int* pnMaxVoltage_mV);
186 typedef int (__stdcall* _pwrGetMaxCurrent)(
int BoardId,
int nPwrChannel,
int* pnMaxCurrent_mA);
187 typedef BOOL (__stdcall* _pwrIsPowerOn)(
int BoardId);
188 typedef int (__stdcall* _pwrPowerOff)(
int BoardId,
int nPwrChannel);
189 typedef int (__stdcall* _pwrPowerOffAll)(
int BoardId);
190 typedef int (__stdcall* _pwrSetVoltage)(
int BoardId,
int nPwrChannel,
const int nPwrLevel_mV);
191 typedef int (__stdcall* _pwrMeasureVoltage)(
int BoardId,
int nPwrChannel,
int* pPwrResult_mV);
192 typedef int (__stdcall* _pwrMeasureCurrent)(
int BoardId,
int nPwrChannel,
int* pPwrResult_mA);
193 typedef int (__stdcall* _pwrMeasureOS)(
int BoardId,
int nPwrChannel,
int* pPwrResult_mV);
194 typedef int (__stdcall* _pwrSetCurrentRange)(
int BoardId,
int nPwrChannel,
const int nCurrentRange);
196 typedef int (__stdcall* _subPwrSetType)(
int BoardId,
int nSubType);
197 typedef int (__stdcall* _subPwrSetVoltage)(
int BoardId,
int nSubType,
int nPwrChannel,
int nPwrLevel_mV);
198 typedef int (__stdcall* _WriteRegisterSet)(
int BoardId,
const char* pFile,
const char* pSection,
int* pnErrorIndex);
199 typedef int (__stdcall* _ReadSyncCount)(
int BoardId, DWORD dwTimeOut_ms,
int* pDestHsync,
int* pDestVsync, ULONG* pDestPClk_Hz);
200 typedef int (__stdcall* _GetFrameRate)(
int BoardId,
int nFpsType,
float* pfFrameRate);
201 typedef int (__stdcall* _GetFrameDataRate)(
int BoardId,
double* pdDataRate_bps);
202 typedef int (__stdcall* _GetMotorCounter)(
int BoardId, DWORD* pDest);
204 typedef BOOL (__stdcall* _IsDebug)(
int BoardId);
205 typedef void (__stdcall* _SetDebug)(
int BoardId, BOOL bDebug);
206 typedef int (__stdcall* _ExpCommand)(
int BoardId, DWORD wCmd, int64_t pParam1, int64_t pParam2);
245extern void GetErrStr(
int nErrCode,
char* pBuff,
int sizeBuff);
263extern int SetParamDouble(
int BoardId,
int type,
double val);
264extern double GetParamDouble(
int BoardId,
int type);
273extern int OpenGrabber(
int BoardId,
int nGrabberType, MIG_HANDLE hwndParent);
327extern int Grab(
int BoardId,
int nNbImage, DWORD dwTimeOut_ms);
359extern int GetBytesPerPixel(
int BoardId);
360extern int GetImageSizeBytes(
int BoardId);
371extern int GetImage(
int BoardId,
unsigned char* pDstBuffer,
int dstWidth,
int dstHeight,
int dstPitchBytes);
372extern BOOL PutImage(
int BoardId,
unsigned char* pSrcBuffer,
int srcWidth,
int srcHeight,
int srcPitchBytes);
373extern int ImportImage(
int BoardId,
const char* pPathName);
374extern int ExportImage(
int BoardId,
const char* pPathName);
375extern int RegisterEvent(
int BoardId, MIG_HANDLE hEv,
int nMigEvent);
376extern void UnregisterEvent(
int BoardId,
int nMigEvent);
386extern int i2cRead(
int BoardId,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
397extern int i2cWrite(
int BoardId,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
414extern int bulk_i2cSet(
int BoardId,
unsigned short wRegAddr, BYTE* pbytValue,
int nLength);
430extern int pwrSetMode(
int BoardId,
int mode);
431extern int pwrGetNumOfChannel(
int BoardId);
432extern BOOL pwrIsPowerOn(
int BoardId);
433extern int pwrPowerOff(
int BoardId,
int nPwrChannel);
434extern int pwrPowerOffAll(
int BoardId);
443extern int pwrSetVoltage(
int BoardId,
int nPwrChannel,
const int nPwrLevel_mV);
471extern int WriteRegisterSet(
int BoardId,
const char* pFile,
const char* pSection,
int* pnErrorIndex);
482extern int ReadSyncCount(
int BoardId, DWORD dwTimeOut_ms,
int* pDestHsync,
int* pDestVsync, ULONG* pDestPClk_Hz);
483extern int GetFrameRate(
int BoardId,
int nFpsType,
float* pfFrameRate);
485extern BOOL IsDebug(
int BoardId);
486extern void SetDebug(
int BoardId, BOOL bDebug);
487extern int ExpCommand(
int BoardId, DWORD wCmd, int64_t pParam1, int64_t pParam2);
int WaitForFrameDone(int BoardId, DWORD dwTimeOut_ms)
Wait for new frame.
int CloseGrabber(int BoardId)
Close Grabber board.
int GetMigSdkVersion()
Get the version of MIG SDK.
int i2cRead(int BoardId, unsigned short wRegAddr, BYTE *pbytValue, int nLength)
Read i2c data.
int GetParamInt(int BoardId, int type)
Get the parameter.
struct _tagMIG_VIDEO_CONF _MIG_VIDEO_CONF
Video Config struct.
int GetImage(int BoardId, unsigned char *pDstBuffer, int dstWidth, int dstHeight, int dstPitchBytes)
Get image data.
int OpenGrabber(int BoardId, int nGrabberType, MIG_HANDLE hwndParent)
Open Grabber board.
struct _tagMIG_I2C_CONF _MIG_I2C_CONF
I2C Config struct.
int GetNumOfBoard()
Get the number of connected boards.
void SetConfigPathName(int BoardId, const char *pConfigFilePath)
Set the config path name.
struct _tagBOARD_INFO _BOARD_INFO
Board Info struct.
int bulk_i2cReset(int BoardId)
Reset bulk i2c buffer data.
int GetBoardId(int nUsbIndex)
Get the board id by the usb index.
int HaltGrab(int BoardId)
Stop capturing image.
int Grab(int BoardId, int nNbImage, DWORD dwTimeOut_ms)
Captures the specified number of frames.
int GetSerialNo(int BoardId, char *pSn, int sizeSN)
Get the Serial Number.
int SetParamInt(int BoardId, int type, int val)
Set the parameter.
BOOL IsVirtual(int BoardId)
Query that Grabber is virtual mode.
int bulk_i2cSetDelay(int BoardId, WORD wDelay_ms)
Add delay data into bulk buffer.
void GetErrStr(int nErrCode, char *pBuff, int sizeBuff)
Get the error string.
int pwrMeasureCurrent(int BoardId, int nPwrChannel, int *pPwrResult_mA)
Measure current on specified power channel.
int pwrSetVoltage(int BoardId, int nPwrChannel, const int nPwrLevel_mV)
Power on the specified power channel.
int bulk_i2cSet(int BoardId, unsigned short wRegAddr, BYTE *pbytValue, int nLength)
Add i2c data into bulk buffer.
int bulk_i2cRun(int BoardId)
Execute bulk i2c buffer data.
int ReadSyncCount(int BoardId, DWORD dwTimeOut_ms, int *pDestHsync, int *pDestVsync, ULONG *pDestPClk_Hz)
Read sync count to check module output.
int GetGrabberType(int BoardId)
Get the Grabber Type.
int WriteRegisterSet(int BoardId, const char *pFile, const char *pSection, int *pnErrorIndex)
Apply power or Sensor init configuration. ex> [POWERON] [REGISTER_INIT].
int GrabContinuous(int BoardId)
Start capturing image.
int i2cWrite(int BoardId, unsigned short wRegAddr, BYTE *pbytValue, int nLength)
Write i2c data.
BOOL GrabInProgress(int BoardId)
Query that Grab is in progress.
struct _tagBOARD_LIST _BOARD_LIST
Board List struct.
int pwrMeasureVoltage(int BoardId, int nPwrChannel, int *pPwrResult_mV)
Measure voltage on specified power channel.
BOOL IsGrabberOpened(int BoardId)
Query that Grabber is opened.
int EnumerateBoard(_BOARD_LIST *pDest)
Get the list of connected boards.
DWORD ext_info3
extra infomation3
DWORD ext_info1
extra infomation1
DWORD ext_info2
extra infomation2
int scan_index
usb index : 0, 1, 2,,,
int board_id
board id : 0, 1, 2,,,
int num_board
number of connected board.
int addr_type
0: 8bit , 1:16bit
int slave_addr
low 1 byte is valid.
int data_type
0: 8bit , 1:16bit
int check_ack
0: no check , 1: check
int bit_per_pxl_src
bit per pixel of source (if this is zero, that is same with bit_per_pxl)
int video_fmt
0: BAYER, 1: GRAY, 2: YUV422
int hor_res
Horizontal resolution.
int ver_res
Vertical resolution.
int bit_per_pxl
bit per pixel
int pxl_order
(BAYER=0:BGGR, 1:GBRG, 2:RGGB, 3:GRBG) (YUV422=0:YCBYCR/YUYV,1:YCRYCB/YVYU,2:CBYCRY/UYVY,...