IDS peak comfortC v1.8.0
Loading...
Searching...
No Matches
I2C

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.
 

Detailed Description

I2C related functions and types.

Enumeration Type Documentation

◆ peak_i2c_mode

peak i2c modes

valid mode types

Enumerator
PEAK_I2C_MODE_INVALID 

Invalid i2c mode.

Use this value for the initialization of variables of type peak_i2c_mode.

PEAK_I2C_MODE_STANDARD 

I2C fast mode with 100 kHz clock frequency.

PEAK_I2C_MODE_FAST 

I2C fast mode with 400 kHz clock frequency.

PEAK_I2C_MODE_FAST_PLUS 

I2C fast mode with 1000 kHz clock frequency.

◆ peak_i2c_operation_status

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

peak i2c register address length

valid register address length types

Enumerator
PEAK_I2C_REGISTER_ADDRESS_LENGTH_INVALID 

Invalid register address length.

Use this value for the initialization of variables of type peak_i2c_register_address_length.

PEAK_I2C_REGISTER_ADDRESS_LENGTH_0BIT 

0 bit register length. Register address will not be used

PEAK_I2C_REGISTER_ADDRESS_LENGTH_8BIT 

8 bit register length

PEAK_I2C_REGISTER_ADDRESS_LENGTH_16BIT 

16 bit register length

PEAK_I2C_REGISTER_ADDRESS_LENGTH_24BIT 

24 bit register length

Function Documentation

◆ peak_I2C_AckPolling_Enable()

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.

See also
peak_I2C_AckPolling_Timeout_Set
peak_I2C_OperationStatus_Get
Parameters
[in]hI2CThe i2c handle.
[in]enabledThe desired enabled status. PEAK_TRUE for enabled, PEAK_FALSE for disabled.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c feature is not accessible for write. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_AckPolling_IsEnabled()

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.

Parameters
[in]hI2CThe i2c handle.
Returns
PEAK_TRUE The i2c ack polling is currently enabled.
PEAK_FALSE The i2c ack polling is currently disabled or the query failed.

◆ peak_I2C_AckPolling_Timeout_Get()

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.

Parameters
[in]hI2CThe i2c handle.
[out]timeout_msThe i2c timeout_ms.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c ack polling timeout property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER timeout_ms is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_AckPolling_Timeout_GetAccessStatus()

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.

Parameters
[in]hI2CThe i2c handle.
Returns
PEAK_ACCESS_READWRITE The i2c ack polling timeout can be read from and written to.
PEAK_ACCESS_READONLY The i2c ack polling timeout can be read from only.
PEAK_ACCESS_WRITEONLY The i2c ack polling timeout can be written to only.
PEAK_ACCESS_GFA_LOCK The i2c ack polling timeout is not accessible because the GFA write access is enabled.
PEAK_ACCESS_NONE The i2c ack polling timeout is not accessible.
PEAK_ACCESS_NOT_SUPPORTED The i2c ack polling timeout is not supported.
PEAK_ACCESS_INVALID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:

◆ peak_I2C_AckPolling_Timeout_GetRange()

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.

Parameters
[in]hI2CThe i2c handle.
[out]minTimeout_msThe minimum i2c ack polling timeout.
[out]maxTimeout_msThe maximum i2c ack polling timeout.
[out]incTimeout_msThe increment i2c ack polling timeout.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c ack polling timeout property is not accessible. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER At least one of minTimeout_ms, maxTimeout_ms, and incTimeout_ms is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_AckPolling_Timeout_Set()

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.

Parameters
[in]hI2CThe i2c handle.
[in]timeout_msThe i2c ack polling timeout to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_OUT_OF_RANGE timeout_ms is out of range. Check the range of valid values via peak_I2C_AckPolling_Timeout_GetRange.
PEAK_STATUS_ACCESS_DENIED The i2c ack polling timeout property is not available for write access. Check the availability of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_Create()

peak_status peak_I2C_Create ( peak_camera_handle  hCam,
peak_i2c_handle *  hI2C 
)

Creates a new i2c instance.

Parameters
[in]hCamThe camera handle.
[out]hI2CPointer to a handle for an i2c receiving the instance handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_INVALID_PARAMETER hI2C is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_Data_MaxSize_Get()

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.

Parameters
[in]hI2CThe i2c handle.
[out]maxDataSizeThe i2c maxDataSize to read or to write.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c max data size property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER maxDataSize is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_Data_Read()

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.

Parameters
[in]hI2CThe i2c handle.
[in]maxDataSizeThe size of the *data buffer.
[in]dataThe buffer to receive the data to.
[out]dataSizeThe size of the read *data in bytes.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c device register is not readable. Check the access status via peak_I2C_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER dataSize is 0 or data is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_Data_Write()

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.

Note
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.
See also
peak_I2C_AckPolling_Enable
peak_I2C_AckPolling_Timeout_Set
Parameters
[in]hI2CThe i2c handle.
[in]dataThe data to write.
[in]dataSizeThe size of *data in bytes.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c device register is not writeable. Check the access status via peak_I2C_GetAccessStatus.
PEAK_STATUS_OUT_OF_RANGE dataSize exceeds the size of the max data size. Check the size of the maxDataSize via peak_I2C_Data_MaxSize_Get.
PEAK_STATUS_INVALID_PARAMETER dataSize is 0 or data is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_WARNING_OPERATION The write operation failed. Check the operation status via peak_I2C_OperationStatus_Get.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_Destroy()

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

Parameters
[in]hI2CThe i2c handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_DeviceAddress_Get()

peak_status peak_I2C_DeviceAddress_Get ( peak_i2c_handle  hI2C,
uint32_t *  address 
)

Get the i2c device address.

Reads the current i2c device address.

Parameters
[in]hI2CThe i2c handle.
[out]addressThe i2c device address.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c device address property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER address is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_DeviceAddress_GetRange()

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.

Note
Only addresses with a length of 7 bits are supported.
The following address is reserved for uEye+ LE USB 3.1 Rev. 1.2 / uEye+ LE USB 3.1 Rev. 1.2 AF cameras and must not be used: 0x77.
Parameters
[in]hI2CThe i2c handle.
[out]minAddressThe minimum i2c device address.
[out]maxAddressThe maximum i2c device address.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c device address property is not accessible. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER At least one of minAddress, and maxAddress is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_DeviceAddress_Set()

peak_status peak_I2C_DeviceAddress_Set ( peak_i2c_handle  hI2C,
uint32_t  address 
)

Set the i2c device address.

Writes the desired i2c device address.

Note
Refer to the data sheet of the device to get the device address.
Parameters
[in]hI2CThe i2c handle.
[in]addressThe i2c device address to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_OUT_OF_RANGE address is out of range. Check the range of valid values via peak_I2C_DeviceAddress_GetRange.
PEAK_STATUS_ACCESS_DENIED The i2c device address property is not available for write access. Check the availability of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_GetAccessStatus()

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.

Parameters
[in]hI2CThe i2c handle.
Returns
PEAK_ACCESS_READWRITE The i2c can be read from and written to.
PEAK_ACCESS_READONLY The i2c can be read from only.
PEAK_ACCESS_WRITEONLY The i2c can be written to only.
PEAK_ACCESS_GFA_LOCK The i2c is not accessible because the GFA write access is enabled.
PEAK_ACCESS_NONE The i2c is not accessible.
PEAK_ACCESS_NOT_SUPPORTED The i2c is not supported.
PEAK_ACCESS_INVALID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:

◆ peak_I2C_Mode_Get()

peak_status peak_I2C_Mode_Get ( peak_i2c_handle  hI2C,
peak_i2c_mode *  mode 
)

Get the i2c mode.

Reads the current i2c mode.

Parameters
[in]hI2CThe i2c handle.
[out]modeThe i2c mode.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c mode property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER mode is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_Mode_GetList()

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.

Parameters
[in]hI2CThe i2c handle.
[out]modeListPointer 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 equal NULL:
    out: minimal number of i2c modes modeList must be large enough to hold
  • modeList unequal NULL:
    in: number of i2c modes modeList can hold
    out: number of i2c modes filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_BUFFER_TOO_SMALL modeList is not NULL and the value of *modeListSize is too small to receive the expected amount of data.
PEAK_STATUS_ACCESS_DENIED The i2c modes property is not accessible. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER modeListSize is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
Consider that the i2c mode list might change between the size query call and the list query call.
This may be the case if the i2c mode, the camera configuration, or the camera status have changed in the time between the two function calls.

◆ peak_I2C_Mode_Set()

peak_status peak_I2C_Mode_Set ( peak_i2c_handle  hI2C,
peak_i2c_mode  mode 
)

Set the i2c mode.

Writes the desired i2c mode.

Note
Refer to the data sheet of the device to get the supported I2C modes.
Parameters
[in]hI2CThe i2c handle.
[in]modeThe i2c mode.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_OUT_OF_RANGE exposureTime_us is out of range. Check the range of valid values via peak_I2C_Mode_GetList.
PEAK_STATUS_ACCESS_DENIED The mode control is not available for write access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER mode is an invalid i2c mode.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_OperationStatus_Get()

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.

Parameters
[in]hI2CThe i2c handle.
[out]operationStatusThe i2c operationStatus.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c operation status property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus.
PEAK_STATUS_INVALID_PARAMETER operationStatus is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Endianness_Get()

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.

Parameters
[in]hI2CThe i2c handle.
[out]endiannessThe i2c register address endianness.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c register address property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER endianness is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Endianness_Set()

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.

Parameters
[in]hI2CThe i2c handle.
[in]endiannessThe i2c register address endianness to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c register address property is not available for write access. Check the availability of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Get()

peak_status peak_I2C_RegisterAddress_Get ( peak_i2c_handle  hI2C,
uint32_t *  address 
)

Get the i2c register address.

Reads the current i2c register address.

Parameters
[in]hI2CThe i2c handle.
[out]addressThe i2c register address.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c register address property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER address is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Length_Get()

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.

Parameters
[in]hI2CThe i2c handle.
[out]lengthThe i2c register address length.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c register address property is not available for read access. Check the access status of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_PARAMETER length is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Length_GetList()

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.

Parameters
[in]hI2CThe i2c handle.
[out]i2cLengthListPointer 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 equal NULL:
    out: minimal number of supported i2c lengths i2cLengthList must be large enough to hold
  • i2cLengthList unequal NULL:
    in: number of supported i2c lengths i2cLengthList can hold
    out: number of supported i2c lengths filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_BUFFER_TOO_SMALL i2cLengthList is not NULL and the value of *i2cLengthCount is too small to receive the expected amount of data.
PEAK_STATUS_ACCESS_DENIED The i2c feature is not supported or the GFA write mode is enabled.
PEAK_STATUS_INVALID_PARAMETER i2cLengthCount is an invalid pointer.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Length_Set()

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.

Parameters
[in]hI2CThe i2c handle.
[in]lengthThe i2c register address length to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_ACCESS_DENIED The i2c register address property is not available for write access. Check the availability of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_I2C_RegisterAddress_Set()

peak_status peak_I2C_RegisterAddress_Set ( peak_i2c_handle  hI2C,
uint32_t  address 
)

Set the i2c register address.

Writes the desired i2c register address.

Note
Refer to the data sheet of the device to get the possible register address.
Parameters
[in]hI2CThe i2c handle.
[in]addressThe i2c register address to set.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_OUT_OF_RANGE address is out of range. Check the range of valid values via peak_I2C_RegisterAddress_Length_Get.
PEAK_STATUS_ACCESS_DENIED The i2c register address property is not available for write access. Check the availability of the i2c feature via peak_I2C_GetAccessStatus or check the last error for more information via peak_Library_GetLastError.
PEAK_STATUS_INVALID_HANDLE hI2C is an invalid i2c handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
The i2c register address must match the set length of the i2c register address (see peak_i2c_register_address_length and peak_I2C_RegisterAddress_Length_Set