Part 1
요약·해설
QEMU build, command usage와 주소 0x50~0x57 탐지 출력을 보존합니다.
Commands
Quick · Read · Write · Scan
Board
qemu_x86_64
Found
8 devices
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
원문 SHA-256
D716206C3C495E094091CC907D796F1965D32319DAA18F9AB1D56540D151CFD3
.. zephyr:code-sample:: smbus-shell
:name: SMBus shell
:relevant-api: smbus_interface
Interact with SMBus peripherals using shell commands.
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 sample can be found under :zephyr_file:`samples/drivers/smbus` in the
Zephyr tree.
The sample can be built and run as follows for the ``qemu_x86_64`` board:
.. 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:
.. code-block:: console
*** Booting Zephyr OS build zephyr-v3.2.0-804-gfedd72615e82 ***
Start SMBUS shell sample qemu_x86_64
uart:~$
List available SMBus shell commands with:
.. code-block:: console
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:
.. code-block:: console
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
Part 3
한국어 전문 번역
개요
SMBus driver를 지원하는 임의의 board에서 peripheral device와의 SMBus 통신을 살펴볼 수 있게 하는 간단한 SMBus shell sample입니다.
Build와 실행
이 sample은 Zephyr tree의 samples/drivers/smbus에 있습니다. qemu_x86_64 board용으로 다음과 같이 build하고 실행할 수 있습니다.
west build -b qemu_x86_64 zephyr/samples/drivers/smbus
west build -t run
Sample 출력
Application을 시작하면 console에 다음 내용이 출력됩니다.
*** Booting Zephyr OS build zephyr-v3.2.0-804-gfedd72615e82 ***
Start SMBUS shell sample qemu_x86_64
uart:~$
다음 명령으로 사용할 수 있는 SMBus shell command 목록을 확인합니다.
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>
다음 명령으로 사용 가능한 SMBus device를 scan합니다.
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
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.