NVIDIA DRIVE OS Linux SDK API Reference

6.0.3 Release
DevBlkCDIDeviceDriver Struct Reference

Detailed Description

Holds device driver data.

Definition at line 604 of file devblk_cdi.h.

Data Fields

const char * deviceName
 Holds the device name. More...
 
uint32_t regLength
 Holds the target device offset length in bytes. More...
 
uint32_t dataLength
 Holds the target device data length in bytes. More...
 
NvMediaStatus(* DriverCreate )(DevBlkCDIDevice *handle, void const *clientContext)
 Holds the function that creates device driver. More...
 
NvMediaStatus(* DriverDestroy )(DevBlkCDIDevice *handle)
 Holds the function that destroy the driver for a device. More...
 
NvMediaStatus(* SetSensorControls )(DevBlkCDIDevice const *handle, const struct DevBlkCDISensorControl *sensorControl, const size_t sensrCtrlStructSize)
 Holds the function that sets sensor controls. More...
 
NvMediaStatus(* ParseEmbedDataInfo )(DevBlkCDIDevice const *handle, const struct DevBlkCDIEmbeddedDataChunk *embeddedTopDataChunk, const struct DevBlkCDIEmbeddedDataChunk *embeddedBotDataChunk, const size_t dataChunkStructSize, struct DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)
 Holds a pointer to the function that parses embedded data returned as part of a captured buffer. More...
 
NvMediaStatus(* GetSensorAttributes )(DevBlkCDIDevice const *handle, struct DevBlkCDISensorAttributes *sensorAttr, const size_t sensorAttrStructSize)
 Holds the function that gets sensor attributes. More...
 
NvMediaStatus(* GetModuleConfig )(DevBlkCDIDevice *handle, struct DevBlkCDIModuleConfig *moduleConfig)
 Holds the function that gets module configuration. More...
 
NvMediaStatus(* SetSensorCharMode )(DevBlkCDIDevice *handle, uint8_t expNo)
 Holds the function that sets sensor in characterization mode. More...
 
NvMediaStatus(* ReadRegister )(DevBlkCDIDevice const *handle, uint32_t deviceIndex, uint32_t registerNum, uint32_t dataLength, uint8_t *dataBuff)
 Holds the function that reads a block from an I2C device. More...
 
NvMediaStatus(* WriteRegister )(DevBlkCDIDevice const *handle, uint32_t deviceIndex, uint32_t registerNum, uint32_t dataLength, uint8_t const *dataBuff)
 Holds the function that writes a block to an I2C device. More...
 

Field Documentation

◆ dataLength

uint32_t DevBlkCDIDeviceDriver::dataLength

Holds the target device data length in bytes.

Definition at line 610 of file devblk_cdi.h.

◆ deviceName

const char* DevBlkCDIDeviceDriver::deviceName

Holds the device name.

Definition at line 606 of file devblk_cdi.h.

◆ DriverCreate

NvMediaStatus(* DevBlkCDIDeviceDriver::DriverCreate) (DevBlkCDIDevice *handle, void const *clientContext)

Holds the function that creates device driver.

The implementation should allocate and initialize the device driver internal handle and module configuration. DriverCreate should not communicate with the device, only set up driver data structures.

Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL].
[in]clientContextA non-NULL pointer to the device context to use when driver is created. If NULL, the default context will be used in driver.
Return values
NVMEDIA_STATUS_OKwhen all internal structures are initialized successfully.
NVMEDIA_STATUS_OUT_OF_MEMORYwhen an internal allocation fails. (Failure)
NVMEDIA_STATUS_BAD_PARAMETERwhen handle is NULL. (Failure)
NVMEDIA_STATUS_*May return a different NvMedia error status for implementation-defined reasons. (Failure)


Usage considerations

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

Definition at line 632 of file devblk_cdi.h.

◆ DriverDestroy

NvMediaStatus(* DevBlkCDIDeviceDriver::DriverDestroy) (DevBlkCDIDevice *handle)

Holds the function that destroy the driver for a device.

The implementation should release all resources allocated in DriverCreate(). It should not communicate with the device.

Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKwhen all resources are successfully released.
NVMEDIA_STATUS_*May return an NvMedia error status for implementation-defined reasons. (Failure)


Usage considerations

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

Definition at line 651 of file devblk_cdi.h.

◆ GetModuleConfig

NvMediaStatus(* DevBlkCDIDeviceDriver::GetModuleConfig) (DevBlkCDIDevice *handle, struct DevBlkCDIModuleConfig *moduleConfig)

Holds the function that gets module configuration.

Definition at line 769 of file devblk_cdi.h.

◆ GetSensorAttributes

NvMediaStatus(* DevBlkCDIDeviceDriver::GetSensorAttributes) (DevBlkCDIDevice const *handle, struct DevBlkCDISensorAttributes *sensorAttr, const size_t sensorAttrStructSize)

Holds the function that gets sensor attributes.

The sensorAttrStructSize parameter can be used to check if the application was built against the same version of CDI as the driver.

The function should fill out the provided DevBlkCDISensorAttributes completely.

Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL].
[in]sensorAttrA pointer to the DevBlkCDISensorAttributes structure. Valid value: [non-NULL].
[in]sensorAttrStructSizeSize of the sensorAttr structure, in bytes; The size must > 0.
Return values
NVMEDIA_STATUS_OKon success.
NVMEDIA_STATUS_*if parameter validation or another internal operation fails. (Failure)


Usage considerations

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

Definition at line 762 of file devblk_cdi.h.

◆ ParseEmbedDataInfo

NvMediaStatus(* DevBlkCDIDeviceDriver::ParseEmbedDataInfo) (DevBlkCDIDevice const *handle, const struct DevBlkCDIEmbeddedDataChunk *embeddedTopDataChunk, const struct DevBlkCDIEmbeddedDataChunk *embeddedBotDataChunk, const size_t dataChunkStructSize, struct DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)

Holds a pointer to the function that parses embedded data returned as part of a captured buffer.

DevBlkCDIParseEmbedDataInfo() invokes this function.

The embeddedDataChunkStructSize and dataInfoStructSize parameters can be used to validate that the client is using the same CDI version as the driver.

The provided embeddedTopDataChunk and embeddedBotDataChunk provide access to the top and bottom data chunks respectively. These should be used to fill out the information requested by embeddedDataInfo, as supported by the sensor. Unsupported elements should have their corresponding valid flag set to false. For example, if a given sensor doesn't support reporting temperature information, embeddedDataInfo->sensorTempInfo->tempValid should be set to false after this function runs.

Parameters
[in]handleA 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]dataChunkStructSizeSize of the embeddedTopDataChunk and embeddedBotDataChunk structure, in bytes; The size must > 0.
[in]embeddedDataInfoA pointer to the buffer that holds the parsed embedded data info. Valid value: [non-NULL].
[in]dataInfoStructSizeSize of the embeddedDataInfo structure, in bytes; The size must > 0.
Return values
NVMEDIA_STATUS_OKwhen all operations succeed.
NVMEDIA_STATUS_*May return an NvMedia error status for implementation-defined reasons. (Failure)


Usage considerations

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

Definition at line 734 of file devblk_cdi.h.

◆ ReadRegister

NvMediaStatus(* DevBlkCDIDeviceDriver::ReadRegister) (DevBlkCDIDevice const *handle, uint32_t deviceIndex, uint32_t registerNum, uint32_t dataLength, uint8_t *dataBuff)

Holds the function that reads a block from an I2C device.


Usage considerations

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

Definition at line 824 of file devblk_cdi.h.

◆ regLength

uint32_t DevBlkCDIDeviceDriver::regLength

Holds the target device offset length in bytes.

Definition at line 608 of file devblk_cdi.h.

◆ SetSensorCharMode

NvMediaStatus(* DevBlkCDIDeviceDriver::SetSensorCharMode) (DevBlkCDIDevice *handle, uint8_t expNo)

Holds the function that sets sensor in characterization mode.


This function is invoked by DevBlkCDISetSensorCharMode function call.

Sample Usage:
Pseudo code for cdi device driver function SetSensorCharMode invoked by DevBlkCDISetSensorCharMode function call.
NvMediaStatus
DevBlkCDIDevice *handle,
uint8_t expNo);
{
check input parameters
if (!handle || !expNo)
{
}
set sensor in characterization mode for expNo
status = ExpBypass(handle, expNo, ...)
if (status is NOT NVMEDIA_STATUS_OK) {
Error Handling
}
update driver internal state and sensor attributes
drvrHandle->numActiveExposures = 1;
drvrHandle->charModeEnabled = NVMEDIA_TRUE;
drvrHandle->charModeExpNo = expNo;
return status;
}

Definition at line 812 of file devblk_cdi.h.

◆ SetSensorControls

NvMediaStatus(* DevBlkCDIDeviceDriver::SetSensorControls) (DevBlkCDIDevice const *handle, const struct DevBlkCDISensorControl *sensorControl, const size_t sensrCtrlStructSize)

Holds the function that sets sensor controls.

This function is invoked by DevBlkCDISetSensorControls function call.

sensrCtrlStructSize can be used to determine the API version, as its size will change on every revision. Drivers should use this to ensure they are used only with compatible clients.

The implementation may receive a DevBlkCDISensorControl which requests more sensor contexts than are supported by the driver or sensor, in which case an error should be returned and no sensor configuration modified.

If supported by the device, drivers should set hold acquire during device configuration.

For each requested sensor context i, each of the following parameters should be programmed:

  • Exposure time, if exposureControl[i].expTimeValid is set
  • Exposure gain, if exposureControl[i].gainValid is set
  • White balance gain, if wbControl[i].wbValid is set

If frameReportControl.frameReportValid is set, frame reporting should be enabled with given configuration.

Parameters
[in]handleA 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; The size must > 0.
Return values
NVMEDIA_STATUS_OKwhen all operations succeed.
NVMEDIA_STATUS_*May return an NvMedia error status for implementation-defined reasons. (Failure)


Usage considerations

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

Definition at line 689 of file devblk_cdi.h.

◆ WriteRegister

NvMediaStatus(* DevBlkCDIDeviceDriver::WriteRegister) (DevBlkCDIDevice const *handle, uint32_t deviceIndex, uint32_t registerNum, uint32_t dataLength, uint8_t const *dataBuff)

Holds the function that writes a block to an I2C device.


Usage considerations

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

Definition at line 838 of file devblk_cdi.h.


The documentation for this struct was generated from the following file:
NVMEDIA_TRUE
#define NVMEDIA_TRUE
A true NvMediaBool value.
Definition: tvmr/include/nvmedia_core.h:72
DevBlkCDIDeviceDriver::SetSensorCharMode
NvMediaStatus(* SetSensorCharMode)(DevBlkCDIDevice *handle, uint8_t expNo)
Holds the function that sets sensor in characterization mode.
Definition: devblk_cdi.h:812
NVMEDIA_STATUS_OK
@ NVMEDIA_STATUS_OK
Specifies that the operation completed successfully (with no error).
Definition: tvmr/include/nvmedia_core.h:183
DevBlkCDISetSensorCharMode
NvMediaStatus DevBlkCDISetSensorCharMode(DevBlkCDIDevice *device, uint8_t expNo)
Set sensor in characterization mode.
NVMEDIA_STATUS_BAD_PARAMETER
@ NVMEDIA_STATUS_BAD_PARAMETER
Specifies that a bad parameter was passed.
Definition: tvmr/include/nvmedia_core.h:185
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: tvmr/include/nvmedia_core.h:180
DevBlkCDIDevice
Holds the handle for an DevBlkCDIDevice object.
Definition: devblk_cdi.h:119