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) |
Usage considerations 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 | DevBlkCDIParseTopEmbDataInfo (DevBlkCDIDevice *device, const DevBlkCDIEmbeddedDataChunk *embeddedTopDataChunk, const size_t embeddedDataChunkStructSize, DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize) |
Parses top sensor embedded data info and provides sensor image settings information for the captured frame. More... | |
NvMediaStatus | DevBlkCDIParseBotEmbDataInfo (DevBlkCDIDevice *device, const DevBlkCDIEmbeddedDataChunk *embeddedBotDataChunk, const size_t embeddedDataChunkStructSize, DevBlkCDIEmbeddedDataInfo *embeddedDataInfo, const size_t dataInfoStructSize) |
Parses Bottom sensor embedded data info and provides sensor image settings information for the captured frame. More... | |
NvMediaStatus | DevBlkCDISetDeserPower (DevBlkCDIDevice *device, NvMediaBool enable) |
Set the deserializer module power. More... | |
NvMediaStatus | DevBlkCDIEnableErrorReport (DevBlkCDIRootDevice const *device) |
Enable the error report. More... | |
NvMediaStatus | DevBlkCDIGetDesPowerControlInfo (DevBlkCDIDevice *device, DevBlkCDIPowerControlInfo *desPwrControlInfo) |
Get the deserialzer's power control information. More... | |
NvMediaStatus | DevBlkCDIGetCamPowerControlInfo (DevBlkCDIDevice *device, DevBlkCDIPowerControlInfo *camPwrControlInfo) |
Get the camera's power control information. More... | |
NvMediaStatus | DevBlkCDIReserveI2CAddr (DevBlkCDIDevice *device, uint8_t address, bool useNativeI2C, uint32_t *reservedI2CAddr) |
Reserve device I2C address. More... | |
NvMediaStatus | DevBlkCDISetFsyncMux (DevBlkCDIDevice *device, uint32_t fsyncMuxSel, uint32_t camGrpIdx) |
Set multiplexer to select the FSYNC source. More... | |
NvMediaStatus | DevBlkCDIAuthenticateImage (DevBlkCDIDevice const *const device, DevBlkImageDesc const *const imageDesc) |
Authenticate an image data passed in a parameters. More... | |
typedef struct DevBlkCDISensorControl DevBlkCDISensorControl |
Holds the sensor control structure.
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.
NvMediaStatus DevBlkCDIAuthenticateImage | ( | DevBlkCDIDevice const *const | device, |
DevBlkImageDesc const *const | imageDesc | ||
) |
Authenticate an image data passed in a parameters.
Authenticate an image data passed in a parameters.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
[in] | imageDesc | Description of an image to authenticate. Valid value: [non-NULL]. |
NVMEDIA_STATUS_INCOMPATIBLE_VERSION | Image verification failure (authentication mismatch). |
NVMEDIA_STATUS_UNDEFINED_STATE | Out-of-order image is detected. |
NVMEDIA_STATUS_ERROR | Internal failure in crypto operation. |
NVMEDIA_STATUS_NOT_SUPPORTED | authentication is not supported by the device. |
NVMEDIA_STATUS_INVALID_SIZE | if any of the input size parameters do not present values which make sense. |
NVMEDIA_STATUS_NOT_INITIALIZED | Crypto state was not initialized before requesting image verification. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_OK | Authentication is successful. |
(NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
NvMediaStatus DevBlkCDIDeviceRead | ( | DevBlkCDIDevice const * | device, |
uint32_t | deviceIndex, | ||
uint32_t | regLength, | ||
uint8_t * | regData, | ||
uint32_t | dataLength, | ||
uint8_t * | data | ||
) |
Usage considerations
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.
[in] | device | A pointer to the CDI device to read; Valid value: [non-NULL]. |
[in] | deviceIndex | Index of the sub-device to use; Valid range: [0, UINT32_MAX]. |
[in] | regLength | Length of the register address, in bytes; Valid range: [0, UINT32_MAX]. |
[in] | regData | A pointer to the register address; Valid value: [non-NULL]. |
[in] | dataLength | Length of data to be read, in bytes; Valid range: [0, UINT32_MAX]. |
[out] | data | A pointer to the location for storing the read data; Valid value: [non-NULL]. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
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.
[in] | device | A pointer to the CDI device to write; Valid value: [non-NULL]. |
[in] | deviceIndex | Index of the sub-device to use; Valid range: [0, UINT32_MAX]. |
[in] | dataLength | Length of data to be written, in bytes; Valid range: [0, UINT32_MAX]. |
[in] | data | A pointer to data to be written to device via I2C; Valid value: [non-NULL]. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDIEnableErrorReport | ( | DevBlkCDIRootDevice const * | device | ) |
Enable the error report.
Used to enable the error report.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | If any of the input parameter is NULL. By the device driver. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDIGetCamPowerControlInfo | ( | DevBlkCDIDevice * | device, |
DevBlkCDIPowerControlInfo * | camPwrControlInfo | ||
) |
Get the camera's power control information.
Get the camera's power control information.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
[out] | camPwrControlInfo | A structure that holds the power control information for camera module. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDIGetDesPowerControlInfo | ( | DevBlkCDIDevice * | device, |
DevBlkCDIPowerControlInfo * | desPwrControlInfo | ||
) |
Get the deserialzer's power control information.
Get the deserialzer's power control information.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
[out] | desPwrControlInfo | A structure that holds the power control information for deserializer. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
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.
[in] | device | A pointer to the device to use; Valid value: [non-NULL]. |
[out] | sensorAttr | A pointer to the sensor attributes structure; Valid value: [non-NULL]. |
[in] | sensorAttrStructSize | Size of the sensorAttr, in bytes; The size must > 0. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_NOT_SUPPORTED | Indicates that the device driver does not support this functionality. |
(NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations
NvMediaStatus DevBlkCDIParseBotEmbDataInfo | ( | DevBlkCDIDevice * | device, |
const DevBlkCDIEmbeddedDataChunk * | embeddedBotDataChunk, | ||
const size_t | embeddedDataChunkStructSize, | ||
DevBlkCDIEmbeddedDataInfo * | embeddedDataInfo, | ||
const size_t | dataInfoStructSize | ||
) |
Parses Bottom 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.
[in] | device | A pointer to the device to use; Valid value: [non-NULL]. |
[in] | embeddedBotDataChunk | A pointer to the bottom sensor embedded data DevBlkCDIEmbeddedDataChunk structure; Valid value: [non-NULL]. |
[in] | embeddedDataChunkStructSize | Size of the embeddedBotDataChunk structures, in bytes; The size must > 0. |
[out] | embeddedDataInfo | A pointer to the parsed embedded data info structure; Valid value: [non-NULL]. |
[in] | dataInfoStructSize | Size of the embeddedDataInfo structure, in bytes; The size must > 0. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL or invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | Indicates that the device driver does not support this functionality. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDIParseTopEmbDataInfo | ( | DevBlkCDIDevice * | device, |
const DevBlkCDIEmbeddedDataChunk * | embeddedTopDataChunk, | ||
const size_t | embeddedDataChunkStructSize, | ||
DevBlkCDIEmbeddedDataInfo * | embeddedDataInfo, | ||
const size_t | dataInfoStructSize | ||
) |
Parses top 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.
[in] | device | A pointer to the device to use; Valid value: [non-NULL]. |
[in] | embeddedTopDataChunk | A pointer to the top sensor embedded data DevBlkCDIEmbeddedDataChunk structure; Valid value: [non-NULL]. |
[in] | embeddedDataChunkStructSize | Size of the embeddedTopDataChunk structures, in bytes; The size must > 0. |
[out] | embeddedDataInfo | A pointer to the parsed embedded data info structure; Valid value: [non-NULL]. |
[in] | dataInfoStructSize | Size of the embeddedDataInfo structure, in bytes; The size must > 0. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL or invalid. |
NVMEDIA_STATUS_NOT_SUPPORTED | Indicates that the device driver does not support this functionality. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDIReserveI2CAddr | ( | DevBlkCDIDevice * | device, |
uint8_t | address, | ||
bool | useNativeI2C, | ||
uint32_t * | reservedI2CAddr | ||
) |
Reserve device I2C address.
Supplied I2C address is reserved either as physical or virtual as per request. If caller wants to get new virtual address for the device, it should supply valid physical I2C address of the device, in the request to reserve address as virtual.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
[in] | address | An I2C address to be reserved. Valid range: [0, UINT8_MAX]. |
[in] | useNativeI2C | A flag to denote if address needs to be reserved as physical (native) or virtual address. Valid value: [ 0 | 1]. |
[out] | reservedI2CAddr | A pointer to reserved I2C address. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | If the pointer of device is NULL. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDISetDeserPower | ( | DevBlkCDIDevice * | device, |
NvMediaBool | enable | ||
) |
Set the deserializer module power.
Enable or disable deserializer power based on the enable parameter.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
[in] | enable | The flag to enable/disable. Valid value: [ NVMEDIA_TRUE | NVMEDIA_FALSE ]. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | If any of the input parameter is NULL. By the device driver. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
NvMediaStatus DevBlkCDISetFsyncMux | ( | DevBlkCDIDevice * | device, |
uint32_t | fsyncMuxSel, | ||
uint32_t | camGrpIdx | ||
) |
Set multiplexer to select the FSYNC source.
Set the multiplexer to select the FSYNC source.
[in] | device | A pointer to the device to use. Valid value: [non-NULL]. |
[in] | fsyncMuxSel | The mulitiplexer selection. Valid range: [0, UINT32_MAX]. |
[in] | camGrpIdx | Index to the camera group. Valid range: [1, 3]. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that device parameter was NULL. |
NVMEDIA_STATUS_ERROR | Indicates that any other error occurred. |
Usage considerations
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.
[in] | device | A pointer to the device to use; Valid value: [non-NULL]. |
[in] | sensorControl | A pointer to a sensor control structure for device; Valid value: [non-NULL]. |
[in] | sensrCtrlStructSize | Size of the sensorControl structure, in bytes. The size must > 0. |
NVMEDIA_STATUS_OK | Indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | Indicates that one or more pointer parameters was NULL. |
NVMEDIA_STATUS_NOT_SUPPORTED | Indicates that the device driver does not support this functionality. |
(NvMediaStatus) | An error code returned by the dependencies in case of failure. |
Usage considerations