|
|
NVIDIA DriveOS Linux SDK API Reference
|
7.2.5.0 Early Access Release
|
Go to the documentation of this file.
12 #ifndef DEVBLK_CDI_I2C_H
13 #define DEVBLK_CDI_I2C_H
41 #define I2C_ARRAY_SIZE(x) (uint32_t)(sizeof(x) / sizeof((x)[0]))
50 #define CDI_I2C_MAX_BATCH_SIZE 16U
56 #define CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE 240U
63 #define CDI_I2C_MAX_RETRY_ATTEMPTS 10U
70 #define CDI_I2C_MAX_RETRY_DELAY_US 10000U
306 uint8_t
const *data, uint32_t len,
363 uint8_t
const *data, uint32_t len,
461 const uint8_t addrLength,
462 const uint8_t dataLength
654 const uint16_t address,
704 const uint16_t address,
761 uint16_t
const address,
763 uint8_t
const verifyMask
809 const uint16_t address,
859 uint16_t
const address,
860 uint8_t
const *
const data,
861 uint16_t
const dataLen
912 uint16_t
const address,
913 uint8_t
const *
const data,
914 uint16_t
const dataLen
962 const uint16_t address,
1010 const uint16_t address,
1068 uint16_t
const address,
1119 const uint16_t address,
1182 uint16_t
const address,
1241 uint16_t
const address,
1243 uint8_t
const verifyMask
1309 uint16_t
const address,
1311 uint8_t
const verifyMask,
1373 const uint16_t address,
1422 const uint16_t address,
1481 uint16_t
const address,
1532 const uint16_t address,
2239 const uint16_t address,
2240 const uint16_t dataLength,
2295 const uint16_t address,
2296 const uint16_t dataLength,
Defines mask and value pair for comparing readback data.
uint8_t expectedValue
The expected value to compare with masked readback data.
I2C operation retry configuration.
Defines the list of DevBlkCDII2CPgmrGoldenValue.
NvMediaStatus DevBlkCDII2CPgmrReadArrayMaskedVerifyWithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegListWritable const *regList, DevBlkCDII2CPgmrVerifyMaskList const *const verifyMaskList, DevBlkCDII2CPgmrGoldenValueList const *const goldenValueList)
Performs read operation for a register table along with I2C Readback Masked Verification and comparin...
NvMediaStatus DevBlkCDII2CPgmrWriteUint8Verify(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint8_t data)
Writes 8-bit data to an I2C register along with I2C Readback Verification.
uint16_t data
The value of an I2C register; Valid range: [0, UINT16_MAX].
NvMediaStatus DevBlkCDII2CPgmrReadBlock(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint16_t dataLength, uint8_t *dataBuff)
Reads a block of data from I2C device.
void DevBlkCDII2CPgmrDestroy(DevBlkCDII2CPgmr i2cProgrammer)
Destroys an I2C Programmer.
Defines the structure to contain information related to polling read operation.
uint16_t address
The address of an I2C register; Valid range: [0, UINT16_MAX].
Defines the I2C register table to read from the device.
NvMediaStatus DevBlkCDII2CPgmrWriteArray(DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegList *regList)
Performs write operation for a register table.
NvMediaStatus DevBlkCDII2CPgmrReadArray(DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegListWritable *regList)
Performs read operation for a register table.
uint16_t expectedValue
The expected value to compare with masked readback data.
NvMediaStatus DevBlkCDII2CPgmrReadUint8(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint8_t *data)
Reads 8-bit data from an I2C register.
NvMediaStatus DevBlkCDII2CPgmrReadArrayVerify(DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegListWritable *regList)
Performs read operation for a register table.
NvMediaStatus DevBlkCDII2CPgmrReadUint8Verify(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint8_t *data)
Reads 8-bit data from an I2C register along with I2C Readback Verification.
const DevBlkCDII2CReg * regs
An array of DevBlkCDII2CReg structures, of length numRegs.
uint32_t delayUs
Delay between retry attempts in microseconds for this device.
NvMediaBool retryAttempted
Whether any retry attempts were made during the operation.
NvMediaStatus DevBlkCDII2CPgmrWriteArrayMaskedVerify(DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegList const *regList, DevBlkCDII2CPgmrVerifyMaskList const *const verifyMaskList)
Performs write operation for a register table along with I2C Readback Masked Verification.
NvMediaStatus DevBlkCDII2CPgmrReadUint8VerifyWithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, uint16_t const address, uint8_t *data, DevBlkCDII2CPgmrGoldenValue const *const goldenValue)
Reads 8-bit data from an I2C register along with I2C Readback Verification, and also compares the dat...
uint32_t numVerifyMasks
The number of entries in the verifyMasks array; Valid range: [0, CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE...
uint32_t numRegs
The number of registers in the regs array; Valid range: [0, UINT32_MAX].
Defines the list of register verify masks.
NvMediaBool retryEnabled
Whether retry is enabled for this device.
NvMediaStatus DevBlkCDII2CPgmrReadUint8MaskedVerifyWithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, uint16_t const address, uint8_t *data, uint8_t const verifyMask, DevBlkCDII2CPgmrGoldenValue const *const goldenValue)
Reads 8-bit data from an I2C register along with I2C Readback Masked Verification,...
NvMediaStatus(* DevBlkCDII2CWriteCb)(DevBlkCDIDevice const *const handle, uint8_t const *data, uint32_t len, const DevBlkCDII2CRetryInfo *retryInfo)
i2c WRITE transactions callback function.
NvMediaStatus DevBlkCDII2CPgmrPollReadUint8(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint8_t *data, DevBlkCDII2CPgmrPollingData const *const polling)
Repeatedly reads 8-bit data from an I2C register until the data matches with exepected value or timeo...
uint16_t mask
The mask to apply on readback data for the comparison.
uint32_t maxAttempts
Maximum number of retry attempts for this device.
NvMediaStatus DevBlkCDII2CPgmrDumpArray(DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegList *regList)
Dumps the values for all registers in the register table.
NvMediaStatus DevBlkCDII2CPgmrWriteUint8MaskedVerify(DevBlkCDII2CPgmr i2cProgrammer, uint16_t const address, uint8_t const data, uint8_t const verifyMask)
Writes 8-bit data to an I2C register along with I2C Readback Masked Verification.
uint32_t delayUsec
The number of microseconds to delay between this read/write operation and the next one; Valid range: ...
const uint16_t * verifyMasks
An array of I2C register verify masks for I2C Readback Masked Verification, of length numVerifyMasks.
NvMediaStatus(* DevBlkCDII2CReadCb)(DevBlkCDIDevice const *const handle, uint16_t address, uint8_t const *data, uint32_t len, const DevBlkCDII2CRetryInfo *retryInfo)
i2c READ transactions callback function.
NVIDIA Device Block Interface: Camera Device Interface (CDI)
uint32_t count
maximum number of iterations for polling Valid range: [0, UINT32_MAX].
NvMediaStatus(* DevBlkCDII2CSleepCb)(DevBlkCDIDevice const *const handle)
Pre-sleep notification callback function.
NvMediaStatus DevBlkCDII2CPgmrReadBlockVerify(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint16_t dataLength, uint8_t *dataBuff)
Reads a block of data from I2C device starting at a register along with I2C Readback Verification.
const DevBlkCDII2CPgmrGoldenValue * goldenValues
An array of DevBlkCDII2CPgmrGoldenValue structures, of length numGoldenValues.
NvMediaStatus DevBlkCDII2CPgmrReadArrayVerifyWithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegListWritable const *regList, DevBlkCDII2CPgmrGoldenValueList const *const goldenValueList)
Performs read operation for a register table along with I2C Readback Verification and comparing readb...
DevBlkCDII2CReg * regs
An array of DevBlkCDII2CReg structures, of length numRegs.
NvMediaStatus DevBlkCDII2CPgmrSetRetryConfig(DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRetryConfig *retryConfig)
Set the retry configuration for the I2C Programmer.
NvMediaStatus DevBlkCDII2CPgmrListenerReg(DevBlkCDII2CPgmr const i2cPrgmHandle, DevBlkCDIDevice const *const handle, DevBlkCDII2CWriteCb wrCallback, DevBlkCDII2CReadCb rdCallback, DevBlkCDII2CSleepCb sleepCallback)
Register an i2c transactions listener.
NvMediaStatus DevBlkCDII2CPgmrWriteArrayVerify(DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegList *regList)
Performs write operation for a register table.
NvMediaStatus DevBlkCDII2CPgmrWriteBlockVerify(DevBlkCDII2CPgmr const i2cProgrammer, uint16_t const address, uint8_t const *const data, uint16_t const dataLen)
Writes a block of data to i2c device starting from a register along with I2C Readback Verification.
NvMediaStatus DevBlkCDII2CPgmrReadUint16Verify(const DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint16_t *data)
Reads 16-bit data to an I2C register along with I2C Readback Verification.
uint32_t attemptsMade
Number of retry attempts made.
NvMediaStatus DevBlkCDII2CPgmrReadUint16(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint16_t *data)
Reads 16-bit data from an I2C register.
NvMediaStatus DevBlkCDII2CPgmrReadUint8MaskedVerify(DevBlkCDII2CPgmr i2cProgrammer, uint16_t const address, uint8_t *data, uint8_t const verifyMask)
Reads 8-bit data from an I2C register along with I2C Readback Masked Verification.
const WFDCommitType const WFDHandle handle
NvMediaStatus DevBlkCDII2CPgmrWriteUint16(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint16_t data)
Writes 16-bit data to an I2C register.
uint8_t mask
The Mask to apply on readback data for comparison Valid range: [0, UINT8_MAX].
NvMediaStatus DevBlkCDII2CPgmrWriteUint16Verify(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint16_t data)
Writes 16-bit data to an I2C register along with I2C Readback Verification.
NvMediaStatus DevBlkCDII2CPgmrReadArrayMaskedVerify(DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegListWritable const *regList, DevBlkCDII2CPgmrVerifyMaskList const *const verifyMaskList)
Performs read operation for a register table along with I2C Readback Masked Verification.
NvMediaStatus DevBlkCDII2CPgmrReadArrayWithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegListWritable const *regList, DevBlkCDII2CPgmrGoldenValueList const *const goldenValueList)
Performs read operation for a register table, and compares readback data with corresponding golden va...
Holds the handles for an DevBlkCDIDevice object.
uint32_t delay
Delay to apply before next iteration in polling Valid range: [0, UINT32_MAX].
NvMediaStatus DevBlkCDII2CPgmrWriteUint8(DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint8_t data)
Writes 8-bit data to an I2C register.
NvMediaStatus DevBlkCDII2CPgmrReadUint16WithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, uint16_t const address, uint16_t *data, DevBlkCDII2CPgmrGoldenValue const *const goldenValue)
Reads 16-bit data from an I2C register and compares it with golden value.
NvMediaStatus DevBlkCDII2CPgmrDebugLogControl(DevBlkCDII2CPgmr i2cProgrammer, NvMediaBool enable)
Enables debug logs for I2C Programmer.
void * DevBlkCDII2CPgmr
An opaque handle for an I2C programmer object.
NvMediaStatus DevBlkCDII2CPgmrWriteBlock(DevBlkCDII2CPgmr const i2cProgrammer, uint16_t const address, uint8_t const *const data, uint16_t const dataLen)
Writes an array to i2c device starting from a register.
DevBlkCDII2CPgmr DevBlkCDII2CPgmrCreate(DevBlkCDIDevice *handle, const uint8_t addrLength, const uint8_t dataLength)
Creates an I2C Programmer to read/write I2C registers of a device.
Defines the I2C register table to write to the device.
Defines the I2C address/data pair and an optional delay.
uint32_t numGoldenValues
The number of DevBlkCDII2CPgmrGoldenValue entries in the goldenValues array; Valid range: [0,...
NvMediaStatus DevBlkCDII2CPgmrReadUint8WithGoldenValue(DevBlkCDII2CPgmr i2cProgrammer, uint16_t const address, uint8_t *data, DevBlkCDII2CPgmrGoldenValue const *const goldenValue)
Reads 8-bit data from an I2C register and compares it with golden value.
uint32_t numRegs
The number of registers in the regs array; Valid range: [0, UINT32_MAX].
I2C operation retry information.