NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
Camera Device Interface I2C Programmer

Detailed Description

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 voidDevBlkCDII2CPgmr
 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...
 

Macro Definition Documentation

◆ CDI_I2C_MASKED_VERIFY_MAX_ARRAY_SIZE

#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.

◆ CDI_I2C_MAX_BATCH_SIZE

#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.

◆ I2C_ARRAY_SIZE

#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 Documentation

◆ DevBlkCDII2CPgmr

An opaque handle for an I2C programmer object.

Definition at line 183 of file devblk_cdi_i2c.h.

◆ DevBlkCDII2CReadCb

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.

Precondition
Parameters
[in]handleA pointer to the device that registered a listener. Valid value: [non-NULL].
[in]addressA start address in device register space for which the read transaction was done.
[in]dataA buffer pointer containing data which was just read from i2c bus by a corresponding i2cProgrammer. Valid value: [non-NULL].
[in]lenLength of i2c read transaction buffer pointed to by data. Valid range: [>0].
Return values
NVMEDIA_STATUS_OKIf listener processed notification successfully.
(NvMediaStatus)for any listener-specific error while processing notification.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: no
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

Definition at line 278 of file devblk_cdi_i2c.h.

◆ DevBlkCDII2CSleepCb

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.

Precondition
Parameters
[in]handleA pointer to the device that registered a listener. Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf listener processed notification successfully.
(NvMediaStatus)for any listener-specific error while processing notification.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

Definition at line 323 of file devblk_cdi_i2c.h.

◆ DevBlkCDII2CWriteCb

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.

Precondition
Parameters
[in]handleA pointer to the device that registered a listener. Valid value: [non-NULL].
[in]dataA buffer pointer containing data which was just sent over i2c bus by a corresponding i2cProgrammer. Valid value: [non-NULL].
[in]lenLength of i2c write transaction buffer pointed to by data; Valid range: [>0].
Return values
NVMEDIA_STATUS_OKIf listener processed notification successfully.
(NvMediaStatus)for any listener-specific error while processing notification.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: no
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

Definition at line 229 of file devblk_cdi_i2c.h.

Function Documentation

◆ DevBlkCDII2CPgmrCreate()

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:

  1. Verifies all the input parameters.
  2. Allocates and initializes the context for the I2C Programmer with NvOsAlloc and NvOsMemset.
  3. Returns the handle of the new I2C Programmer.
Precondition
None
Parameters
[in]handleA pointer to the device that needs I2C access; Valid value: [non-NULL].
[in]addrLengthI2C register address length in bytes; Valid range: [1, 2].
[in]dataLengthI2C register data length in bytes; Valid range: [1, 2].
Return values
NULLIf 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.
DevBlkCDII2CPgmrAn opaque handle of an I2C programmer object. If not returns NULL.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ DevBlkCDII2CPgmrDebugLogControl()

NvMediaStatus DevBlkCDII2CPgmrDebugLogControl ( DevBlkCDII2CPgmr  i2cProgrammer,
NvMediaBool  enable 
)

Enables debug logs for I2C Programmer.

Precondition
i2cProgrammer must be valid DevBlkCDII2CPgmr handle created with DevBlkCDII2CPgmrCreate().
Parameters
[in]i2cProgrammerDevice handle for I2C Programmer.
[in]enableflag to enable/disable debug logs.
Return values
NVMEDIA_STATUS_OKIf enable/disable debug log is successful.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrDestroy()

void DevBlkCDII2CPgmrDestroy ( DevBlkCDII2CPgmr  i2cProgrammer)

Destroys an I2C Programmer.

This API does the following:

  1. Releases all the resources allocated when the I2C Programmer is created with NvOsFree.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer to destroy. Valid value: [non-NULL].
Usage considerations
  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: No
    • Runtime: No
    • De-Init: Yes

◆ DevBlkCDII2CPgmrDumpArray()

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.

Precondition
i2cProgrammer must be valid DevBlkCDII2CPgmr handle created with DevBlkCDII2CPgmrCreate().
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer.
[in]regListPointer to the register table.
Return values
NVMEDIA_STATUS_OKIf read from register is successful.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.
NVMEDIA_STATUS_ERRORIf the devctl IPC call to CamI2C device node failed.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrListenerReg()

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.

Precondition
None
Parameters
[in]i2cPrgmHandleAn opaque handle for I2C Programmer. Valid value: [non-NULL].
[in]handleA 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]wrCallbackA pointer to a callback function to be called after i2c write. Valid value: a pointer to DevBlkCDII2CWriteCb function or NULL.
[in]rdCallbackA pointer to a callback function to be called after i2c read. Valid value: a pointer to DevBlkCDII2CReadCb function or NULL.
[in]sleepCallbackA 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.
Return values
NVMEDIA_STATUS_OKIf listener was registered successfully. The number of listeners < the maximum number of listeners.
NVMEDIA_STATUS_OUT_OF_MEMORYIf no more listeners can be registered on a given i2cProgrammer. The number of listeners >= the maximum number of listeners.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: Yes

◆ DevBlkCDII2CPgmrPollReadUint8()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
[in]pollingA 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].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data or polling was NULL.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadArray()

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:

Precondition
In order to store the read register values, the register table should be declared using DevBlkCDII2CRegListWritable structure.
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in,out]regListA pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadArrayMaskedVerify()

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:

Precondition
In order to store the read register values, the register table should be declared using DevBlkCDII2CRegListWritable structure.
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in,out]regListA pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL].
[in]verifyMaskListA pointer to DevBlkCDII2CPgmrVerifyMaskList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf 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_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadArrayMaskedVerifyWithGoldenValue()

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:

Precondition
In order to store the read register values, the register table should be declared using DevBlkCDII2CRegListWritable structure.
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in,out]regListA pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL].
[in]verifyMaskListA pointer to DevBlkCDII2CPgmrVerifyMaskList; Valid value: [non-NULL].
[in]goldenValueListA pointer to the list of DevBlkCDII2CPgmrGoldenValueList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf 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_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadArrayVerify()

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:

Precondition
In order to store the read register values, the register table should be declared using DevBlkCDII2CRegListWritable structure.
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in,out]regListA pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadArrayVerifyWithGoldenValue()

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:

Precondition
In order to store the read register values, the register table should be declared using DevBlkCDII2CRegListWritable structure.
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in,out]regListA pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL].
[in]goldenValueListA pointer to the list of DevBlkCDII2CPgmrGoldenValueList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf 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_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadArrayWithGoldenValue()

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:

Precondition
In order to store the read register values, the register table should be declared using DevBlkCDII2CRegListWritable structure.
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in,out]regListA pointer to the register table DevBlkCDII2CRegListWritable; Valid value: [non-NULL].
[in]goldenValueListA pointer to the list of DevBlkCDII2CPgmrGoldenValueList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf 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_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadBlock()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]dataLengthSize of the data to read; Valid range: [1, MAX_CamI2C_I2C_BUFFER].
[out]dataBuffA pointer to a buffer that must be bigger than dataLength bytes to hold all the read values from the device; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or dataBuff was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadBlockVerify()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]dataLengthSize of the data to read; Valid range: [1, MAX_CamI2C_I2C_BUFFER].
[out]dataBuffA pointer to a buffer that must be bigger than dataLength bytes to hold all the read values from the device; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or dataBuff was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint16()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to a 16-bit buffer that holds the read value; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint16Verify()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to a 16-bit buffer that holds the read value; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint16WithGoldenValue()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to a 16-bit buffer that holds the read value; Valid value: [non-NULL].
[in]goldenValueA pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and corresponding mask for comparing read data; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register along with matching read data with golden value is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL or goldenValue was NULL.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint8()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint8MaskedVerify()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
[in]verifyMask8-bit register verify mask; Valid range: [0, UINT8_MAX]
Return values
NVMEDIA_STATUS_OKIf read from register along with I2C Readback Masked Verification is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint8MaskedVerifyWithGoldenValue()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
[in]verifyMask8-bit register mask; Valid range: [0, UINT8_MAX]
[in]goldenValueA pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and corresponding mask for comparing read data; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf i2cProgrammer or data was NULL or goldenValue was NULL.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint8Verify()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint8VerifyWithGoldenValue()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
[in]goldenValueA pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and mask for comparing read data; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf i2cProgrammer or data was NULL or goldenValue was NULL.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrReadUint8WithGoldenValue()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[out]dataA pointer to an 8-bit buffer that holds the read value; Valid value: [non-NULL].
[in]goldenValueA pointer to DevBlkCDII2CPgmrGoldenValue which contains golden value and corresponding mask for comparing read data; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf read from register along with matching readback data with golden value is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL or goldenValue was NULL.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteArray()

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:

  • An entry in the register list has a delayUsec from DevBlkCDII2CReg > 0. In this case the batch is immediately flushed and the thread is put to sleep for the specified time.
  • The batch size reaches CDI_I2C_MAX_BATCH_SIZE.
  • The final entry in the register list has been reached.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]regListA pointer to the register table DevBlkCDII2CRegList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf write to register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteArrayMaskedVerify()

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:

  • An entry in the register list has a delayUsec from DevBlkCDII2CReg > 0. In this case the batch is immediately flushed and the thread is put to sleep for the specified time.
  • The batch size reaches CDI_I2C_MAX_BATCH_SIZE.
  • The final entry in the register list has been reached.

To improve efficiency for readbacks, this function batches them from the hardware in one of two situations:

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]regListA pointer to the register table DevBlkCDII2CRegList; Valid value: [non-NULL].
[in]verifyMaskListA pointer to the DevBlkCDII2CPgmrVerifyMaskList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf 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_PARAMETERIf 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_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteArrayVerify()

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:

  • An entry in the register list has a delayUsec from DevBlkCDII2CReg > 0. In this case the batch is immediately flushed and the thread is put to sleep for the specified time.
  • The batch size reaches CDI_I2C_MAX_BATCH_SIZE.
  • The final entry in the register list has been reached.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]regListA pointer to the register table DevBlkCDII2CRegList; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKIf write to register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteBlock()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit starting register address; Valid range: [0, UINT16_MAX].
[in]dataa pointer to an array to send over i2c; Valid range: [non-NULL].
[in]dataLenlength of an array to write; Valid range: [0, UINT16_MAX].
Return values
NVMEDIA_STATUS_OKIf write to register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteBlockVerify()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit starting register address; Valid range: [0, UINT16_MAX].
[in]dataa pointer to an array to send over i2c; Valid range: [non-NULL].
[in]dataLenlength of an array to write; Valid range: [0, UINT16_MAX].
Return values
NVMEDIA_STATUS_OKIf write to register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteUint16()

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:

  1. Verifies all the input parameters.
  2. Calls CamI2C to write a 16-bit data to an I2C register.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]data16-bit register data; Valid range: [0, UINT16_MAX].
Return values
NVMEDIA_STATUS_OKIf write to register is successful.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.
NVMEDIA_STATUS_ERRORIf the devctl IPC call to CamI2C device node failed.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteUint16Verify()

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.

Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer, Pointer to DevBlkCDII2CPgmr handle; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]data16-bit register data; Valid range: [0, UINT16_MAX]
Return values
NVMEDIA_STATUS_OKIf write to register is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf i2cProgrammer or data was NULL.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteUint8()

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:

  1. Verifies all the input parameters.
  2. Calls CamI2C to write an 8-bit data to an I2C register.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]data8-bit register data; Valid range: [0, UINT8_MAX]
Return values
NVMEDIA_STATUS_OKIf write to register is successful.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.
NVMEDIA_STATUS_ERRORIf the devctl IPC call to CamI2C device node failed.
(NvMediaStatus)An error code returned by the dependencies in case of failure.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteUint8MaskedVerify()

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:

  1. Verifies all the input parameters.
  2. Calls CamI2C to write an 8-bit data to an I2C register.
  3. Calls CamI2C again to readback an 8-bit data from same I2C register.
  4. Compares masked bits of both data.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]data8-bit register data; Valid range: [0, UINT8_MAX]
[in]verifyMask8-bit register verification mask; Valid range: [0, UINT8_MAX]
Return values
NVMEDIA_STATUS_OKIf write to register along with I2C Readback Masked verification is successful or if the handle is in simulator mode.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes

◆ DevBlkCDII2CPgmrWriteUint8Verify()

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:

  1. Verifies all the input parameters.
  2. Calls CamI2C to write an 8-bit data to an I2C register.
  3. The call to CamI2C also requests I2C Readback verification.
Precondition
None
Parameters
[in]i2cProgrammerAn opaque handle for I2C Programmer; Valid value: [non-NULL].
[in]address16-bit register address; Valid range: [0, UINT16_MAX].
[in]data8-bit register data; Valid range: [0, UINT8_MAX]
Return values
NVMEDIA_STATUS_OKIf write to register is successful.
NVMEDIA_STATUS_BAD_PARAMETERIf one or more params was NULL or invalid.
NVMEDIA_STATUS_ERRORIf 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

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: No
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: Yes, with the following conditions:
    • Grants: nonroot, allow
    • Abilities: public_channel
    • Application needs to have access to the SGIDs that SIPL depends on as mentioned in the NVIDIA DRIVE OS Safety Developer Guide
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes