summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-01-06 13:15:41 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-01-06 13:15:41 +0100
commit281b5e41426714bb7121ceec8355825f94f62db3 (patch)
treeb892480d155a77cfc7b0245d2857dff40c6dc46d
parentba1ee998244fc027cfd1140747aee596a8a28be2 (diff)
adjust ds2482-100 examples for vusb-i2cget multi-byte support
-rwxr-xr-xcommandline/examples/ds2482-100-readrom18
-rwxr-xr-xcommandline/examples/ds2482-100-searchrom4
2 files changed, 11 insertions, 11 deletions
diff --git a/commandline/examples/ds2482-100-readrom b/commandline/examples/ds2482-100-readrom
index 88df4de..7b08b0f 100755
--- a/commandline/examples/ds2482-100-readrom
+++ b/commandline/examples/ds2482-100-readrom
@@ -11,7 +11,7 @@ vusb-i2cset 0x18 0xf0 || echo "Failed to reset chip"
vusb-i2cset 0x18 0xd2 $CONFIG || echo "Failed to set config"
vusb-i2cset 0x18 0xb4 || echo "Failed to initiate presence detection (OWR)"
-ret=$(( $(vusb-i2cget 0x18 0xe1 0xf0) & 0x02 ))
+ret=$(( $(vusb-i2cget 0x18 1 0xe1 0xf0) & 0x02 ))
if [ "${ret}" = 0 ]; then
echo "No presence detected"
@@ -21,20 +21,20 @@ fi
vusb-i2cset 0x18 0xa5 0x33 || echo "failed to issue READ ROM"
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b8=$(vusb-i2cget 0x18 0xe1 0xe1)
+b8=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b7=$(vusb-i2cget 0x18 0xe1 0xe1)
+b7=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b6=$(vusb-i2cget 0x18 0xe1 0xe1)
+b6=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b5=$(vusb-i2cget 0x18 0xe1 0xe1)
+b5=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b4=$(vusb-i2cget 0x18 0xe1 0xe1)
+b4=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b3=$(vusb-i2cget 0x18 0xe1 0xe1)
+b3=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b2=$(vusb-i2cget 0x18 0xe1 0xe1)
+b2=$(vusb-i2cget 0x18 1 0xe1 0xe1)
vusb-i2cset 0x18 0x96 || echo "failed to initiate read"
-b1=$(vusb-i2cget 0x18 0xe1 0xe1)
+b1=$(vusb-i2cget 0x18 1 0xe1 0xe1)
printf "%02X%02X%02X%02X%02X%02X%02X%02X\n" $b1 $b2 $b3 $b4 $b5 $b6 $b7 $b8
diff --git a/commandline/examples/ds2482-100-searchrom b/commandline/examples/ds2482-100-searchrom
index db478e7..1f97437 100755
--- a/commandline/examples/ds2482-100-searchrom
+++ b/commandline/examples/ds2482-100-searchrom
@@ -11,7 +11,7 @@ vusb-i2cset 0x18 0xf0 || echo "Failed to reset chip"
vusb-i2cset 0x18 0xd2 $CONFIG || echo "Failed to set config"
vusb-i2cset 0x18 0xb4 || echo "Failed to initiate presence detection (OWR)"
-ret=$(( $(vusb-i2cget 0x18 0xe1 0xf0) & 0x02 ))
+ret=$(( $(vusb-i2cget 0x18 1 0xe1 0xf0) & 0x02 ))
if [ "${ret}" = 0 ]; then
echo "No presence detected"
@@ -27,7 +27,7 @@ for i in $(seq 1 8); do
for j in $(seq 0 7); do
vusb-i2cset 0x18 0x78 0x00 || echo "failed to send triplet"
- bit=$(vusb-i2cget 0x18 0xe1 0xf0)
+ bit=$(vusb-i2cget 0x18 1 0xe1 0xf0)
if [ "${bit}" -ge 80 ]; then
byte=$((byte | (1 << j)))