NVAPI Reference Documentation
NVIDIA
Release 384: June 27
2017

I2C APIs

Data Structures

struct  NV_I2C_INFO_V1
 
struct  NV_I2C_INFO_V2
 
struct  NV_I2C_INFO_V3
 

Macros

#define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER   4096
 
#define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS   4
 
#define NVAPI_DISPLAY_DEVICE_MASK_MAX   24
 
#define NVAPI_I2C_SPEED_DEPRECATED   0xFFFF
 
#define NV_I2C_INFO_VER3   MAKE_NVAPI_VERSION(NV_I2C_INFO_V3,3)
 
#define NV_I2C_INFO_VER2   MAKE_NVAPI_VERSION(NV_I2C_INFO_V2,2)
 
#define NV_I2C_INFO_VER1   MAKE_NVAPI_VERSION(NV_I2C_INFO_V1,1)
 
#define NV_I2C_INFO_VER   NV_I2C_INFO_VER3
 

Typedefs

typedef NV_I2C_INFO_V3 NV_I2C_INFO
 

Enumerations

enum  NV_I2C_SPEED {
  NVAPI_I2C_SPEED_DEFAULT, NVAPI_I2C_SPEED_3KHZ, NVAPI_I2C_SPEED_10KHZ, NVAPI_I2C_SPEED_33KHZ,
  NVAPI_I2C_SPEED_100KHZ, NVAPI_I2C_SPEED_200KHZ, NVAPI_I2C_SPEED_400KHZ
}
 

Functions

NVAPI_INTERFACE NvAPI_I2CRead (NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo)
 
NVAPI_INTERFACE NvAPI_I2CWrite (NvPhysicalGpuHandle hPhysicalGpu, NV_I2C_INFO *pI2cInfo)
 

Detailed Description

The I2C APIs are used to read or write data to DDC monitors using the I2C protocol.

Macro Definition Documentation

#define NV_I2C_INFO_VER   NV_I2C_INFO_VER3
#define NV_I2C_INFO_VER1   MAKE_NVAPI_VERSION(NV_I2C_INFO_V1,1)
#define NV_I2C_INFO_VER2   MAKE_NVAPI_VERSION(NV_I2C_INFO_V2,2)
#define NV_I2C_INFO_VER3   MAKE_NVAPI_VERSION(NV_I2C_INFO_V3,3)
#define NVAPI_DISPLAY_DEVICE_MASK_MAX   24
#define NVAPI_I2C_SPEED_DEPRECATED   0xFFFF
#define NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER   4096
#define NVAPI_MAX_SIZEOF_I2C_REG_ADDRESS   4

Typedef Documentation

Enumeration Type Documentation

Enumerator
NVAPI_I2C_SPEED_DEFAULT 

Set i2cSpeedKhz to I2C_SPEED_DEFAULT if default I2C speed is to be chosen, ie.use the current frequency setting.

NVAPI_I2C_SPEED_3KHZ 
NVAPI_I2C_SPEED_10KHZ 
NVAPI_I2C_SPEED_33KHZ 
NVAPI_I2C_SPEED_100KHZ 
NVAPI_I2C_SPEED_200KHZ 
NVAPI_I2C_SPEED_400KHZ 

Function Documentation

NVAPI_INTERFACE NvAPI_I2CRead ( NvPhysicalGpuHandle  hPhysicalGpu,
NV_I2C_INFO pI2cInfo 
)

This function reads the data buffer from the I2C port. The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.

A data buffer size larger than 16 bytes may be rejected if a register address is specified. In such a case, NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.

If a register address is specified (i.e. regAddrSize is positive), then the transaction will be performed in the combined format described in the I2C specification. The register address will be written, followed by reading into the data buffer.

SUPPORTED OS: Windows XP and higher

Since
Release: 85
Parameters
[in]hPhysicalGpuGPU selection.
[out]*pI2cInfoThe I2C data input structure
Return values
NVAPI_OKCompleted request
NVAPI_ERRORMiscellaneous error occurred.
NVAPI_HANDLE_INVALIDATEDHandle passed has been invalidated (see user guide).
NVAPI_EXPECTED_PHYSICAL_GPU_HANDLEHandle passed is not a physical GPU handle.
NVAPI_INCOMPATIBLE_STRUCT_VERSIONStructure version is not supported.
NVAPI_INVALID_ARGUMENT- argument does not meet specified requirements
NVAPI_ARGUMENT_EXCEED_MAX_SIZE- an argument exceeds the maximum
NVAPI_INTERFACE NvAPI_I2CWrite ( NvPhysicalGpuHandle  hPhysicalGpu,
NV_I2C_INFO pI2cInfo 
)

This function writes the data buffer to the I2C port.

           The I2C request must be for a DDC port: pI2cInfo->bIsDDCPort = 1.

           A data buffer size larger than 16 bytes may be rejected if a register address is specified.  In such a case,
           NVAPI_ARGUMENT_EXCEED_MAX_SIZE would be returned.

           If a register address is specified (i.e. regAddrSize is positive), then the register address will be written
           and the data buffer will immediately follow without a restart.

SUPPORTED OS: Windows XP and higher

Since
Release: 85
Parameters
[in]hPhysicalGpuGPU selection.
[in]pI2cInfoThe I2C data input structure
Return values
NVAPI_OKCompleted request
NVAPI_ERRORMiscellaneous error occurred.
NVAPI_HANDLE_INVALIDATEDHandle passed has been invalidated (see user guide).
NVAPI_EXPECTED_PHYSICAL_GPU_HANDLEHandle passed is not a physical GPU handle.
NVAPI_INCOMPATIBLE_STRUCT_VERSIONStructure version is not supported.
NVAPI_INVALID_ARGUMENTArgument does not meet specified requirements
NVAPI_ARGUMENT_EXCEED_MAX_SIZEArgument exceeds the maximum


Copyright (c) 2007-2017 NVIDIA Corporation. All rights reserved.

NVIDIA