aboutsummaryrefslogtreecommitdiffstats
path: root/test.gdb
diff options
context:
space:
mode:
authorPerry Hung <iperry@gmail.com>2011-02-28 18:16:03 -0500
committerPerry Hung <iperry@gmail.com>2011-02-28 18:16:03 -0500
commit1ba3d69c4a30c820edfd696d74346317379cc96a (patch)
tree1336d4ebf7c25973f37b4f15ff5b2eccfcc7783b /test.gdb
parent17aeb4e3dd9001ebe63a342c00b58cb7ac0e6231 (diff)
parentf4cdcfa51096f73a49642c400681d91847137dfb (diff)
downloadlibrambutan-1ba3d69c4a30c820edfd696d74346317379cc96a.tar.gz
librambutan-1ba3d69c4a30c820edfd696d74346317379cc96a.zip
i2c merge
Diffstat (limited to 'test.gdb')
-rw-r--r--test.gdb112
1 files changed, 112 insertions, 0 deletions
diff --git a/test.gdb b/test.gdb
new file mode 100644
index 0000000..8b71320
--- /dev/null
+++ b/test.gdb
@@ -0,0 +1,112 @@
+define i2c_sr1_flags
+set $s = $arg0
+printf "SR1: "
+
+if (($s & (1 << 15)))
+ printf "SMBALERT "
+end
+
+if (($s & (1 << 14)))
+ printf "TIMEOUT "
+end
+
+if (($s & (1 << 12)))
+ printf "PECERR "
+end
+
+if (($s & (1 << 11)))
+ printf "OVR "
+end
+
+if (($s & (1 << 10)))
+ printf "AF "
+end
+
+if (($s & (1 << 9)))
+ printf "ARLO "
+end
+
+if (($s & (1 << 8)))
+ printf "BERR "
+end
+
+if (($s & (1 << 7)))
+ printf "TXE "
+end
+
+if (($s & (1 << 6)))
+ printf "RXNE "
+end
+
+if (($s & (1 << 4)))
+ printf "STOPF "
+end
+
+if (($s & (1 << 3)))
+ printf "ADD10 "
+end
+
+if (($s & (1 << 2)))
+ printf "BTF "
+end
+
+if (($s & (1 << 1)))
+ printf "ADDR "
+end
+
+if (($s & (1 << 0)))
+ printf "SB "
+end
+end
+
+define i2c_sr2_flags
+set $s = $arg0
+printf "SR2: "
+
+if (($s & (1 << 7)))
+ printf "DUALF "
+end
+
+if (($s & (1 << 6)))
+ printf "SMBHOST "
+end
+
+if (($s & (1 << 5)))
+ printf "SMBDEFAULT "
+end
+
+if (($s & (1 << 4)))
+ printf "GENCALL "
+end
+
+
+if (($s & (1 << 2)))
+ printf "TRA "
+end
+
+if (($s & (1 << 1)))
+ printf "BUSY "
+end
+
+if (($s & (1 << 0)))
+ printf "MSL "
+end
+
+end
+
+define pbc
+set $c = crumbs
+while ($c->event)
+ if ($c->event != 0)
+ printf "Event: %d ", $c->event
+ if ($c->event == 1)
+ i2c_sr1_flags $c->sr1
+ printf "\t"
+ i2c_sr2_flags $c->sr2
+ end
+ printf "\n"
+ end
+ set $c = $c + 1
+end
+
+