NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release

Detailed Description

Manage DevBlkCDIRootDevice objects, which represent the root of the SIPL device block.

The DevBlkCDIRootDevice object manages an I2C port on the host hardware device.

Data Structures

struct  DevBlkCDIPowerControlInfo
 Structure to hold power control information. More...
 
struct  DevBlkImageDesc
 Structure to describe a RAW image buffer. More...
 
struct  DevBlkCDIGPIOIndices
 Structure to hold array of CAMGPIO indices. More...
 

Macros

#define DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS   (16U)
 The maximum number of GPIOs supported on a CDI Root Device. More...
 
#define MAX_POWER_LINKS_PER_BLOCK   (4U)
 The maximum number of power links per device block. More...
 

Typedefs

typedef void DevBlkCDIRootDevice
 An opaque handle for an DevBlkCDIRootDevice object. More...
 

Enumerations

enum  DevBlkCDI_I2CPort {
  DEVBLK_CDI_I2C_BUS_0 = 0,
  DEVBLK_CDI_I2C_BUS_1 = 1,
  DEVBLK_CDI_I2C_BUS_2 = 2,
  DEVBLK_CDI_I2C_BUS_3 = 3,
  DEVBLK_CDI_I2C_BUS_4 = 4,
  DEVBLK_CDI_I2C_BUS_5 = 5,
  DEVBLK_CDI_I2C_BUS_6 = 6,
  DEVBLK_CDI_I2C_BUS_7 = 7,
  DEVBLK_CDI_I2C_BUS_8 = 8,
  DEVBLK_CDI_I2C_BUS_9 = 9,
  DEVBLK_CDI_I2C_BUS_10 = 10,
  DEVBLK_CDI_I2C_BUS_11 = 11,
  DEVBLK_CDI_I2C_BUS_12 = 12,
  DEVBLK_CDI_I2C_BUS_13 = 13,
  DEVBLK_CDI_I2C_BUS_14 = 14,
  DEVBLK_CDI_I2C_BUS_15 = 15,
  DEVBLK_CDI_I2C_BUS_16 = 16,
  DEVBLK_CDI_I2C_SIMULATOR = 255
}
 Defines the I2C buses on the host hardware device. More...
 
enum  DevBlkCDIGpioEvent {
  DEVBLK_CDI_GPIO_EVENT_INTR = 0,
  DEVBLK_CDI_GPIO_EVENT_INTR_TIMEOUT,
  DEVBLK_CDI_GPIO_EVENT_ERROR_CAMGPIO,
  DEVBLK_CDI_GPIO_EVENT_ERROR_BACKEND,
  DEVBLK_CDI_GPIO_EVENT_ERROR_UNKNOWN
}
 CDI codes for CAMGPIO Interrupt Events. More...
 

Functions

NvMediaStatus DevBlkCDIRootDeviceGetGPIOPinLevel (DevBlkCDIRootDevice const *device, uint32_t gpio_idx, uint32_t *level)
 Queries the logic level of a Tegra GPIO input pin associated with the root device. More...
 
NvMediaStatus DevBlkCDIRootDeviceCheckGPIOPinLevel (DevBlkCDIRootDevice const *device, uint32_t gpio_idx, uint32_t expected_level)
 Compares the logic level of a Tegra GPIO input pin associated with the root device with expected pin level. More...
 
NvMediaStatus DevBlkCDIRootDevicePollGPIOPinLevel (DevBlkCDIDevice const *device, uint32_t gpio_idx, uint32_t expected_level, uint32_t poll_count, uint32_t poll_delay)
 Poll the logic level of a Tegra GPIO input pin associated with the root device with expected pin level. More...
 
NvMediaStatus DevBlkCDIRootDeviceSetGPIOPinLevel (DevBlkCDIRootDevice const *device, uint32_t gpio_idx, uint32_t level)
 Sets the logic level of Tegra GPIO output pin associated with this root device. More...
 
NvMediaStatus DevBlkCDIRootDeviceCheckIntrPin (DevBlkCDIRootDevice const *device, uint32_t gpio_idx)
 Verifies that the level of a GPIO pin configured as an interrupt is at the correct pre-transition level, and then clears any pending interrupt event. More...
 
#define DEVBLK_CDI_GPIO_LEVEL_LOW   (1U)
 CDI codes for CAMGPIO GPIO Levels. More...
 
#define DEVBLK_CDI_GPIO_LEVEL_HIGH   (2U)
 

Macro Definition Documentation

◆ DEVBLK_CDI_GPIO_LEVEL_HIGH

#define DEVBLK_CDI_GPIO_LEVEL_HIGH   (2U)

Definition at line 255 of file devblk_cdi.h.

◆ DEVBLK_CDI_GPIO_LEVEL_LOW

#define DEVBLK_CDI_GPIO_LEVEL_LOW   (1U)

CDI codes for CAMGPIO GPIO Levels.

Definition at line 254 of file devblk_cdi.h.

◆ DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS

#define DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS   (16U)

The maximum number of GPIOs supported on a CDI Root Device.

Definition at line 168 of file devblk_cdi.h.

◆ MAX_POWER_LINKS_PER_BLOCK

#define MAX_POWER_LINKS_PER_BLOCK   (4U)

The maximum number of power links per device block.

Definition at line 173 of file devblk_cdi.h.

Typedef Documentation

◆ DevBlkCDIRootDevice

An opaque handle for an DevBlkCDIRootDevice object.

Definition at line 319 of file devblk_cdi.h.

Enumeration Type Documentation

◆ DevBlkCDI_I2CPort

Defines the I2C buses on the host hardware device.

Enumerator
DEVBLK_CDI_I2C_BUS_0 

Specifies i2c-0.

DEVBLK_CDI_I2C_BUS_1 

Specifies i2c-1.

DEVBLK_CDI_I2C_BUS_2 

Specifies i2c-2.

DEVBLK_CDI_I2C_BUS_3 

Specifies i2c-3.

DEVBLK_CDI_I2C_BUS_4 

Specifies i2c-4.

DEVBLK_CDI_I2C_BUS_5 

Specifies i2c-5.

DEVBLK_CDI_I2C_BUS_6 

Specifies i2c-6.

DEVBLK_CDI_I2C_BUS_7 

Specifies i2c-7.

DEVBLK_CDI_I2C_BUS_8 

Specifies i2c-8.

DEVBLK_CDI_I2C_BUS_9 

Specifies i2c-9.

DEVBLK_CDI_I2C_BUS_10 

Specifies i2c-10.

DEVBLK_CDI_I2C_BUS_11 

Specifies i2c-11.

DEVBLK_CDI_I2C_BUS_12 

Specifies i2c-12.

DEVBLK_CDI_I2C_BUS_13 

Specifies i2c-13.

DEVBLK_CDI_I2C_BUS_14 

Specifies i2c-14.

DEVBLK_CDI_I2C_BUS_15 

Specifies i2c-15.

DEVBLK_CDI_I2C_BUS_16 

Specifies i2c-16.

DEVBLK_CDI_I2C_SIMULATOR 

Port SIMULATOR (20)

Definition at line 144 of file devblk_cdi.h.

◆ DevBlkCDIGpioEvent

CDI codes for CAMGPIO Interrupt Events.

Enumerator
DEVBLK_CDI_GPIO_EVENT_INTR 

An interrupt has occurred.

DEVBLK_CDI_GPIO_EVENT_INTR_TIMEOUT 

An interrupt timeout period has elapsed.

DEVBLK_CDI_GPIO_EVENT_ERROR_CAMGPIO 

An error occurred in CAMGPIO code, potentially resulting in permanent loss of functionality.

(Error)

DEVBLK_CDI_GPIO_EVENT_ERROR_BACKEND 

An error occurred in backend code, potentially resulting in permanent loss of functionality.

(Error)

DEVBLK_CDI_GPIO_EVENT_ERROR_UNKNOWN 

A generic error occurred, potentially resulting in permanent loss of functionality.

(Error)

Definition at line 261 of file devblk_cdi.h.

Function Documentation

◆ DevBlkCDIRootDeviceCheckGPIOPinLevel()

NvMediaStatus DevBlkCDIRootDeviceCheckGPIOPinLevel ( DevBlkCDIRootDevice const *  device,
uint32_t  gpio_idx,
uint32_t  expected_level 
)

Compares the logic level of a Tegra GPIO input pin associated with the root device with expected pin level.

This API does the following:

  1. Retrieves GPIO's current pin level by Calling DevBlkCDIRootDeviceGetGPIOPinLevel which also helps verify the input parameters.
  2. Compares the retrieved GPIO pin level with expected pin level.
Precondition
None
Parameters
[in]deviceA pointer to the root device to use; Valid value: [non-NULL].
[in]gpio_idxThe index of the GPIO pin; Valid range: [0, DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS - 1]. The range of gpio_idx will be checked in the supporting function.
[in]expected_levelThe expected GPIO pin level of a Tegra GPIO input pin to compare with. Valid range: [ DEVBLK_CDI_GPIO_LEVEL_LOW, DEVBLK_CDI_GPIO_LEVEL_HIGH]
Return values
NVMEDIA_STATUS_OKIndicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that parameter(s) were invalid.
NVMEDIA_STATUS_ERRORIndicate GPIO's current pin level did not match with the expected pin level or some other error occurred.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the API is not supported on the current platform


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: No

◆ DevBlkCDIRootDeviceCheckIntrPin()

NvMediaStatus DevBlkCDIRootDeviceCheckIntrPin ( DevBlkCDIRootDevice const *  device,
uint32_t  gpio_idx 
)

Verifies that the level of a GPIO pin configured as an interrupt is at the correct pre-transition level, and then clears any pending interrupt event.

This API does the following:

  1. Verifies the input parameters.
  2. Checks interrupt pin.
Precondition
None
Parameters
[in]deviceA pointer to the root device to use; Valid value: [non-NULL].
[in]gpio_idxThe index of the GPIO pin; Valid range: [0, DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS - 1]. The value of gpio_idx will be verified in the supporting function.
Return values
NVMEDIA_STATUS_OKIndicates that the call was successful.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that this API is not supported on the current platform.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that parameter(s) were invalid.
NVMEDIA_STATUS_ERRORIndicates that some other error occurred.


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: No

◆ DevBlkCDIRootDeviceGetGPIOPinLevel()

NvMediaStatus DevBlkCDIRootDeviceGetGPIOPinLevel ( DevBlkCDIRootDevice const *  device,
uint32_t  gpio_idx,
uint32_t *  level 
)

Queries the logic level of a Tegra GPIO input pin associated with the root device.

This API does the following:

  1. Verifies the input parameters. Makes sure a memory is allocated to hold the return GPIO pin level.
  2. Retrieve GPIO pin level.
Precondition
None
Parameters
[in]deviceA pointer to the root device to use; Valid value: [non-NULL].
[in]gpio_idxThe index of the GPIO pin; Valid range: [0, DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS - 1]. The range of gpio_idx will be checked in the supporting function.
[out]levelThe GPIO pin level queried from CamGPIO; The pin level should be DEVBLK_CDI_GPIO_LEVEL_LOW or DEVBLK_CDI_GPIO_LEVEL_HIGH.
Return values
NVMEDIA_STATUS_OKIndicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that parameter(s) were invalid.
NVMEDIA_STATUS_ERRORIndicate that some other error occurred.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the API is not supported on the current platform


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: No

◆ DevBlkCDIRootDevicePollGPIOPinLevel()

NvMediaStatus DevBlkCDIRootDevicePollGPIOPinLevel ( DevBlkCDIDevice const *  device,
uint32_t  gpio_idx,
uint32_t  expected_level,
uint32_t  poll_count,
uint32_t  poll_delay 
)

Poll the logic level of a Tegra GPIO input pin associated with the root device with expected pin level.

This API does the following:

  1. Retrieves GPIO's current pin level by Calling DevBlkCDIRootDeviceGetGPIOPinLevel which also helps verify the input parameters.
  2. Polls GPIO pin level with expected pin level.
Precondition
None
Parameters
[in]deviceA pointer to the device to use; Valid value: [non-NULL].
[in]gpio_idxThe index of the GPIO pin; Valid range: [0, DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS - 1]. The range of gpio_idx will be checked in the supporting function.
[in]expected_levelThe expected GPIO pin level of a Tegra GPIO input pin to compare with. Valid range: [ DEVBLK_CDI_GPIO_LEVEL_LOW, DEVBLK_CDI_GPIO_LEVEL_HIGH]
[in]poll_countNumber of iteration [0, UINT32_MAX]
[in]poll_delayDelay between two iteration in microseconds [0, UINT32_MAX]
Return values
NVMEDIA_STATUS_OKIndicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that parameter(s) were invalid.
NVMEDIA_STATUS_ERRORIndicate GPIO's current pin level did not match with the expected pin level or some other error occurred.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that the API is not supported on the current platform


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: No

◆ DevBlkCDIRootDeviceSetGPIOPinLevel()

NvMediaStatus DevBlkCDIRootDeviceSetGPIOPinLevel ( DevBlkCDIRootDevice const *  device,
uint32_t  gpio_idx,
uint32_t  level 
)

Sets the logic level of Tegra GPIO output pin associated with this root device.

This API does the following:

  1. Verifies the input parameters.
  2. Set GPIO pin level.
Precondition
None
Parameters
[in]deviceA pointer to the root device to use; Valid value: [non-NULL].
[in]gpio_idxThe index of the GPIO pin; Valid range: [0, DEVBLK_CDI_ROOT_DEVICE_MAX_GPIOS - 1]. The range of gpio_idx will be checked in the supporting function.
[in]levelThe GPIO pin level to be set in CamGPIO; The pin level must be DEVBLK_CDI_GPIO_LEVEL_LOW or DEVBLK_CDI_GPIO_LEVEL_HIGH. The value of level will be checked in the supporting function.
Return values
NVMEDIA_STATUS_OKIndicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERIndicates that parameter(s) were invalid.
NVMEDIA_STATUS_ERRORIndicates that some other error occurred.
NVMEDIA_STATUS_NOT_SUPPORTEDIndicates that this API is not supported on the current platform.


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: No