aboutsummaryrefslogtreecommitdiffstats
path: root/support/gdb/i2c/test.gdb
blob: 8b71320a215e43eeff95453701663386417d7380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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