All PL-B board level cameras.
I2C (pronounced I squared C) is short for Inter-Integrated Circuit bus, a type of bus which is used to connect integrated circuits (ICs). It is used to connect low-speed peripherals in an embedded system or motherboard. I2C is a multi-master bus, which means that multiple chips can be connected to the same bus and each one can act as a master by initiating a data transfer.
Typical applications for the I2C communication feature is to use the PixeLINK imaging module as the main point of communication between the host and associated peripheral equipment. For example, suppose the camera is on a microscope and the microscope has a motorized stage with a serial control interface. Rather than having a USB connection to the camera and a serial connection to the stage, the application can use the camera to talk to the stage and simplify the wiring requirements to the host.
For details on the mechanical and electrical connections required, see the Hardware - PL-B Board Level COM Interface topic.
The I2C bus can be controlled using two functions from the SDK, PxLCameraRead() and PxLCameraWrite(). A buffer with the following format should be passed to these calls:
struct
{
ULONG Command; // Set to 0x00008005 to Read and 0x00008006 to Write
ULONG DeviceAddress; // I2C Device Address
ULONG OutputBufferSize; // Number of bytes to write
ULONG InputBufferSize; // Number of bytes to read (Should be 0 for write requests)
UCHAR OutputBuffer[OuputBufferSize];
UCHAR InputBuffer[InputBufferSize];
};
For example, to write a byte to a device with a device address of 0xA0, and 16-bit internal addresses, call PxLCameraWrite() with the buffer setup as follows:
Set Command to 0x00008006
Set DeviceAddress to 0x000000A0
Set OutputBufferSize to 0x00000003 (two bytes of address, one byte of data)
Set InputBufferSize to 0x00000000 (always 0 for writes)
Set the OutputBuffer to { 0x71, 0x23, 0xFF } (to write 0xFF to address 0x7123)
If the acknowledges are not received correctly, PxLCameraWrite() will return an error.
A read example: To read two bytes from a device with a device address of 0x56, and 8-bit internal address, call PxLCameraWrite() with the buffer setup as follows:
Set Command to 0x00008005
Set DeviceAddress to 0x00000056
Set OutputBufferSize to 0x00000001 (one bytes of address)
Set InputBufferSize to 0x00000002
Set the OutputBuffer to { 0xA5 } (to read starting from address 0xA5)
Set the InputBuffer to two bytes in length (contents will be filled in after read)
To retrieve the data call PxLCameraRead() with the same buffer size as was passed in to PxLCameraWrite(). InputBuffer will now contain the two bytes read from the I2C device.
I2C Bus communications are not controllable through the IIDC protocol.