NVIDIA DRIVE OS Linux SDK API Reference

6.0.3 Release

Detailed Description

An CDI device represents a device that is attached or linked to the root I2C port.

Data Structures

struct  DevBlkCDIAdvancedConfig
 Holds the description of the target I2C device. More...
 
struct  DevBlkCDISensorControl
 Holds the sensor control structure. More...
 

Typedefs

typedef struct DevBlkCDISensorControl DevBlkCDISensorControl
 Holds the sensor control structure. More...
 

Functions

NvMediaStatus DevBlkCDIDeviceRead (DevBlkCDIDevice const *device, uint32_t deviceIndex, uint32_t regLength, uint8_t *regData, uint32_t dataLength, uint8_t *data)
 Performs a read operation over I2C. More...
 
NvMediaStatus DevBlkCDIDeviceWrite (DevBlkCDIDevice const *device, uint32_t deviceIndex, uint32_t dataLength, const uint8_t *data)
 Performs a write operation over I2C. More...
 
NvMediaStatus DevBlkCDIGetSensorAttributes (DevBlkCDIDevice *device, DevBlkCDISensorAttributes *sensorAttr, const size_t sensorAttrStructSize)
 Queries the sensor attributes. More...
 
NvMediaStatus DevBlkCDISetSensorControls (DevBlkCDIDevice *device, const DevBlkCDISensorControl *sensorControl, const size_t sensrCtrlStructSize)
 Sets sensor control parameters. More...
 
NvMediaStatus DevBlkCDIParseEmbedDataInfo (DevBlkCDIDevice *device, const DevBlkCDIEmbeddedDataChunk *embeddedTopDataChunk, const DevBlkCDIEmbeddedDataChunk *embeddedBotDataChunk, const size_t embeddedDataChunkStructSize, DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)
 Parses sensor embedded data info and provides sensor image settings information for the captured frame. More...
 
NvMediaStatus DevBlkCDISetCameraPower (DevBlkCDIRootDevice const *device, uint8_t linkIndex, NvMediaBool enable)
 Set the camera module power. More...
 
NvMediaStatus DevBlkCDIEnableErrorReport (DevBlkCDIRootDevice const *device)
 Enable the error report. More...
 
NvMediaStatus DevBlkCDIGetDesPowerControlMethod (DevBlkCDIDevice *device, uint8_t *desPwrMethod)
 Get the deserialzer's power control method. More...
 
NvMediaStatus DevBlkCDIGetCamPowerControlMethod (DevBlkCDIDevice *device, uint8_t *camPwrMethod)
 Get the camera's power control method. More...
 

Typedef Documentation

◆ DevBlkCDISensorControl

Holds the sensor control structure.

Note

To activate a sensor control block, set the corresponding valid flag to TRUE and populate the control settings to be set.

To disable a sensor control block, set the corresponding valid flag to FALSE.

For example, to activate the white balance control block, set the wbValid flag in the wbControl structure to TRUE and populate the white balance settings to be programmed. To disable white balance control block, set the wbValid flag to FALSE.

Function Documentation

◆ DevBlkCDIDeviceRead()

NvMediaStatus DevBlkCDIDeviceRead ( DevBlkCDIDevice const *  device,
uint32_t  deviceIndex,
uint32_t  regLength,
uint8_t *  regData,
uint32_t  dataLength,
uint8_t *  data 
)

Performs a read operation over I2C.

For safety use cases, application software shall call DevBlkCDIDeviceRead() 2 times to read the contents of the same register location. If a register value is not expected to change, return values of the two reads must match.

Parameters
[in]deviceA pointer to the device to use.
[in]deviceIndexIndex of the sub-device to use
[in]regLengthLength of the register address, in bytes.
[in]regDataA pointer to the register address.
[in]dataLengthLength of data to be read, in bytes.
[out]dataA pointer to the location for storing the read data.
Return values
NVMEDIA_STATUS_OKIndicates that the operation was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that one or more pointer parameters was NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the device driver does not support this functionality.
NVMEDIA_STATUS_ERRORIndicates that any other error occurred.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No

◆ DevBlkCDIDeviceWrite()

NvMediaStatus DevBlkCDIDeviceWrite ( DevBlkCDIDevice const *  device,
uint32_t  deviceIndex,
uint32_t  dataLength,
const uint8_t *  data 
)

Performs a write operation over I2C.

For safety use cases, application software shall call DevBlkCDIDeviceRead() after calling DevBlkCDIDeviceWrite() to verify whether the write operation was successful. If a register value is not expected to change, read value must match the value written.

Parameters
[in]deviceA pointer to the device to use.
[in]deviceIndexIndex of the sub-device to use.
[in]dataLengthLength of data to be written, in bytes.
[in]dataA pointer to data to be written to device via I2C.
Returns
NvMediaStatus The completion status of the operation.
Return values
NVMEDIA_STATUS_OKIndicates that the operation was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that one or more pointer parameters was NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the device driver does not support this functionality.
NVMEDIA_STATUS_ERRORIndicates that any other error occurred.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No

◆ DevBlkCDIEnableErrorReport()

NvMediaStatus DevBlkCDIEnableErrorReport ( DevBlkCDIRootDevice const *  device)

Enable the error report.

Parameters
[in]deviceA pointer to the device to use.
Returns
NvMediaStatus The completion status of the operation. Possible values are:

◆ DevBlkCDIGetCamPowerControlMethod()

NvMediaStatus DevBlkCDIGetCamPowerControlMethod ( DevBlkCDIDevice device,
uint8_t *  camPwrMethod 
)

Get the camera's power control method.

Parameters
[in]deviceA pointer to the device to use.
Returns
NvMediaStatus The completion status of the operation. Possible values are:

◆ DevBlkCDIGetDesPowerControlMethod()

NvMediaStatus DevBlkCDIGetDesPowerControlMethod ( DevBlkCDIDevice device,
uint8_t *  desPwrMethod 
)

Get the deserialzer's power control method.

Parameters
[in]deviceA pointer to the device to use.
Returns
NvMediaStatus The completion status of the operation. Possible values are:

◆ DevBlkCDIGetSensorAttributes()

NvMediaStatus DevBlkCDIGetSensorAttributes ( DevBlkCDIDevice device,
DevBlkCDISensorAttributes *  sensorAttr,
const size_t  sensorAttrStructSize 
)

Queries the sensor attributes.

Sensor attributes are static properties like sensor name, exposure-gain ranges supported, and number of active exposures.

Note
This function invokes the device driver function specified by the call to GetSensorAttributes().
Parameters
[in]deviceA pointer to the device to use; Valid value: [non-NULL].
[out]sensorAttrA pointer to the sensor attributes structure; Valid value: [non-NULL].
[in]sensorAttrStructSizeSize of the sensorAttr, in bytes; The size must > 0.
Return values
NVMEDIA_STATUS_OKIndicates that the operation was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that one or more pointer parameters was NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the device driver does not support this functionality.
NVMEDIA_STATUS_ERRORIndicates that any other error occurred.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No

◆ DevBlkCDIParseEmbedDataInfo()

NvMediaStatus DevBlkCDIParseEmbedDataInfo ( DevBlkCDIDevice device,
const DevBlkCDIEmbeddedDataChunk *  embeddedTopDataChunk,
const DevBlkCDIEmbeddedDataChunk *  embeddedBotDataChunk,
const size_t  embeddedDataChunkStructSize,
DevBlkCDIEmbeddedDataInfo *  embeddedDataInfo,
const size_t  dataInfoStructSize 
)

Parses sensor embedded data info and provides sensor image settings information for the captured frame.

This function needs to be implemented in the sensor device driver to retrieve sensor image settings like exposure, gain and white balance gain information applied to the frame.

Note
This function invokes the device driver function specified by the call to ParseEmbedDataInfo().
Parameters
[in]deviceA pointer to the device to use; Valid value: [non-NULL].
[in]embeddedTopDataChunkA pointer to the top sensor embedded data DevBlkCDIEmbeddedDataChunk structure; Valid value: [non-NULL].
[in]embeddedBotDataChunkA pointer to the bottom sensor embedded data DevBlkCDIEmbeddedDataChunk structure; Valid value: [non-NULL].
[in]embeddedDataChunkStructSizeSize of the embeddedTopDataChunk and embeddedBotDataChunk structures, in bytes; The size must > 0.
[out]embeddedDataInfoA pointer to the parsed embedded data info structure; Valid value: [non-NULL].
[in]dataInfoStructSizeSize of the embeddedDataInfo structure, in bytes; The size must > 0.
Return values
NVMEDIA_STATUS_OKIndicates that the operation was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that one or more pointer parameters was NULL or invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the device driver does not support this functionality.
NVMEDIA_STATUS_ERRORIndicates that any other error occurred.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No

◆ DevBlkCDISetCameraPower()

NvMediaStatus DevBlkCDISetCameraPower ( DevBlkCDIRootDevice const *  device,
uint8_t  linkIndex,
NvMediaBool  enable 
)

Set the camera module power.

Parameters
[in]deviceA pointer to the device to use.
[in]linkIndexThe data link index.
[in]enableThe flag to enable/disable.
Returns
NvMediaStatus The completion status of the operation. Possible values are:

◆ DevBlkCDISetSensorControls()

NvMediaStatus DevBlkCDISetSensorControls ( DevBlkCDIDevice device,
const DevBlkCDISensorControl sensorControl,
const size_t  sensrCtrlStructSize 
)

Sets sensor control parameters.

This function needs to be implemented in the sensor device driver to control sensor image settings like exposure time, sensor gain, and white balance gain. All parameters provided to this function are applied together at a frame boundary through the "group hold" functionality, if supported by the sensor.

Note
This function invokes the device driver function specified by the call to SetSensorControls().
Parameters
[in]deviceA pointer to the device to use; Valid value: [non-NULL].
[in]sensorControlA pointer to a sensor control structure for device; Valid value: [non-NULL].
[in]sensrCtrlStructSizeSize of the sensorControl structure, in bytes. The size must > 0.
Return values
NVMEDIA_STATUS_OKIndicates that the operation was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that one or more pointer parameters was NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the device driver does not support this functionality.
NVMEDIA_STATUS_ERRORIndicates that any other error occurred.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No