The Camera Device Interface I2C Programmer API encompasses all I2C related functions for programming all I2C controlled components such as deserializers, serializers, EEPROMs, and image sensors.
Data Structures | |
| struct | DevBlkCDII2CReg |
| Defines the I2C address/data pair and an optional delay. More... | |
| struct | DevBlkCDII2CRegList |
| Defines the I2C register table to write to the device. More... | |
| struct | DevBlkCDII2CRegListWritable |
| Defines the I2C register table to read from the device. More... | |
| struct | DevBlkCDII2CPgmrVerifyMaskList |
| Defines the list of register verify masks. More... | |
| struct | DevBlkCDII2CPgmrGoldenValue |
| Defines mask and value pair for comparing readback data. More... | |
| struct | DevBlkCDII2CPgmrGoldenValueList |
| Defines the list of DevBlkCDII2CPgmrGoldenValue. More... | |
| struct | DevBlkCDII2CPgmrPollingData |
| Defines the structure to contain information related to polling read operation. More... | |
Macros | |
| #define | I2C_ARRAY_SIZE(x) (uint32_t)(sizeof(x) / sizeof((x)[0])) |
| Macro for determining the number of address/data pairs in a register table. More... | |
| #define | CDI_I2C_MAX_BATCH_SIZE 16U |
| The maximum number of i2c commands for performing an I2C bulk read/write. More... | |
| #define | CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE 240U |
| The maximum array size for register list, verify masks, and golden value arrays used in I2C Masked Verification APIs. More... | |
Typedefs | |
| typedef void * | DevBlkCDII2CPgmr |
| An opaque handle for an I2C programmer object. More... | |
| typedef NvMediaStatus(* | DevBlkCDII2CWriteCb) (DevBlkCDIDevice const *const handle, uint8_t const *data, uint32_t len) |
| i2c WRITE transactions callback function. More... | |
| typedef NvMediaStatus(* | DevBlkCDII2CReadCb) (DevBlkCDIDevice const *const handle, uint16_t address, uint8_t const *data, uint32_t len) |
| i2c READ transactions callback function. More... | |
| typedef NvMediaStatus(* | DevBlkCDII2CSleepCb) (DevBlkCDIDevice const *const handle) |
| Pre-sleep notification callback function. More... | |
Functions | |
| DevBlkCDII2CPgmr | DevBlkCDII2CPgmrCreate (DevBlkCDIDevice *handle, const uint8_t addrLength, const uint8_t dataLength) |
| Creates an I2C Programmer to read/write I2C registers of a device. More... | |
| void | DevBlkCDII2CPgmrDestroy (DevBlkCDII2CPgmr i2cProgrammer) |
| Destroys an I2C Programmer. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrListenerReg (DevBlkCDII2CPgmr const i2cPrgmHandle, DevBlkCDIDevice const *const handle, DevBlkCDII2CWriteCb wrCallback, DevBlkCDII2CReadCb rdCallback, DevBlkCDII2CSleepCb sleepCallback) |
| Register an i2c transactions listener. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrWriteUint8 (DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint8_t data) |
| Writes 8-bit data to an I2C register. More... | |
| 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. More... | |
| 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. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrWriteUint16 (DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint16_t data) |
| Writes 16-bit data to an I2C register. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadUint8 (DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint8_t *data) |
| Reads 8-bit data from an I2C register. More... | |
| 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. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadUint8Verify (DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint8_t *data) |
| Reads 8-bit data from an I2C register along with I2C Readback Verification. More... | |
| 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 data with golden value. More... | |
| 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. More... | |
| 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, and also compares the data with golden value. More... | |
| 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 timeout. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadUint16 (DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, uint16_t *data) |
| Reads 16-bit data from an I2C register. More... | |
| 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. More... | |
| 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. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrWriteArray (DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegList *regList) |
| Performs write operation for a register table. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrWriteArrayVerify (DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegList *regList) |
| Performs write operation for a register table. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrWriteArrayMaskedVerify (DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegList const *regList, DevBlkCDII2CPgmrVerifyMaskList const *const verifyMaskList) |
| Performs write operation for a register table along with I2C Readback Masked Verification. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadArray (DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegListWritable *regList) |
| Performs read operation for a register table. More... | |
| 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 value. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadArrayVerify (DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegListWritable *regList) |
| Performs read operation for a register table. More... | |
| 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 readback data with golden value. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadArrayMaskedVerify (DevBlkCDII2CPgmr i2cProgrammer, DevBlkCDII2CRegListWritable const *regList, DevBlkCDII2CPgmrVerifyMaskList const *const verifyMaskList) |
| Performs read operation for a register table along with I2C Readback Masked Verification. More... | |
| 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 comparing the readback data with golden value. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrReadBlock (DevBlkCDII2CPgmr i2cProgrammer, const uint16_t address, const uint16_t dataLength, uint8_t *dataBuff) |
| Reads a block of data from I2C device. More... | |
| 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. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrDumpArray (DevBlkCDII2CPgmr i2cProgrammer, const DevBlkCDII2CRegList *regList) |
| Dumps the values for all registers in the register table. More... | |
| NvMediaStatus | DevBlkCDII2CPgmrDebugLogControl (DevBlkCDII2CPgmr i2cProgrammer, NvMediaBool enable) |
| Enables debug logs for I2C Programmer. More... | |
| #define CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE 240U |
The maximum array size for register list, verify masks, and golden value arrays used in I2C Masked Verification APIs.
Definition at line 56 of file devblk_cdi_i2c.h.
| #define CDI_I2C_MAX_BATCH_SIZE 16U |
The maximum number of i2c commands for performing an I2C bulk read/write.
DO NOT MODIFY - Although core I2C driver does not define any hard limit as such but sensor authentication step has peculiar dependency on this size, so do not modify without updating corresponding dependencies in sensor drivers' authentication code.
Definition at line 50 of file devblk_cdi_i2c.h.
| #define I2C_ARRAY_SIZE | ( | x | ) | (uint32_t)(sizeof(x) / sizeof((x)[0])) |
Macro for determining the number of address/data pairs in a register table.
This macro should be used by the device driver to set DevBlkCDII2CRegList::numRegs.
Do not use this macro when referencing register tables through pointers, otherwise the wrong number of address/data pairs will be returned.
Definition at line 41 of file devblk_cdi_i2c.h.
| typedef void* DevBlkCDII2CPgmr |
An opaque handle for an I2C programmer object.
Definition at line 183 of file devblk_cdi_i2c.h.
| typedef NvMediaStatus(* DevBlkCDII2CReadCb) (DevBlkCDIDevice const *const handle, uint16_t address, uint8_t const *data, uint32_t len) |
i2c READ transactions callback function.
Callback type used by i2cProgrammer listeners. DevBlkCDII2CPgmrListenerReg is used to register a callback with i2cProgrammer.
The callback is called by i2cProgrammer after every successful i2c read transaction performed by the i2cProgrammer, passing i2c read data which was received over i2c.
The callback is expected to be safe for re-entrancy.
| [in] | handle | A pointer to the device that registered a listener. Valid value: [non-NULL]. |
| [in] | address | A start address in device register space for which the read transaction was done. |
| [in] | data | A buffer pointer containing data which was just read from i2c bus by a corresponding i2cProgrammer. Valid value: [non-NULL]. |
| [in] | len | Length of i2c read transaction buffer pointed to by data. Valid range: [>0]. |
| NVMEDIA_STATUS_OK | If listener processed notification successfully. |
| (NvMediaStatus) | for any listener-specific error while processing notification. |
Usage considerations
Definition at line 278 of file devblk_cdi_i2c.h.
| typedef NvMediaStatus(* DevBlkCDII2CSleepCb) (DevBlkCDIDevice const *const handle) |
Pre-sleep notification callback function.
Callback type used by i2cProgrammer listeners. DevBlkCDII2CPgmrListenerReg is used to register a callback with i2cProgrammer.
The callback is called by i2cProgrammer before the programmer enters a sleep during a sequence of I2C writes. Usually sleep is required to make sure previous I2C writes are effective before issuing next i2c writes. Listener has a chance to perform driver-specific actions before sleeping.
The callback is expected to be safe for re-entrancy.
| [in] | handle | A pointer to the device that registered a listener. Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If listener processed notification successfully. |
| (NvMediaStatus) | for any listener-specific error while processing notification. |
Usage considerations
Definition at line 323 of file devblk_cdi_i2c.h.
| typedef NvMediaStatus(* DevBlkCDII2CWriteCb) (DevBlkCDIDevice const *const handle, uint8_t const *data, uint32_t len) |
i2c WRITE transactions callback function.
Callback type used by i2cProgrammer listeners. DevBlkCDII2CPgmrListenerReg is used to register a callback with i2cProgrammer.
The callback is called by i2cProgrammer after every successful i2c write transaction performed by the i2cProgrammer, passing i2c write data which was sent over i2c.
The callback is expected to be safe for re-entrancy.
| [in] | handle | A pointer to the device that registered a listener. Valid value: [non-NULL]. |
| [in] | data | A buffer pointer containing data which was just sent over i2c bus by a corresponding i2cProgrammer. Valid value: [non-NULL]. |
| [in] | len | Length of i2c write transaction buffer pointed to by data; Valid range: [>0]. |
| NVMEDIA_STATUS_OK | If listener processed notification successfully. |
| (NvMediaStatus) | for any listener-specific error while processing notification. |
Usage considerations
Definition at line 229 of file devblk_cdi_i2c.h.
| DevBlkCDII2CPgmr DevBlkCDII2CPgmrCreate | ( | DevBlkCDIDevice * | handle, |
| const uint8_t | addrLength, | ||
| const uint8_t | dataLength | ||
| ) |
Creates an I2C Programmer to read/write I2C registers of a device.
This API does the following:
| [in] | handle | A pointer to the device that needs I2C access; Valid value: [non-NULL]. |
| [in] | addrLength | I2C register address length in bytes; Valid range: [1, 2]. |
| [in] | dataLength | I2C register data length in bytes; Valid range: [1, 2]. |
| NULL | If pointer of the device handle is NULL or addrLength value out of range or datalength value out of range or handle is NULL or the dependencies returned fail. |
| DevBlkCDII2CPgmr | An opaque handle of an I2C programmer object. If not returns NULL. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrDebugLogControl | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| NvMediaBool | enable | ||
| ) |
Enables debug logs for I2C Programmer.
| [in] | i2cProgrammer | Device handle for I2C Programmer. |
| [in] | enable | flag to enable/disable debug logs. |
| NVMEDIA_STATUS_OK | If enable/disable debug log is successful. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
Usage considerations
| void DevBlkCDII2CPgmrDestroy | ( | DevBlkCDII2CPgmr | i2cProgrammer | ) |
Destroys an I2C Programmer.
This API does the following:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer to destroy. Valid value: [non-NULL]. Usage considerations
|
| NvMediaStatus DevBlkCDII2CPgmrDumpArray | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const DevBlkCDII2CRegList * | regList | ||
| ) |
Dumps the values for all registers in the register table.
The register table consists of multiple register address/data pairs. This function will dump the I2C regsister value for each address/data pair for debugging purpose.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer. |
| [in] | regList | Pointer to the register table. |
| NVMEDIA_STATUS_OK | If read from register is successful. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrListenerReg | ( | DevBlkCDII2CPgmr const | i2cPrgmHandle, |
| DevBlkCDIDevice const *const | handle, | ||
| DevBlkCDII2CWriteCb | wrCallback, | ||
| DevBlkCDII2CReadCb | rdCallback, | ||
| DevBlkCDII2CSleepCb | sleepCallback | ||
| ) |
Register an i2c transactions listener.
Register Read and/or Write notification callbacks on the i2cProgrammer. wrCallback is invoked by i2cProgrammer after each successful i2c Write transaction to the device, providing data buffer which was sent over i2c. rdCallback is invoked by i2cProgrammer after each successful i2c Read transaction with the device, providing data buffer which was read from i2c.
| [in] | i2cPrgmHandle | An opaque handle for I2C Programmer. Valid value: [non-NULL]. |
| [in] | handle | A handle for a CDI device with registers as a listener. The handle is passed as a parameter to RD and WR callabcks. Valid value: [non-NULL]. |
| [in] | wrCallback | A pointer to a callback function to be called after i2c write. Valid value: a pointer to DevBlkCDII2CWriteCb function or NULL. |
| [in] | rdCallback | A pointer to a callback function to be called after i2c read. Valid value: a pointer to DevBlkCDII2CReadCb function or NULL. |
| [in] | sleepCallback | A pointer to a callback function to be called before and after the programmer enters a sleep. Valid value: a pointer to DevBlkCDII2CSleepCb function or NULL. |
| NVMEDIA_STATUS_OK | If listener was registered successfully. The number of listeners < the maximum number of listeners. |
| NVMEDIA_STATUS_OUT_OF_MEMORY | If no more listeners can be registered on a given i2cProgrammer. The number of listeners >= the maximum number of listeners. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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 timeout.
This API periodically reads an 8-bit data from an I2C register until the data matches with expected value or max polling time is reached. After each successful read if there is mismatch with expected value thread is put to sleep for the specified time before next read attempt.
API calls CamI2C to read an 8-bit data from an I2C register.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| [in] | polling | A pointer to DevBlkCDII2CPgmrPollingData containing information like max iterations, delay per iteration, custom mask and value to compare the readback data with etc. for polling operation. Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data or polling was NULL. |
| NVMEDIA_STATUS_ERROR | If max polling time is reached without data matching the expected value. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadArray | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const DevBlkCDII2CRegListWritable * | regList | ||
| ) |
Performs read operation for a register table.
This function calls CamI2C to read each of the registers in a register table.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to read a sequence of I2C register values. To improve efficiency, this function batches reads from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in,out] | regList | A pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadArrayMaskedVerify | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| DevBlkCDII2CRegListWritable const * | regList, | ||
| DevBlkCDII2CPgmrVerifyMaskList const *const | verifyMaskList | ||
| ) |
Performs read operation for a register table along with I2C Readback Masked Verification.
This API calls CamI2C to read each of the registers in a register table and calls CamI2C again to read each of the registers from same register table. Then compares masked bits of data from both the read calls for each register in register table.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to read a sequence of I2C register values. To improve efficiency, this function batches reads from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in,out] | regList | A pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL]. |
| [in] | verifyMaskList | A pointer to DevBlkCDII2CPgmrVerifyMaskList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with I2C Readback Verification for all registers in regList is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 or The number of registers is greater than CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE or verifyMaskList was NULL or The DevBlkCDII2CPgmrVerifyMaskList::verifyMasks stored in verifyMaskList was NULL or If DevBlkCDII2CPgmrVerifyMaskList::numVerifyMasks stored in verifyMaskList is not same as DevBlkCDII2CRegListWritable::numRegs stored in regList. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or I2C Readback Masked Verification failed for any of the registers in regList. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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 comparing the readback data with golden value.
This API calls CamI2C to read each of the registers in a register table and calls CamI2C again to read each of the registers from same register table. Then compares masked bits of data from both the read calls for each register in register table. In addition, this API also compares the DevBlkCDII2CPgmrGoldenValue::mask bits of read data with DevBlkCDII2CPgmrGoldenValue::expectedValue provided by the caller for each register in the register table.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to read a sequence of I2C register values. To improve efficiency, this function batches reads from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in,out] | regList | A pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL]. |
| [in] | verifyMaskList | A pointer to DevBlkCDII2CPgmrVerifyMaskList; Valid value: [non-NULL]. |
| [in] | goldenValueList | A pointer to the list of DevBlkCDII2CPgmrGoldenValueList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with I2C Readback Masked Verification and matching readback data with golden value for all the registers in regList is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 or The number of registers is greater than CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE or verifyMaskList was NULL or The DevBlkCDII2CPgmrVerifyMaskList::verifyMasks stored in verifyMaskList was NULL or goldenValueList was NULL or The DevBlkCDII2CPgmrGoldenValueList::goldenValues stored in goldenValueList was NULL or If DevBlkCDII2CPgmrVerifyMaskList::numVerifyMasks stored in verifyMaskList and DevBlkCDII2CPgmrGoldenValueList::numGoldenValues stored in goldenValueList are not same as DevBlkCDII2CRegListWritable::numRegs stored in regList. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or The I2C Readback Masked Verification failed for any of the registers in the regList or The readback data did not match with corresponding golden value for any of the registers in the regList. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadArrayVerify | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const DevBlkCDII2CRegListWritable * | regList | ||
| ) |
Performs read operation for a register table.
This function calls CamI2C to read each of the registers in a register table and also requests I2C readback verification from CamI2C.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to read a sequence of I2C register values. To improve efficiency, this function batches reads from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in,out] | regList | A pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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 readback data with golden value.
This function calls CamI2C to read each of the registers in a register table and also requests I2C readback verification from CamI2C. In addition to above, API also compares the DevBlkCDII2CPgmrGoldenValue::mask bits of readback data with DevBlkCDII2CPgmrGoldenValue::expectedValue provided by caller.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to read a sequence of I2C register values. To improve efficiency, this function batches reads from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in,out] | regList | A pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL]. |
| [in] | goldenValueList | A pointer to the list of DevBlkCDII2CPgmrGoldenValueList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with I2C Readback Verification and matching read data with golden value for all registers in the regList is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 or goldenValueList was NULL or The DevBlkCDII2CPgmrGoldenValueList::goldenValues stored in goldenValueList was NULL or If DevBlkCDII2CPgmrGoldenValueList::numGoldenValues stored in goldenValueList is not same as DevBlkCDII2CRegListWritable::numRegs stored in regList. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or The readback data did not match with corresponding golden value for any of the registers in the regList. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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 value.
This function calls CamI2C to read each of the registers in a register table. Then compares the DevBlkCDII2CPgmrGoldenValue::mask bits of readback data with DevBlkCDII2CPgmrGoldenValue::expectedValue provided by caller.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to read a sequence of I2C register values. To improve efficiency, this function batches reads from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in,out] | regList | A pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL]. |
| [in] | goldenValueList | A pointer to the list of DevBlkCDII2CPgmrGoldenValueList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register and matching read data with golden value for all registers in the regList is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 or goldenValueList was NULL or The DevBlkCDII2CPgmrGoldenValueList::goldenValues stored in goldenValueList was NULL or If DevBlkCDII2CPgmrGoldenValueList::numGoldenValues stored in goldenValueList is not same as DevBlkCDII2CRegListWritable::numRegs stored in regList. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or The readback data did not match with corresponding golden value for any of the registers in the regList. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadBlock | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const uint16_t | address, | ||
| const uint16_t | dataLength, | ||
| uint8_t * | dataBuff | ||
| ) |
Reads a block of data from I2C device.
This function calls CamI2C to read data from consecutive register addresses. It is best used for reading a block of data from devices like EEPROM.
To improve performance, this function performs the I2C bulk read operation, by specifying the starting address and the length of data in bytes.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | dataLength | Size of the data to read; Valid range: [1, MAX_CamI2C_I2C_BUFFER]. |
| [out] | dataBuff | A pointer to a buffer that must be bigger than dataLength bytes to hold all the read values from the device; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or dataBuff was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This function calls CamI2C to read data from consecutive register addresses. It is best used for reading a block of data from devices like EEPROM. The call to CamI2C also requests I2C Readback verification.
To improve performance, this function performs the I2C bulk read operation, by specifying the starting address and the length of data in bytes.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | dataLength | Size of the data to read; Valid range: [1, MAX_CamI2C_I2C_BUFFER]. |
| [out] | dataBuff | A pointer to a buffer that must be bigger than dataLength bytes to hold all the read values from the device; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or dataBuff was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadUint16 | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const uint16_t | address, | ||
| uint16_t * | data | ||
| ) |
Reads 16-bit data from an I2C register.
This API Calls CamI2C to read a 16-bit data from an I2C register.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to a 16-bit buffer that holds the read value; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to read an 16-bit data to an I2C register. The call to CamI2C also requests I2C Readback verification.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to a 16-bit buffer that holds the read value; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to read a 16-bit data from an I2C register and also compares the DevBlkCDII2CPgmrGoldenValue::mask bits of the data with the DevBlkCDII2CPgmrGoldenValue::expectedValue provided by the caller.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to a 16-bit buffer that holds the read value; Valid value: [non-NULL]. |
| [in] | goldenValue | A pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and corresponding mask for comparing read data; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with matching read data with golden value is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL or goldenValue was NULL. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or The read data from register did not match with golden value. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadUint8 | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const uint16_t | address, | ||
| uint8_t * | data | ||
| ) |
Reads 8-bit data from an I2C register.
This API Calls CamI2C to read an 8-bit data from an I2C register.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to read an 8-bit data from an I2C register. API Calls CamI2C again to read an 8-bit data from same I2C register, and performs I2C Readback Masked Verification by comparing masked bits of data from both I2C Read calls.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| [in] | verifyMask | 8-bit register verify mask; Valid range: [0, UINT8_MAX] |
| NVMEDIA_STATUS_OK | If read from register along with I2C Readback Masked Verification is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or I2C Readback Masked Verification failed. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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, and also compares the data with golden value.
This API Calls CamI2C to read an 8-bit data from an I2C register. The API Calls CamI2C again to read an 8-bit data from same I2C register, and performs I2C Readback Masked Verification by comparing masked bits of data from both the I2C Read calls. In addition, this API also compares the DevBlkCDII2CPgmrGoldenValue::mask bits of read data with DevBlkCDII2CPgmrGoldenValue::expectedValue provided by the caller.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| [in] | verifyMask | 8-bit register mask; Valid range: [0, UINT8_MAX] |
| [in] | goldenValue | A pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and corresponding mask for comparing read data; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with I2C Readback Masked Verification and matching read data with golden value is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL or goldenValue was NULL. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or I2C Readback Masked Verification failed or The read data from register did not match with golden value. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrReadUint8Verify | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const uint16_t | address, | ||
| uint8_t * | data | ||
| ) |
Reads 8-bit data from an I2C register along with I2C Readback Verification.
This API Calls CamI2C to read an 8-bit data from an I2C register. The call to CamI2C also requests I2C Readback verification.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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 data with golden value.
This API Calls CamI2C to read an 8-bit data from an I2C register. The call to CamI2C also requests I2C Readback verification. In addition, API also compares the DevBlkCDII2CPgmrGoldenValue::mask bits of the read data with DevBlkCDII2CPgmrGoldenValue::expectedValue provided by the caller.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| [in] | goldenValue | A pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and mask for comparing read data; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with I2C Readback Verification and matching readback data with golden value is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL or goldenValue was NULL. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or The read data from register did not match with golden value. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to read an 8-bit data from an I2C register and also compares the masked bits of the data with golden or expected value provided by the caller.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [out] | data | A pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL]. |
| [in] | goldenValue | A pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and corresponding mask for comparing read data; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If read from register along with matching readback data with golden value is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL or goldenValue was NULL. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or The read data from register did not match with golden value. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrWriteArray | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const DevBlkCDII2CRegList * | regList | ||
| ) |
Performs write operation for a register table.
This function calls CamI2C to write each of the registers in a register table.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to program a sequence of I2C registers. To improve efficiency, this function batches writes and flushes them to the hardware in one of three situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | regList | A pointer to the register table DevBlkCDII2CRegList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If write to register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrWriteArrayMaskedVerify | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| DevBlkCDII2CRegList const * | regList, | ||
| DevBlkCDII2CPgmrVerifyMaskList const *const | verifyMaskList | ||
| ) |
Performs write operation for a register table along with I2C Readback Masked Verification.
This API calls CamI2C to write each of the registers in a register table. API calls CamI2C again to read from each of the registers in same register table. Compares masked bits of both write and read data for each register in register table.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to program a sequence of I2C registers. To improve efficiency for writes, this function batches and flushes them to the hardware in one of three situations:
To improve efficiency for readbacks, this function batches them from the hardware in one of two situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | regList | A pointer to the register table DevBlkCDII2CRegList; Valid value: [non-NULL]. |
| [in] | verifyMaskList | A pointer to the DevBlkCDII2CPgmrVerifyMaskList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If write to register along with I2C Readback Masked verification for all registers in regList is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 or The number of registers is greater than CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE or verifyMaskList was NULL or The DevBlkCDII2CPgmrVerifyMaskList::verifyMasks stored in verifyMaskList was NULL or If DevBlkCDII2CPgmrVerifyMaskList::numVerifyMasks stored in verifyMaskList is not same as DevBlkCDII2CRegListWritable::numRegs stored in regList. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or I2C Readback Masked Verification failed for any of the registers in regList. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrWriteArrayVerify | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const DevBlkCDII2CRegList * | regList | ||
| ) |
Performs write operation for a register table.
This function calls CamI2C to write each of the registers in a register table and also requests I2C readback verification from CamI2C.
The register table consists of multiple register address/data pairs. This function will use the address/data pair information to program a sequence of I2C registers. To improve efficiency, this function batches writes and flushes them to the hardware in one of three situations:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | regList | A pointer to the register table DevBlkCDII2CRegList; Valid value: [non-NULL]. |
| NVMEDIA_STATUS_OK | If write to register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer was NULL or regList was NULL or The address at the beginning of the array DevBlkCDII2CReg is NULL or The number of registers is 0 |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to write an array of values starting from a specified i2c address.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit starting register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | a pointer to an array to send over i2c; Valid range: [non-NULL]. |
| [in] | dataLen | length of an array to write; Valid range: [0, UINT16_MAX]. |
| NVMEDIA_STATUS_OK | If write to register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to write an array of values starting from a specified i2c address. The call to CamI2C also requests I2C Readback verification.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit starting register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | a pointer to an array to send over i2c; Valid range: [non-NULL]. |
| [in] | dataLen | length of an array to write; Valid range: [0, UINT16_MAX]. |
| NVMEDIA_STATUS_OK | If write to register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrWriteUint16 | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const uint16_t | address, | ||
| const uint16_t | data | ||
| ) |
Writes 16-bit data to an I2C register.
This API does the following:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | 16-bit register data; Valid range: [0, UINT16_MAX]. |
| NVMEDIA_STATUS_OK | If write to register is successful. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API Calls CamI2C to write an 16-bit data to an I2C register. The call to CamI2C also requests I2C Readback verification.
| [in] | i2cProgrammer | An opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | 16-bit register data; Valid range: [0, UINT16_MAX] |
| NVMEDIA_STATUS_OK | If write to register is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If i2cProgrammer or data was NULL. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| NvMediaStatus DevBlkCDII2CPgmrWriteUint8 | ( | DevBlkCDII2CPgmr | i2cProgrammer, |
| const uint16_t | address, | ||
| const uint8_t | data | ||
| ) |
Writes 8-bit data to an I2C register.
This API does the following:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | 8-bit register data; Valid range: [0, UINT8_MAX] |
| NVMEDIA_STATUS_OK | If write to register is successful. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API does the following:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | 8-bit register data; Valid range: [0, UINT8_MAX] |
| [in] | verifyMask | 8-bit register verification mask; Valid range: [0, UINT8_MAX] |
| NVMEDIA_STATUS_OK | If write to register along with I2C Readback Masked verification is successful or if the handle is in simulator mode. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or I2C Readback Masked Verification failed. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
| 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.
This API does the following:
| [in] | i2cProgrammer | An opaque handle for I2C Programmer; Valid value: [non-NULL]. |
| [in] | address | 16-bit register address; Valid range: [0, UINT16_MAX]. |
| [in] | data | 8-bit register data; Valid range: [0, UINT8_MAX] |
| NVMEDIA_STATUS_OK | If write to register is successful. |
| NVMEDIA_STATUS_BAD_PARAMETER | If one or more params was NULL or invalid. |
| NVMEDIA_STATUS_ERROR | If the devctl IPC call to CamI2C device node failed or if the I2C Readback Verification failed. |
| (NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations