|
Packit |
7b02f3 |
I2C and SMBus
|
|
Packit |
7b02f3 |
=============
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
I2C (pronounce: I squared C) is a protocol developed by Philips. It is a
|
|
Packit |
7b02f3 |
slow two-wire protocol (variable speed, up to 400 kHz), with a high speed
|
|
Packit |
7b02f3 |
extension (3.4 MHz). It provides an inexpensive bus for connecting many
|
|
Packit |
7b02f3 |
types of devices with infrequent or low bandwidth communications needs.
|
|
Packit |
7b02f3 |
I2C is widely used with embedded systems. Some systems use variants that
|
|
Packit |
7b02f3 |
don't meet branding requirements, and so are not advertised as being I2C.
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
SMBus (System Management Bus) is based on the I2C protocol, and is mostly
|
|
Packit |
7b02f3 |
a subset of I2C protocols and signaling. Many I2C devices will work on an
|
|
Packit |
7b02f3 |
SMBus, but some SMBus protocols add semantics beyond what is required to
|
|
Packit |
7b02f3 |
achieve I2C branding. Modern PC mainboards rely on SMBus. The most common
|
|
Packit |
7b02f3 |
devices connected through SMBus are RAM modules configured using I2C EEPROMs,
|
|
Packit |
7b02f3 |
and hardware monitoring chips.
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
Because the SMBus is mostly a subset of the generalized I2C bus, we can
|
|
Packit |
7b02f3 |
use its protocols on many I2C systems. However, there are systems that don't
|
|
Packit |
7b02f3 |
meet both SMBus and I2C electrical constraints; and others which can't
|
|
Packit |
7b02f3 |
implement all the common SMBus protocol semantics or messages.
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
Terminology
|
|
Packit |
7b02f3 |
===========
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
When we talk about I2C, we use the following terms:
|
|
Packit |
7b02f3 |
Bus -> Algorithm
|
|
Packit |
7b02f3 |
Adapter
|
|
Packit |
7b02f3 |
Device -> Driver
|
|
Packit |
7b02f3 |
Client
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
An Algorithm driver contains general code that can be used for a whole class
|
|
Packit |
7b02f3 |
of I2C adapters. Each specific adapter driver either depends on one algorithm
|
|
Packit |
7b02f3 |
driver, or includes its own implementation.
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
A Driver driver (yes, this sounds ridiculous, sorry) contains the general
|
|
Packit |
7b02f3 |
code to access some type of device. Each detected device gets its own
|
|
Packit |
7b02f3 |
data in the Client structure. Usually, Driver and Client are more closely
|
|
Packit |
7b02f3 |
integrated than Algorithm and Adapter.
|
|
Packit |
7b02f3 |
|
|
Packit |
7b02f3 |
For a given configuration, you will need a driver for your I2C bus, and
|
|
Packit |
7b02f3 |
drivers for your I2C devices (usually one driver for each device).
|