The I2C interface support in the Microsoft Windows family of operating systems reduces the development requirements of video board manufacturers. The I2C bus maximizes hardware efficiency and circuit simplicity with a bi-directional two-wire design (a serial data line and a serial clock line). This design provides more flexibility and lowers interconnecting costs by reducing board space and pin count.
The general movement in hardware manufacturing is toward the I2C bus in order to implement a modular approach to building video cards. This approach uses the I2C bus to connect devices to a master device. The master device sends commands to the other components, such as a tuner, for setting and reading the properties of the components.
Video card components (television tuners, AM/FM tuners, video decoders, video encoders, television audio decoders and video crossbars) are controlled by WDM minidrivers. Using minidrivers allows hardware vendors to create video drivers for various cards by installing the minidrivers that work with the specific video components on the card. Ideally, these component minidrivers will not require modification or recompilation when used in varying hardware configurations.
In Windows, video devices use a WDM Stream class minidriver to control the video stream. These minidrivers communicate via an I2C interface that is provided by the driver of the device that physically owns the I2C master port. The I2C master device is generally either a VGA controller or another Stream class minidriver.
The slave minidriver controls a specific component on the video card by sending I2C commands to that component. For video cards that use the I2C bus, the component minidrivers tell the master device (I2C service provider) what command to send to which device on the I2C bus. It sends the commands by calling functions in the miniVDD or parent WDM minidriver.
Video cards that use the I2C bus under Windows must now use an INF file to list the devices on the bus. The INF file for the miniVDD or WDM minidriver has to include references to the slave devices so that Plug and Play can load the slave minidrivers.
The miniVDD is the vendor-specific code that supports the display chip set. When the VGA chip set is the I2C master, this I2C support must be added to the miniVDD. When running I2C devices in a Windows 98/Me multiple-monitor configuration, the miniVDD must be installed as a miniVDD2 to support I2C on the secondary device. See "Writing a Windows MiniVDD for a secondary display" in the Windows DDK for more information.
The I2C bus is a two-wire serial bus. One wire is the Serial Clock Line (SCL), and the other is the Serial Data Line (SDL). The bus is controlled by a bus master device that tells slave devices when they can access the bus. Each slave has a unique 7-bit or 10-bit address. When the master device accesses a slave, it sends the address and a read/write bit. Then, the addressed slave acknowledges the connection and the master can send or receive data to or from the slave. On a typical video display card, the master device is the VGA controller chip.
Notice that once the master has connected to a slave, the protocol for the data exchanged can be different for each slave. There are no standard protocols for such tasks as identifying the device or changing the device status. Therefore, it is not possible to create a video driver that can configure itself for different bus arrangements. The recommended procedure for configuring the minidrivers for a given video card is to provide an INF file describing the devices on the I2C bus.
A WDM Stream class driver uses one or more minidrivers to control devices on the video card. The minidriver receives Stream Request Blocks (SRB) from the class driver and converts the requests to commands for the devices on the video card.
The minidriver for the master device includes methods to control the I2C bus. Other minidrivers can use these methods by getting an interface from the miniVDD or parent WDM driver and passing the required structures to the methods.
On system start up, Plug and Play loads the minidrivers listed in the stream class driver INF file, then it calls the DriverEntry functions in each minidriver. After the DriverEntry function returns, the class driver begins sending SRBs to the function indicated in HwInitData.HwReceivePacket.
Sample SRB commands that the minidriver handles are shown in the following table.
| SRB command | Description |
SRB_INITIALIZE_DEVICE | Perform any hardware initializations required by the device. |
SRB_UNINITIALIZE_DEVICE | Uninitialize the device. |
SRB_OPEN_STREAM | Start a data stream on devices that send and receive data. |
SRB_CLOSE_STREAM | Stop a data stream on devices that send and receive data. |
SRB_GET_STREAM_INFO | Get information about a stream. |
SRB_CHANGE_POWER_STATE | Plug and Play SRB to tell the device to enter a low power state. |
SRB_GET_DEVICE_PROPERTY | Get a property from the device. |
SRB_SET_DEVICE_PROPERTY | Set a property of the device. |
The minidrivers' properties indicate how the devices on the I2C bus operate. Each minidriver must indicate what properties the minidriver supports. After the video class driver gets the list of properties supported by the minidriver, it uses the SRB commands SRB_GET_DEVICE_PROPERTY and SRB_SET_DEVICE_PROPERTY to get and set properties of the device controlled by the minidriver.