2022-09-29 22:43:22 +08:00
|
|
|
.. _smbus_api:
|
|
|
|
|
2023-03-28 22:10:21 +08:00
|
|
|
System Management Bus (SMBus)
|
|
|
|
#############################
|
2022-09-29 22:43:22 +08:00
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
|
|
|
:depth: 2
|
|
|
|
|
|
|
|
Overview
|
|
|
|
********
|
|
|
|
|
|
|
|
System Management Bus (SMBus) is derived from I2C for communication
|
|
|
|
with devices on the motherboard. A system may use SMBus to communicate
|
|
|
|
with the peripherals on the motherboard without using dedicated control
|
2023-05-30 23:26:51 +08:00
|
|
|
lines. SMBus peripherals can provide various manufacturer information,
|
2022-09-29 22:43:22 +08:00
|
|
|
report errors, accept control parameters, etc.
|
|
|
|
|
2023-05-30 23:26:51 +08:00
|
|
|
Devices on the bus can operate in three roles: as a Controller that
|
|
|
|
initiates transactions and controls the clock, a Peripheral that
|
|
|
|
responds to transaction commands, or a Host, which is a specialized
|
|
|
|
Controller, that provides the main interface to the system's CPU.
|
|
|
|
Zephyr has API for the Controller role.
|
2022-09-29 22:43:22 +08:00
|
|
|
|
2023-05-30 23:26:51 +08:00
|
|
|
SMBus peripheral devices can initiate communication with Controller
|
2022-09-29 22:43:22 +08:00
|
|
|
with two methods:
|
|
|
|
|
2023-05-30 23:26:51 +08:00
|
|
|
* **Host Notify protocol**: Peripheral device that supports the Host Notify
|
|
|
|
protocol behaves as a Controller to perform the notification. It writes
|
|
|
|
a three-bytes message to a special address "SMBus Host (0x08)" with own
|
2022-09-29 22:43:22 +08:00
|
|
|
address and two bytes of relevant data.
|
|
|
|
* **SMBALERT# signal**: Peripheral device uses special signal SMBALERT# to
|
2023-05-30 23:26:51 +08:00
|
|
|
request attention from the Controller. The Controller needs to read one byte
|
2022-09-29 22:43:22 +08:00
|
|
|
from the special "SMBus Alert Response Address (ARA) (0x0c)". The peripheral
|
2023-05-30 23:26:51 +08:00
|
|
|
device responds with a data byte containing its own address.
|
2022-09-29 22:43:22 +08:00
|
|
|
|
|
|
|
Currently, the API is based on `SMBus Specification`_ version 2.0
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
See :ref:`coding_guideline_inclusive_language` for information about
|
|
|
|
the terminology used in this API.
|
|
|
|
|
|
|
|
.. _smbus-controller-api:
|
|
|
|
|
|
|
|
SMBus Controller API
|
|
|
|
********************
|
|
|
|
|
|
|
|
Zephyr's SMBus controller API is used when an SMBus device controls the bus,
|
2023-05-30 23:26:51 +08:00
|
|
|
particularly the start and stop conditions and the clock. This is
|
|
|
|
the most common mode used to interact with SMBus peripherals.
|
2022-09-29 22:43:22 +08:00
|
|
|
|
|
|
|
Configuration Options
|
|
|
|
*********************
|
|
|
|
|
|
|
|
Related configuration options:
|
|
|
|
|
|
|
|
* :kconfig:option:`CONFIG_SMBUS`
|
|
|
|
|
|
|
|
API Reference
|
|
|
|
*************
|
|
|
|
|
|
|
|
.. doxygengroup:: smbus_interface
|
|
|
|
|
|
|
|
.. _SMBus Specification: http://smbus.org/specs/smbus20.pdf
|