Lines Matching +full:echo +full:- +full:gpios
1 .. SPDX-License-Identifier: GPL-2.0
7 by Wolfram Sang <wsa@sang-engineering.com> in 2020
11 easy to obtain). Examples include multi-master testing, and SMBus Host Notify
21 # echo "slave-testunit 0x1030" > /sys/bus/i2c/devices/i2c-0/new_device
30 compatible = "slave-testunit";
39 When writing, the device consists of 4 8-bit registers and, except for some
43 .. csv-table::
51 Using 'i2cset' from the i2c-tools package, the generic command looks like::
53 # i2cset -y <bus_num> <testunit_address> <CMD> <DATAL> <DATAH> <DELAY> i
63 --------
73 .. list-table::
74 :header-rows: 1
76 * - CMD
77 - DATAL
78 - DATAH
79 - DELAY
81 * - 0x01
82 - address to read data from (lower 7 bits, highest bit currently unused)
83 - number of bytes to read
84 - n * 10ms
87 handling multi-master correctly. You can trigger the testunit to read bytes
92 # i2cset -y 0 0x30 1 0x50 0x80 5 i
97 .. list-table::
98 :header-rows: 1
100 * - CMD
101 - DATAL
102 - DATAH
103 - DELAY
105 * - 0x02
106 - low byte of the status word to send
107 - high byte of the status word to send
108 - n * 10ms
114 # i2cset -y 0 0x30 2 0x42 0x64 1 i
124 .. list-table::
125 :header-rows: 1
127 * - CMD
128 - DATAL
129 - DATAH
130 - DELAY
132 * - 0x03
133 - 0x01 (i.e. one further byte will be written)
134 - number of bytes to be sent back
135 - leave out, partial command!
144 from length-1 to 0. Here is an example which emulates
145 i2c_smbus_block_process_call() using i2ctransfer (you need i2c-tools v4.2 or
148 # i2ctransfer -y 0 w3@0x30 3 1 0x10 r?
154 .. list-table::
155 :header-rows: 1
157 * - CMD
158 - DATAL
159 - DATAH
160 - DELAY
162 * - 0x04
163 - currently unused
164 - currently unused
165 - leave out, partial command!
174 # i2ctransfer -y 0 w3@0x30 4 0 0 r128
177 If you have i2c-tools 4.4 or later, you can print out the data right away::
179 # i2ctransfer -y -b 0 w3@0x30 4 0 0 r128
180 v6.11.0-rc1-00009-gd37a1b4d3fd0
186 # i2cset -y 0 0x30 4 0 0 i; i2cget -y 0 0x30
192 .. list-table::
193 :header-rows: 1
195 * - CMD
196 - DATAL
197 - DATAH
198 - DELAY
200 * - 0x05
201 - response value (7 MSBs interpreted as I2C address)
202 - currently unused
203 - n * 10ms
211 gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
216 # i2cset -y 0 0x30 5 0xc9 0x00 100 i
221 smbus_alert 0-000c: SMBALERT# from dev 0x64, flag 1
228 93: 1 gpio-rcar 26 Edge smbus_alert