User Guide
ArduCAM USB Camera SDK User Guide
www.ArduCAM.com
3
1 Introduction
This user guide describes the detail software operation of ArduCAM USB camera shield
based on SDK library. The latest SDK library and examples can be downloaded from the
https://github.com/arducam.
2 USB SDK Library
The ArdCAM USB SDK library is designed for both ArduCAM USB2.0 and USB3.0 camera
boards. It is binary from library which composed by *.lib and *.dll files. The x86 is compiled for
32bit system and the x64 is compiled for 64bit system.
3 Demo Code
The demo code is provided in source code form to help user to understand the operation the
ArduCAM USB camera and SDK library. It is created with Microsoft Visual Studio 2008 and
based on MFC frame work.
3.1 Thread.cpp
The Thread.cpp is used to create different tasks to polling the hardware when data is ready to
receive and process. Four main tasks should be created to avoid data loss on the hardware side.
_FrameCaptureThread : the thread is used to receive the image data from the camera board.
_FrameReadThread: the thread to read image data from the SDK library frame buffer.
3.2 USBTestDlg.cpp
The USBTestDlg.cpp is used to handle GUI operation of the demo project. It handles the
button click actions, register read/write access, RAW to RGB image processing, display real time
video and etc.
3.3 CommonTools.cpp
The CommonTools.cpp is used to provide several common functions, such as conversion
between number and ASCII code, the creation of file name and etc.
4 ArduCAM APIs
There are a set of API functions that access to the ArduCAM USB camera hardware.
4.1 Data Structures
There is important data structures used by the SDK library for the camera configuration.
4.1.1 ArduCamCfg Data Structure Members
u32CameraType: unsigned long, reserved for future use.
u32Height: unsigned long, the height of the video stream
u32Width: unsigned long, the width of the video stream
u8PixelBytes: unsigned char, the number of bytes of one pixel
u8PixelBits: unsigned char, the bits depth per pixel
emI2cMode: enum type i2c_mode, I2C protocol for the sensor
u32SensorShipAddr: unsigned long, I2C slave address for the sensor
u16Vid: unsigned short, the vendor code of the camera
u32UsbVersion: unsigned long, USB camera version
The SDK library support 4 different I2C modes. For example I2C_MODE_8_8 is for 8bits
register and 8bits register value, I2C_MODE_8_16 is for 8bits register and 16bits register value.