diff options
Diffstat (limited to 'utils/hwstub/tools/lua/i2c_scan.lua')
-rw-r--r-- | utils/hwstub/tools/lua/i2c_scan.lua | 11 |
1 files changed, 11 insertions, 0 deletions
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 @@ | |||
1 | I2CSCAN = {} | ||
2 | |||
3 | function I2CSCAN.scan() | ||
4 | STMP.i2c.init() | ||
5 | STMP.i2c.set_speed(true) | ||
6 | for i = 2, 254, 2 do | ||
7 | if STMP.i2c.transmit(i, {}, true) then | ||
8 | print(string.format("%#x OK", i)) | ||
9 | end | ||
10 | end | ||
11 | end \ No newline at end of file | ||