![]() |
IDS peak comfortC v1.7.0
|
Typedefs | |
| typedef struct peak_i2c * | peak_i2c_handle |
| peak i2c handle The value for an invalid i2c handle is PEAK_INVALID_HANDLE. | |
Enumerations | |
| enum | peak_i2c_mode { PEAK_I2C_MODE_INVALID , PEAK_I2C_MODE_STANDARD , PEAK_I2C_MODE_FAST , PEAK_I2C_MODE_FAST_PLUS } |
| peak i2c modes More... | |
| enum | peak_i2c_register_address_length { PEAK_I2C_REGISTER_ADDRESS_LENGTH_INVALID , PEAK_I2C_REGISTER_ADDRESS_LENGTH_0BIT , PEAK_I2C_REGISTER_ADDRESS_LENGTH_8BIT , PEAK_I2C_REGISTER_ADDRESS_LENGTH_16BIT , PEAK_I2C_REGISTER_ADDRESS_LENGTH_24BIT } |
| peak i2c register address length More... | |
| enum | peak_i2c_operation_status { PEAK_I2C_OPERATION_STATUS_INVALID , PEAK_I2C_OPERATION_STATUS_READY , PEAK_I2C_OPERATION_STATUS_ERROR , PEAK_I2C_OPERATION_STATUS_TIMEOUT_ERROR , PEAK_I2C_OPERATION_STATUS_INVALID_DEVICE_ADDRESS } |
| peak i2c operation status More... | |
Functions | |
| peak_status | peak_I2C_Create (peak_camera_handle hCam, peak_i2c_handle *hI2C) |
| Creates a new i2c instance. | |
| peak_status | peak_I2C_Destroy (peak_i2c_handle hI2C) |
| Destroys a i2c handle. | |
| peak_access_status | peak_I2C_GetAccessStatus (peak_i2c_handle hI2C) |
| Query the i2c access status. | |
| peak_status | peak_I2C_Mode_GetList (peak_i2c_handle hI2C, peak_i2c_mode *modeList, size_t *modeListSize) |
| Get the list of currently selectable i2c modes. | |
| peak_status | peak_I2C_Mode_Set (peak_i2c_handle hI2C, peak_i2c_mode mode) |
| Set the i2c mode. | |
| peak_status | peak_I2C_Mode_Get (peak_i2c_handle hI2C, peak_i2c_mode *mode) |
| Get the i2c mode. | |
| peak_status | peak_I2C_DeviceAddress_GetRange (peak_i2c_handle hI2C, uint32_t *minAddress, uint32_t *maxAddress) |
| Get the current range of valid i2c device addresses. | |
| peak_status | peak_I2C_DeviceAddress_Set (peak_i2c_handle hI2C, uint32_t address) |
| Set the i2c device address. | |
| peak_status | peak_I2C_DeviceAddress_Get (peak_i2c_handle hI2C, uint32_t *address) |
| Get the i2c device address. | |
| peak_status | peak_I2C_RegisterAddress_Length_GetList (peak_i2c_handle hI2C, peak_i2c_register_address_length *i2cLengthList, size_t *i2cLengthCount) |
| Get list of supported i2c register address lengths. | |
| peak_status | peak_I2C_RegisterAddress_Length_Set (peak_i2c_handle hI2C, peak_i2c_register_address_length length) |
| Set the i2c register address length. | |
| peak_status | peak_I2C_RegisterAddress_Length_Get (peak_i2c_handle hI2C, peak_i2c_register_address_length *length) |
| Get the i2c register address length. | |
| peak_status | peak_I2C_RegisterAddress_Endianness_Set (peak_i2c_handle hI2C, peak_endianness endianness) |
| Set the i2c register address endianness. | |
| peak_status | peak_I2C_RegisterAddress_Endianness_Get (peak_i2c_handle hI2C, peak_endianness *endianness) |
| Get the i2c register endianness. | |
| peak_status | peak_I2C_RegisterAddress_Set (peak_i2c_handle hI2C, uint32_t address) |
| Set the i2c register address. | |
| peak_status | peak_I2C_RegisterAddress_Get (peak_i2c_handle hI2C, uint32_t *address) |
| Get the i2c register address. | |
| peak_status | peak_I2C_AckPolling_Enable (peak_i2c_handle hI2C, peak_bool enabled) |
| Enable/Disable the i2c ack polling. | |
| peak_bool | peak_I2C_AckPolling_IsEnabled (peak_i2c_handle hI2C) |
| Get the enabled status of the i2c ack polling. | |
| peak_access_status | peak_I2C_AckPolling_Timeout_GetAccessStatus (peak_i2c_handle hI2C) |
| Query the i2c ack polling timeout access status. | |
| peak_status | peak_I2C_AckPolling_Timeout_GetRange (peak_i2c_handle hI2C, uint32_t *minTimeout_ms, uint32_t *maxTimeout_ms, uint32_t *incTimeout_ms) |
| Get the current range of valid i2c ack polling timeouts in milliseconds. | |
| peak_status | peak_I2C_AckPolling_Timeout_Set (peak_i2c_handle hI2C, uint32_t timeout_ms) |
| Set the i2c ack polling timeout in milliseconds. | |
| peak_status | peak_I2C_AckPolling_Timeout_Get (peak_i2c_handle hI2C, uint32_t *timeout_ms) |
| Get the i2c ack polling timeout in milliseconds. | |
| peak_status | peak_I2C_Data_Write (peak_i2c_handle hI2C, const uint8_t *data, size_t dataSize) |
| Write to a i2c device register. | |
| peak_status | peak_I2C_Data_Read (peak_i2c_handle hI2C, size_t maxDataSize, uint8_t *data, size_t *dataSize) |
| Read from a i2c device register. | |
| peak_status | peak_I2C_Data_MaxSize_Get (peak_i2c_handle hI2C, size_t *maxDataSize) |
| Get the max data size to read or to write from i2c device register. | |
| peak_status | peak_I2C_OperationStatus_Get (peak_i2c_handle hI2C, peak_i2c_operation_status *operationStatus) |
| Get the i2c operation status. | |
I2C related functions and types.
| enum peak_i2c_mode |
peak i2c modes
valid mode types
peak i2c operation status
valid operation status types
| Enumerator | |
|---|---|
| PEAK_I2C_OPERATION_STATUS_INVALID | Invalid operation status. Use this value for the initialization of variables of type peak_i2c_operation_status. |
| PEAK_I2C_OPERATION_STATUS_READY | I2C communication is ready or the last write/read was successful. |
| PEAK_I2C_OPERATION_STATUS_ERROR | An error occured while reading or writing. |
| PEAK_I2C_OPERATION_STATUS_TIMEOUT_ERROR | The Receiver did not acknowledge within the given time. See peak_I2C_AckPolling_Timeout_Set. |
| PEAK_I2C_OPERATION_STATUS_INVALID_DEVICE_ADDRESS | The device address is not allowed. |
peak i2c register address length
valid register address length types
| peak_status peak_I2C_AckPolling_Enable | ( | peak_i2c_handle | hI2C, |
| peak_bool | enabled | ||
| ) |
Enable/Disable the i2c ack polling.
Sets the i2c ack polling to enabled or disabled. When i2c ack polling is enabled, the camera waits for an acknowledge after an I2C write operation. If this acknowledge is not received within the ack polling timeout, the i2c operation status changes to a timeout error.
| [in] | hI2C | The i2c handle. |
| [in] | enabled | The desired enabled status. PEAK_TRUE for enabled, PEAK_FALSE for disabled. |
hI2C is an invalid i2c handle. | peak_bool peak_I2C_AckPolling_IsEnabled | ( | peak_i2c_handle | hI2C | ) |
Get the enabled status of the i2c ack polling.
Queries whether the i2c ack polling is currently enabled or disabled.
This function implements the Enabled Status Query principle.
| [in] | hI2C | The i2c handle. |
| peak_status peak_I2C_AckPolling_Timeout_Get | ( | peak_i2c_handle | hI2C, |
| uint32_t * | timeout_ms | ||
| ) |
Get the i2c ack polling timeout in milliseconds.
Reads the current i2c ack polling timeout.
| [in] | hI2C | The i2c handle. |
| [out] | timeout_ms | The i2c timeout_ms. |
timeout_ms is an invalid pointer. hI2C is an invalid i2c handle. | peak_access_status peak_I2C_AckPolling_Timeout_GetAccessStatus | ( | peak_i2c_handle | hI2C | ) |
Query the i2c ack polling timeout access status.
Provides the current access status for the specified i2c ack polling timeout.
This function implements the Access Status Query principle.
| [in] | hI2C | The i2c handle. |
If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:
hI2C is an invalid i2c handle. | peak_status peak_I2C_AckPolling_Timeout_GetRange | ( | peak_i2c_handle | hI2C, |
| uint32_t * | minTimeout_ms, | ||
| uint32_t * | maxTimeout_ms, | ||
| uint32_t * | incTimeout_ms | ||
| ) |
Get the current range of valid i2c ack polling timeouts in milliseconds.
Queries the current range of valid i2c ack polling timeouts.
The range of valid i2c ack polling timeouts may depend on the camera configuration, and the camera status.
| [in] | hI2C | The i2c handle. |
| [out] | minTimeout_ms | The minimum i2c ack polling timeout. |
| [out] | maxTimeout_ms | The maximum i2c ack polling timeout. |
| [out] | incTimeout_ms | The increment i2c ack polling timeout. |
minTimeout_ms, maxTimeout_ms, and incTimeout_ms is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_AckPolling_Timeout_Set | ( | peak_i2c_handle | hI2C, |
| uint32_t | timeout_ms | ||
| ) |
Set the i2c ack polling timeout in milliseconds.
Writes the desired i2c ack polling timeout.
| [in] | hI2C | The i2c handle. |
| [in] | timeout_ms | The i2c ack polling timeout to set. |
timeout_ms is out of range. Check the range of valid values via peak_I2C_AckPolling_Timeout_GetRange. hI2C is an invalid i2c handle. | peak_status peak_I2C_Create | ( | peak_camera_handle | hCam, |
| peak_i2c_handle * | hI2C | ||
| ) |
Creates a new i2c instance.
| [in] | hCam | The camera handle. |
| [out] | hI2C | Pointer to a handle for an i2c receiving the instance handle. |
hCam is an invalid camera handle. hI2C is an invalid pointer. | peak_status peak_I2C_Data_MaxSize_Get | ( | peak_i2c_handle | hI2C, |
| size_t * | maxDataSize | ||
| ) |
Get the max data size to read or to write from i2c device register.
Reads the max data size.
| [in] | hI2C | The i2c handle. |
| [out] | maxDataSize | The i2c maxDataSize to read or to write. |
maxDataSize is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_Data_Read | ( | peak_i2c_handle | hI2C, |
| size_t | maxDataSize, | ||
| uint8_t * | data, | ||
| size_t * | dataSize | ||
| ) |
Read from a i2c device register.
Reads the specified data from the specified i2c device register.
| [in] | hI2C | The i2c handle. |
| [in] | maxDataSize | The size of the *data buffer. |
| [in] | data | The buffer to receive the data to. |
| [out] | dataSize | The size of the read *data in bytes. |
dataSize is 0 or data is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_Data_Write | ( | peak_i2c_handle | hI2C, |
| const uint8_t * | data, | ||
| size_t | dataSize | ||
| ) |
Write to a i2c device register.
Writes the specified data to the specified i2c device register.
| [in] | hI2C | The i2c handle. |
| [in] | data | The data to write. |
| [in] | dataSize | The size of *data in bytes. |
dataSize exceeds the size of the max data size. Check the size of the maxDataSize via peak_I2C_Data_MaxSize_Get. dataSize is 0 or data is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_Destroy | ( | peak_i2c_handle | hI2C | ) |
Destroys a i2c handle.
After the call, the handle is invalid. After a call to peak_Camera_Close, all i2c handles created with peak_I2C_Create with the corresponding peak_camera_handle are also invalid
| [in] | hI2C | The i2c handle. |
hI2C is an invalid handle. | peak_status peak_I2C_DeviceAddress_Get | ( | peak_i2c_handle | hI2C, |
| uint32_t * | address | ||
| ) |
Get the i2c device address.
Reads the current i2c device address.
| [in] | hI2C | The i2c handle. |
| [out] | address | The i2c device address. |
address is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_DeviceAddress_GetRange | ( | peak_i2c_handle | hI2C, |
| uint32_t * | minAddress, | ||
| uint32_t * | maxAddress | ||
| ) |
Get the current range of valid i2c device addresses.
Queries the current range of valid i2c device addresses.
The range of valid i2c device addresses may depend on the camera configuration, and the camera status.
| [in] | hI2C | The i2c handle. |
| [out] | minAddress | The minimum i2c device address. |
| [out] | maxAddress | The maximum i2c device address. |
minAddress, and maxAddress is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_DeviceAddress_Set | ( | peak_i2c_handle | hI2C, |
| uint32_t | address | ||
| ) |
Set the i2c device address.
Writes the desired i2c device address.
| [in] | hI2C | The i2c handle. |
| [in] | address | The i2c device address to set. |
address is out of range. Check the range of valid values via peak_I2C_DeviceAddress_GetRange. hI2C is an invalid i2c handle. | peak_access_status peak_I2C_GetAccessStatus | ( | peak_i2c_handle | hI2C | ) |
Query the i2c access status.
Provides the current access status for the specified i2c handle.
This function implements the Access Status Query principle.
| [in] | hI2C | The i2c handle. |
If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:
hI2C is an invalid i2c handle. | peak_status peak_I2C_Mode_Get | ( | peak_i2c_handle | hI2C, |
| peak_i2c_mode * | mode | ||
| ) |
Get the i2c mode.
Reads the current i2c mode.
| [in] | hI2C | The i2c handle. |
| [out] | mode | The i2c mode. |
mode is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_Mode_GetList | ( | peak_i2c_handle | hI2C, |
| peak_i2c_mode * | modeList, | ||
| size_t * | modeListSize | ||
| ) |
Get the list of currently selectable i2c modes.
Queries the list of currently selectable i2c modes.
The list of selectable i2c modes may depend on the trigger mode, the camera configuration, and the camera status.
This function implements the Two Staged Data Query principle.
| [in] | hI2C | The i2c handle. |
| [out] | modeList | Pointer to a user allocated array buffer to receive the i2c mode list. If this parameter is NULL, modeListSize will contain the current number of i2c modes. The required size of modeList in bytes is modeListSize x sizeof(peak_i2c_mode). |
| [in,out] | modeListSize |
|
modeList is not NULL and the value of *modeListSize is too small to receive the expected amount of data. modeListSize is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_Mode_Set | ( | peak_i2c_handle | hI2C, |
| peak_i2c_mode | mode | ||
| ) |
Set the i2c mode.
Writes the desired i2c mode.
| [in] | hI2C | The i2c handle. |
| [in] | mode | The i2c mode. |
exposureTime_us is out of range. Check the range of valid values via peak_I2C_Mode_GetList. mode is an invalid i2c mode. hI2C is an invalid i2c handle. | peak_status peak_I2C_OperationStatus_Get | ( | peak_i2c_handle | hI2C, |
| peak_i2c_operation_status * | operationStatus | ||
| ) |
Get the i2c operation status.
Reads the current i2c operation status.
| [in] | hI2C | The i2c handle. |
| [out] | operationStatus | The i2c operationStatus. |
operationStatus is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Endianness_Get | ( | peak_i2c_handle | hI2C, |
| peak_endianness * | endianness | ||
| ) |
Get the i2c register endianness.
Reads the current i2c register address endianness.
| [in] | hI2C | The i2c handle. |
| [out] | endianness | The i2c register address endianness. |
endianness is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Endianness_Set | ( | peak_i2c_handle | hI2C, |
| peak_endianness | endianness | ||
| ) |
Set the i2c register address endianness.
Writes the desired i2c register address endianness.
| [in] | hI2C | The i2c handle. |
| [in] | endianness | The i2c register address endianness to set. |
hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Get | ( | peak_i2c_handle | hI2C, |
| uint32_t * | address | ||
| ) |
Get the i2c register address.
Reads the current i2c register address.
| [in] | hI2C | The i2c handle. |
| [out] | address | The i2c register address. |
address is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Length_Get | ( | peak_i2c_handle | hI2C, |
| peak_i2c_register_address_length * | length | ||
| ) |
Get the i2c register address length.
Reads the current i2c register address length.
| [in] | hI2C | The i2c handle. |
| [out] | length | The i2c register address length. |
length is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Length_GetList | ( | peak_i2c_handle | hI2C, |
| peak_i2c_register_address_length * | i2cLengthList, | ||
| size_t * | i2cLengthCount | ||
| ) |
Get list of supported i2c register address lengths.
This function implements the Two Staged Data Query principle.
| [in] | hI2C | The i2c handle. |
| [out] | i2cLengthList | Pointer to a user allocated array buffer to receive the i2c length list. If this parameter is NULL, i2cLengthCount will contain the current number of supported i2c lengths. The required size of i2cLengthList in bytes is i2cLengthCount x sizeof(peak_i2c_register_address_length). |
| [in,out] | i2cLengthCount |
|
i2cLengthList is not NULL and the value of *i2cLengthCount is too small to receive the expected amount of data. i2cLengthCount is an invalid pointer. hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Length_Set | ( | peak_i2c_handle | hI2C, |
| peak_i2c_register_address_length | length | ||
| ) |
Set the i2c register address length.
Writes the desired i2c register address length.
| [in] | hI2C | The i2c handle. |
| [in] | length | The i2c register address length to set. |
hI2C is an invalid i2c handle. | peak_status peak_I2C_RegisterAddress_Set | ( | peak_i2c_handle | hI2C, |
| uint32_t | address | ||
| ) |
Set the i2c register address.
Writes the desired i2c register address.
| [in] | hI2C | The i2c handle. |
| [in] | address | The i2c register address to set. |
address is out of range. Check the range of valid values via peak_I2C_RegisterAddress_Length_Get. hI2C is an invalid i2c handle.