NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
DevBlkCDIDeviceDriver Struct Reference

Detailed Description

Holds device driver data.

Definition at line 977 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(* ParseTopEmbDataInfo )(DevBlkCDIDevice const *handle, const struct DevBlkCDIEmbeddedDataChunk *topEmbDataChunk, const size_t topChunkStructSize, struct DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)
 Holds a pointer to the function that parses top section embedded data returned as part of a captured buffer. More...
 
NvMediaStatus(* ParseBotEmbDataInfo )(DevBlkCDIDevice const *handle, const struct DevBlkCDIEmbeddedDataChunk *botEmbDataChunk, const size_t botChunkStructSize, struct DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)
 Holds a pointer to the function that parses bottom section 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...
 
NvMediaStatus(* AuthenticateImage )(DevBlkCDIDevice const *const handle, DevBlkImageDesc const *const imageDesc)
 Holds the function which authenticates passed image data. More...
 

Field Documentation

◆ AuthenticateImage

NvMediaStatus(* DevBlkCDIDeviceDriver::AuthenticateImage) (DevBlkCDIDevice const *const handle, DevBlkImageDesc const *const imageDesc)

Holds the function which authenticates passed image data.

The function authenticates pixel and embedded data passed in as parameters. Expectation is that driver has already established an authentication session with a sensor prior to a call. If session is not established - function will return error.

The AuthenticateImage() method will always be called from a single thread. The same thread can handle multiple driver objects in a sequence, as specified by CNvMCameraModule::SensorProperty::imgAuthThreadID.

Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL].
[in]imageDescDescription of a RAW image to authenticate;
Return values
NVMEDIA_STATUS_OKAuthentication match.
NVMEDIA_STATUS_INCOMPATIBLE_VERSIONImage verification failure (authentication mismatch).
NVMEDIA_STATUS_UNDEFINED_STATEOut-of-order image is detected.
NVMEDIA_STATUS_ERRORInternal failure in crypto operation.
NVMEDIA_STATUS_INVALID_SIZEInput buffer sizes are invalid.
NVMEDIA_STATUS_NOT_INITIALIZEDCrypto state was not initialized before requesting image verification.
Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().


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: Yes
    • De-Init: No

Definition at line 1474 of file devblk_cdi.h.

◆ dataLength

uint32_t DevBlkCDIDeviceDriver::dataLength

Holds the target device data length in bytes.

Definition at line 983 of file devblk_cdi.h.

◆ deviceName

const char* DevBlkCDIDeviceDriver::deviceName

Holds the device name.

Definition at line 979 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.

Precondition
handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
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.
NVMEDIA_STATUS_BAD_PARAMETERwhen handle is NULL.
(NvMediaStatus)May return a different NvMedia error status for implementation-defined reasons.


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

Definition at line 1020 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().
Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL].
Return values
NVMEDIA_STATUS_OKwhen all resources are successfully released.
(NvMediaStatus)May return an NvMedia error status for implementation-defined reasons.


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

Definition at line 1056 of file devblk_cdi.h.

◆ GetModuleConfig

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

Holds the function that gets module configuration.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().


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

Definition at line 1300 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().
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.
(NvMediaStatus)if parameter validation or another internal operation fails.


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

Definition at line 1271 of file devblk_cdi.h.

◆ ParseBotEmbDataInfo

NvMediaStatus(* DevBlkCDIDeviceDriver::ParseBotEmbDataInfo) (DevBlkCDIDevice const *handle, const struct DevBlkCDIEmbeddedDataChunk *botEmbDataChunk, const size_t botChunkStructSize, struct DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)

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

DevBlkCDIParseBotEmbDataInfo() 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 botEmbDataChunk provides access to the bottom data chunks. 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().
Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL.
[in]botEmbDataChunkA pointer to the bottom sensor embedded data DevBlkCDIEmbeddedDataChunk structure. Valid value: [non-NULL].
[in]botChunkStructSizeSize of the botEmbDataChunk 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.
(NvMediaStatus)May return an NvMedia error status for implementation-defined reasons.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • 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: Yes
    • De-Init: No

Definition at line 1227 of file devblk_cdi.h.

◆ ParseTopEmbDataInfo

NvMediaStatus(* DevBlkCDIDeviceDriver::ParseTopEmbDataInfo) (DevBlkCDIDevice const *handle, const struct DevBlkCDIEmbeddedDataChunk *topEmbDataChunk, const size_t topChunkStructSize, struct DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize)

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

DevBlkCDIParseTopEmbDataInfo() 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 topEmbDataChunk provides access to the top data chunks. 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().
Parameters
[in]handleA pointer to the device to use; Valid value: [non-NULL.
[in]topEmbDataChunkA pointer to the top sensor embedded data DevBlkCDIEmbeddedDataChunk structure. Valid value: [non-NULL].
[in]topChunkStructSizeSize of the topEmbDataChunk 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.
(NvMediaStatus)May return an NvMedia error status for implementation-defined reasons.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • 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: Yes
    • De-Init: No

Definition at line 1168 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • 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

Definition at line 1392 of file devblk_cdi.h.

◆ regLength

uint32_t DevBlkCDIDeviceDriver::regLength

Holds the target device offset length in bytes.

Definition at line 981 of file devblk_cdi.h.

◆ SetSensorCharMode

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

Holds the function that sets sensor in characterization mode.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().


This function is invoked by DevBlkCDISetSensorCharMode function call.

Sample Usage:
Pseudo code for cdi device driver function SetSensorCharMode invoked by DevBlkCDISetSensorCharMode function call.
NvMediaStatus
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;
}


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

Definition at line 1363 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().
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.
(NvMediaStatus)May return an NvMedia error status for implementation-defined reasons.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • 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: Yes
    • De-Init: No

Definition at line 1111 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.

Precondition
  • handle must be valid DevBlkCDIDevice handle created with DevBlkCDIDeviceCreate().
  • A valid device driver of the CDI device is created with DriverCreate().


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • 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

Definition at line 1423 of file devblk_cdi.h.


The documentation for this struct was generated from the following file:
DevBlkCDIDeviceDriver::SetSensorCharMode
NvMediaStatus(* SetSensorCharMode)(DevBlkCDIDevice *handle, uint8_t expNo)
Holds the function that sets sensor in characterization mode.
Definition: devblk_cdi.h:1363
NVMEDIA_STATUS_OK
@ NVMEDIA_STATUS_OK
Specifies that the operation completed successfully (with no error).
Definition: nvmedia_core.h:111
mode
dwGPSMode mode
Definition: GPS.h:285
DevBlkCDISetSensorCharMode
NvMediaStatus DevBlkCDISetSensorCharMode(DevBlkCDIDevice *device, uint8_t expNo)
Set sensor in characterization mode.
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:108
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:124
NVMEDIA_STATUS_BAD_PARAMETER
@ NVMEDIA_STATUS_BAD_PARAMETER
Specifies that a bad parameter was passed.
Definition: nvmedia_core.h:113
sensor
DW_API_PUBLIC const dwSensorHandle_t sensor
Definition: Camera.h:714
DevBlkCDIDevice
Holds the handles for an DevBlkCDIDevice object.
Definition: devblk_cdi.h:124
NVMEDIA_TRUE
#define NVMEDIA_TRUE
A true NvMediaBool value.
Definition: nvmedia_core.h:67