zephyr/samples/drivers/smbus
Johan Hedberg 03905f7e55 boards: x86: Add intel_ prefix to Elkhart Lake boards
This follows the same convention that has already been adopted by Intel
Alder Lake and Raptor Lake boards.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-08-15 11:24:35 +00:00
..
src samples, tests: Switch main return type from void to int 2023-04-14 07:49:41 +09:00
CMakeLists.txt tests: smbus: Cleanup CMakeLists files 2023-03-30 09:45:02 +00:00
prj.conf
README.rst
sample.yaml boards: x86: Add intel_ prefix to Elkhart Lake boards 2023-08-15 11:24:35 +00:00

.. _samples_smbus_shell:

SMBus Shell Sample
##################

Overview
********

This is a simple SMBus shell sample that allows arbitrary boards with SMBus
driver supported exploring the SMBus communication with peripheral devices.

Building and Running
********************

This project can be built and executed on as follows:

.. zephyr-app-commands::
   :zephyr-app: zephyr/samples/drivers/smbus
   :host-os: unix
   :board: qemu_x86_64
   :goals: run
   :compact:

Sample Output
=============

Output from console when application started::

   *** Booting Zephyr OS build zephyr-v3.2.0-804-gfedd72615e82  ***
   Start SMBUS shell sample qemu_x86_64
   uart:~$

List avaibalbe SMBus shell commands with::

   uart:~$ smbus
   smbus - smbus commands
   Subcommands:
     quick            :SMBus Quick command
                       Usage: quick <device> <addr>
     scan             :Scan SMBus peripheral devices command
                       Usage: scan <device>
     byte_read        :SMBus: byte read command
                       Usage: byte_read <device> <addr>
     byte_write       :SMBus: byte write command
                       Usage: byte_write <device> <addr> <value>
     byte_data_read   :SMBus: byte data read command
                       Usage: byte_data_read <device> <addr> <cmd>
     byte_data_write  :SMBus: byte data write command
                       Usage: byte_data_write <device> <addr> <cmd> <value>
     word_data_read   :SMBus: word data read command
                       Usage: word_data_read <device> <addr> <cmd>
     word_data_write  :SMBus: word data write command
                       Usage: word_data_write <device> <addr> <cmd> <value>
     block_write      :SMBus: Block Write command
                       Usage: block_write <device> <addr> <cmd> [<byte1>, ...]
     block_read       :SMBus: Block Read command
                       Usage: block_read <device> <addr> <cmd>

Scan for available SMBus devices with command::

   uart:~$ smbus scan smbus@fb00
        0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
   00:             -- -- -- -- -- -- -- -- -- -- -- --
   10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- --
   60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
   70: -- -- -- -- -- -- -- --
   8 devices found on smbus@fb00