Defines the I2C interface of the BCON adapter. More...
Typedefs | |
typedef struct BconAdapterI2cBusHandle_tag * | BconAdapterI2cBusHandle |
Handle representing an I2C bus instance. A handle value of null is considered invalid. | |
Functions | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterI2cOpenConnection (const char deviceId[], BconAdapterI2cBusHandle *phBus, uint32_t *pDeviceAddress) |
Opens the I2C bus connection to a camera device. This call can be used to initialize I2C bus hardware or allocate resources needed. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterI2cCloseConnection (BconAdapterI2cBusHandle hBus, uint32_t deviceAddress) |
Closes the I2C bus connection to a camera device. Memory and resources allocated during BconAdapterI2cOpenConnection() can be freed. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterI2cRead (BconAdapterI2cBusHandle hBus, uint32_t deviceAddress, void *pData, size_t sizeInBytes, size_t *pBytesRead, uint32_t timeout_ms) |
Reads a block of data from I2C bus. More... | |
BCONSTATUS BCON_ADAPTER_CALL | BconAdapterI2cWrite (BconAdapterI2cBusHandle hBus, uint32_t deviceAddress, const void *pData, size_t sizeInBytes, uint32_t timeout_ms) |
Writes a block of data on the I2C bus. More... | |
Defines the I2C interface of the BCON adapter.
BCONSTATUS BCON_ADAPTER_CALL BconAdapterI2cCloseConnection | ( | BconAdapterI2cBusHandle | hBus, |
uint32_t | deviceAddress | ||
) |
Closes the I2C bus connection to a camera device. Memory and resources allocated during BconAdapterI2cOpenConnection() can be freed.
[in] | hBus | Bus handle. |
[in] | deviceAddress | The device address (I2C) of the device. |
BCON_OK | on success. |
BCON_E_NOT_FOUND | if device is not open. |
Any | other BCON adapter error code otherwise. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterI2cOpenConnection | ( | const char | deviceId[], |
BconAdapterI2cBusHandle * | phBus, | ||
uint32_t * | pDeviceAddress | ||
) |
Opens the I2C bus connection to a camera device. This call can be used to initialize I2C bus hardware or allocate resources needed.
[in] | deviceId | Device identifier received during discovery. |
[out] | phBus | I2C bus handle created. If multiple cameras share an I2C bus, the returned handles must be equal. |
[out] | pDeviceAddress | The device address (I2C) of the device. It will be used in BconAdapterI2cRead and BconAdapterI2cWrite operations. |
BCON_OK | on success. |
BCON_E_NOT_FOUND | if device is not available. |
Any | other BCON adapter error code otherwise. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterI2cRead | ( | BconAdapterI2cBusHandle | hBus, |
uint32_t | deviceAddress, | ||
void * | pData, | ||
size_t | sizeInBytes, | ||
size_t * | pBytesRead, | ||
uint32_t | timeout_ms | ||
) |
Reads a block of data from I2C bus.
[in] | hBus | Bus handle. |
[in] | deviceAddress | Device address space (I2C). |
[out] | pData | Pointer to the data buffer. |
[in] | sizeInBytes | Size of the data buffer. |
[out] | pBytesRead | Number of bytes read. |
[in] | timeout_ms | Timeout in milliseconds. |
BCON_OK | on success. |
BCON_E_TIMEOUT | if the operation timed out. |
Any | other BCON adapter error code otherwise. |
BCONSTATUS BCON_ADAPTER_CALL BconAdapterI2cWrite | ( | BconAdapterI2cBusHandle | hBus, |
uint32_t | deviceAddress, | ||
const void * | pData, | ||
size_t | sizeInBytes, | ||
uint32_t | timeout_ms | ||
) |
Writes a block of data on the I2C bus.
[in] | hBus | Bus handle. |
[in] | deviceAddress | Device address space (I2C). |
[in] | pData | Pointer to the data buffer. |
[in] | sizeInBytes | Size of data buffer in bytes. |
[in] | timeout_ms | Timeout in milliseconds. |
BCON_OK | on success |
BCON_E_TIMEOUT | if the operation timed out. |
Any | other BCON adapter error code otherwise. |