From 9ed980785429db35f51f8d324cc75c23f2e5fb20 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 22 Oct 2013 00:24:32 +0200 Subject: hwstub: rework i2c completely Change-Id: I1e5f87f15f0ca9586d8185316ffcaeef6d9d4d38 --- utils/hwstub/tools/lua/i2c_scan.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 utils/hwstub/tools/lua/i2c_scan.lua (limited to 'utils/hwstub/tools/lua/i2c_scan.lua') diff --git a/utils/hwstub/tools/lua/i2c_scan.lua b/utils/hwstub/tools/lua/i2c_scan.lua new file mode 100644 index 0000000000..def7b5d84c --- /dev/null +++ b/utils/hwstub/tools/lua/i2c_scan.lua @@ -0,0 +1,11 @@ +I2CSCAN = {} + +function I2CSCAN.scan() + STMP.i2c.init() + STMP.i2c.set_speed(true) + for i = 2, 254, 2 do + if STMP.i2c.transmit(i, {}, true) then + print(string.format("%#x OK", i)) + end + end + end \ No newline at end of file -- cgit v1.2.3