Skip to content

Commit

Permalink
i2c_packet: tests added for the new i2c_packet PD
Browse files Browse the repository at this point in the history
  • Loading branch information
sespivak committed Aug 31, 2022
1 parent 12f978c commit 3eb0a44
Show file tree
Hide file tree
Showing 17 changed files with 1,245 additions and 0 deletions.
5 changes: 5 additions & 0 deletions decoder/test/i2c_packet/bh1750_h2resolutionmode.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
5000-5105 i2c_packet: data: "0x23 WR: 01" "23 WR: 01"
5120-5441 i2c_packet: data: "0x23 WR: 42 [SR] 0x23 WR: 65 [SR] 0x23 WR: 21" "23 WR: 42 [SR] 23 WR: 65 [SR] 23 WR: 21"
5504-5822 i2c_packet: data: "0x23 WR: 47 [SR] 0x23 WR: 7E [SR] 0x23 WR: 21" "23 WR: 47 [SR] 23 WR: 7E [SR] 23 WR: 21"
5887-5992 i2c_packet: data: "0x23 WR: 21" "23 WR: 21"
469231-469383 i2c_packet: data: "0x23 RD: 00 E2" "23 RD: 00 E2"
14 changes: 14 additions & 0 deletions decoder/test/i2c_packet/bh1750_h2resolutionmode.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
5000-5105 i2c_packet: ('PACKET WRITE', (35, (1,)))
5105-5105 i2c_packet: ('TRANSACTION END', None)
5120-5220 i2c_packet: ('PACKET WRITE', (35, (66,)))
5225-5327 i2c_packet: ('PACKET WRITE', (35, (101,)))
5332-5441 i2c_packet: ('PACKET WRITE', (35, (33,)))
5441-5441 i2c_packet: ('TRANSACTION END', None)
5504-5604 i2c_packet: ('PACKET WRITE', (35, (71,)))
5609-5711 i2c_packet: ('PACKET WRITE', (35, (126,)))
5716-5822 i2c_packet: ('PACKET WRITE', (35, (33,)))
5822-5822 i2c_packet: ('TRANSACTION END', None)
5887-5992 i2c_packet: ('PACKET WRITE', (35, (33,)))
5992-5992 i2c_packet: ('TRANSACTION END', None)
469231-469383 i2c_packet: ('PACKET READ', (35, (0, 226)))
469383-469383 i2c_packet: ('TRANSACTION END', None)
4 changes: 4 additions & 0 deletions decoder/test/i2c_packet/bh1750_hresolutionmode.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1000-1105 i2c_packet: data: "0x23 WR: 01" "23 WR: 01"
1120-1441 i2c_packet: data: "0x23 WR: 42 [SR] 0x23 WR: 65 [SR] 0x23 WR: 20" "23 WR: 42 [SR] 23 WR: 65 [SR] 23 WR: 20"
1501-1606 i2c_packet: data: "0x23 WR: 20" "23 WR: 20"
63800-63953 i2c_packet: data: "0x23 RD: 00 29" "23 RD: 00 29"
10 changes: 10 additions & 0 deletions decoder/test/i2c_packet/bh1750_hresolutionmode.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1000-1105 i2c_packet: ('PACKET WRITE', (35, (1,)))
1105-1105 i2c_packet: ('TRANSACTION END', None)
1120-1220 i2c_packet: ('PACKET WRITE', (35, (66,)))
1225-1327 i2c_packet: ('PACKET WRITE', (35, (101,)))
1332-1441 i2c_packet: ('PACKET WRITE', (35, (32,)))
1441-1441 i2c_packet: ('TRANSACTION END', None)
1501-1606 i2c_packet: ('PACKET WRITE', (35, (32,)))
1606-1606 i2c_packet: ('TRANSACTION END', None)
63800-63953 i2c_packet: ('PACKET READ', (35, (0, 41)))
63953-63953 i2c_packet: ('TRANSACTION END', None)
5 changes: 5 additions & 0 deletions decoder/test/i2c_packet/gigabyte_6vle_vxl_i2c.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3670527-3675231 i2c_packet: data: "0x50 WR: 1B [SR] 0x50 RD: 50" "50 WR: 1B [SR] 50 RD: 50"
3675596-3680299 i2c_packet: data: "0x50 WR: 1E [SR] 0x50 RD: 2D" "50 WR: 1E [SR] 50 RD: 2D"
3680665-3685368 i2c_packet: data: "0x50 WR: 1D [SR] 0x50 RD: 50" "50 WR: 1D [SR] 50 RD: 50"
3700267-3721458 i2c_packet: data: "0x69 WR: 00 [SR] 0x69 RD: 0F 06 FF FF FF FF FF 51 86 0F 08 01 88 0E E5 F7" "69 WR: 00 [SR] 69 RD: 0F 06 FF FF FF FF FF 51 86 0F 08 01 88 0E E5 F7"
3825148-3854950 i2c_packet: data: "0x69 WR: 00 18 AE FF EF FB 0F C0 F1 17 18 10 7A 8C 81 1F 18 00 00 00 00 00 00 00 00 00" "69 WR: 00 18 AE FF EF FB 0F C0 F1 17 18 10 7A 8C 81 1F 18 00 00 00 00 00 00 00 00 00"
14 changes: 14 additions & 0 deletions decoder/test/i2c_packet/gigabyte_6vle_vxl_i2c.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
3670527-3672821 i2c_packet: ('PACKET WRITE', (80, (27,)))
3672881-3675231 i2c_packet: ('PACKET READ', (80, (80,)))
3675231-3675231 i2c_packet: ('TRANSACTION END', None)
3675596-3677890 i2c_packet: ('PACKET WRITE', (80, (30,)))
3677950-3680299 i2c_packet: ('PACKET READ', (80, (45,)))
3680299-3680299 i2c_packet: ('TRANSACTION END', None)
3680665-3682958 i2c_packet: ('PACKET WRITE', (80, (29,)))
3683018-3685368 i2c_packet: ('PACKET READ', (80, (80,)))
3685368-3685368 i2c_packet: ('TRANSACTION END', None)
3700267-3702562 i2c_packet: ('PACKET WRITE', (105, (0,)))
3702621-3721458 i2c_packet: ('PACKET READ', (105, (15, 6, 255, 255, 255, 255, 255, 81, 134, 15, 8, 1, 136, 14, 229, 247)))
3721458-3721458 i2c_packet: ('TRANSACTION END', None)
3825148-3854950 i2c_packet: ('PACKET WRITE', (105, (0, 24, 174, 255, 239, 251, 15, 192, 241, 23, 24, 16, 122, 140, 129, 31, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0)))
3854950-3854950 i2c_packet: ('TRANSACTION END', None)
8 changes: 8 additions & 0 deletions decoder/test/i2c_packet/rtc_ds1307_200khz.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
0-171 i2c_packet: data: "0x68 WR: 00 30 35 23 01 10 03 13" "68 WR: 00 30 35 23 01 10 03 13"
253-471 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
3548-3756 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
7470-7677 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
11405-11614 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
15332-15548 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
19253-19507 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
23211-23447 i2c_packet: data: "0x68 WR: 00 [SR] 0x68 RD: 30 35 23 01 10 03 13" "68 WR: 00 [SR] 68 RD: 30 35 23 01 10 03 13"
23 changes: 23 additions & 0 deletions decoder/test/i2c_packet/rtc_ds1307_200khz.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
0-171 i2c_packet: ('PACKET WRITE', (104, (0, 48, 53, 35, 1, 16, 3, 19)))
171-171 i2c_packet: ('TRANSACTION END', None)
253-291 i2c_packet: ('PACKET WRITE', (104, (0,)))
323-471 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
471-471 i2c_packet: ('TRANSACTION END', None)
3548-3586 i2c_packet: ('PACKET WRITE', (104, (0,)))
3608-3756 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
3756-3756 i2c_packet: ('TRANSACTION END', None)
7470-7508 i2c_packet: ('PACKET WRITE', (104, (0,)))
7529-7677 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
7677-7677 i2c_packet: ('TRANSACTION END', None)
11405-11444 i2c_packet: ('PACKET WRITE', (104, (0,)))
11466-11614 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
11614-11614 i2c_packet: ('TRANSACTION END', None)
15332-15370 i2c_packet: ('PACKET WRITE', (104, (0,)))
15400-15548 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
15548-15548 i2c_packet: ('TRANSACTION END', None)
19253-19292 i2c_packet: ('PACKET WRITE', (104, (0,)))
19359-19507 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
19507-19507 i2c_packet: ('TRANSACTION END', None)
23211-23283 i2c_packet: ('PACKET WRITE', (104, (0,)))
23299-23447 i2c_packet: ('PACKET READ', (104, (48, 53, 35, 1, 16, 3, 19)))
23447-23447 i2c_packet: ('TRANSACTION END', None)
7 changes: 7 additions & 0 deletions decoder/test/i2c_packet/sensirion_sht21_humidity35.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1369822-1373475 i2c_packet: data: "0x40 RD: 84" "40 RD: 84"
7369743-9379221 i2c_packet: data: "0x40 WR: 245 [SR] 0x40 RD: 85" "40 WR: 245 [SR] 40 RD: 85"
15375438-17384971 i2c_packet: data: "0x40 WR: 245 [SR] 0x40 RD: 87" "40 WR: 245 [SR] 40 RD: 87"
23381134-25390665 i2c_packet: data: "0x40 WR: 245 [SR] 0x40 RD: 87" "40 WR: 245 [SR] 40 RD: 87"
31386830-33396359 i2c_packet: data: "0x40 WR: 245 [SR] 0x40 RD: 87" "40 WR: 245 [SR] 40 RD: 87"
39392526-41402011 i2c_packet: data: "0x40 WR: 245 [SR] 0x40 RD: 85" "40 WR: 245 [SR] 40 RD: 85"
47398222-49407708 i2c_packet: data: "0x40 WR: 245 [SR] 0x40 RD: 85" "40 WR: 245 [SR] 40 RD: 85"
20 changes: 20 additions & 0 deletions decoder/test/i2c_packet/sensirion_sht21_humidity35.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
1369822-1373475 i2c_packet: ('PACKET READ', (64, (84,)))
1373475-1373475 i2c_packet: ('TRANSACTION END', None)
7369743-7373301 i2c_packet: ('PACKET WRITE', (64, (245,)))
9375517-9379221 i2c_packet: ('PACKET READ', (64, (85,)))
9379221-9379221 i2c_packet: ('TRANSACTION END', None)
15375438-15378992 i2c_packet: ('PACKET WRITE', (64, (245,)))
17381213-17384971 i2c_packet: ('PACKET READ', (64, (87,)))
17384971-17384971 i2c_packet: ('TRANSACTION END', None)
23381134-23384686 i2c_packet: ('PACKET WRITE', (64, (245,)))
25386911-25390665 i2c_packet: ('PACKET READ', (64, (87,)))
25390665-25390665 i2c_packet: ('TRANSACTION END', None)
31386830-31390378 i2c_packet: ('PACKET WRITE', (64, (245,)))
33392606-33396359 i2c_packet: ('PACKET READ', (64, (87,)))
33396359-33396359 i2c_packet: ('TRANSACTION END', None)
39392526-39396075 i2c_packet: ('PACKET WRITE', (64, (245,)))
41398302-41402011 i2c_packet: ('PACKET READ', (64, (85,)))
41402011-41402011 i2c_packet: ('TRANSACTION END', None)
47398222-47401771 i2c_packet: ('PACKET WRITE', (64, (245,)))
49403999-49407708 i2c_packet: ('PACKET READ', (64, (85,)))
49407708-49407708 i2c_packet: ('TRANSACTION END', None)
12 changes: 12 additions & 0 deletions decoder/test/i2c_packet/sensirion_sht31_25rh_28rh.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
5502999-5504530 i2c_packet: data: "0x45 RD: 67 A2 E4 48 7F E9" "45 RD: 67 A2 E4 48 7F E9"
5509775-13504124 i2c_packet: data: "0x45 WR: 24 00 [SR] 0x45 RD: 67 AD CA 48 54 85" "45 WR: 24 00 [SR] 45 RD: 67 AD CA 48 54 85"
13509365-21503719 i2c_packet: data: "0x45 WR: 24 00 [SR] 0x45 RD: 67 B7 52 48 33 A9" "45 WR: 24 00 [SR] 45 RD: 67 B7 52 48 33 A9"
21508960-29503313 i2c_packet: data: "0x45 WR: 24 00 [SR] 0x45 RD: 67 C2 5F 47 FD 68" "45 WR: 24 00 [SR] 45 RD: 67 C2 5F 47 FD 68"
29508539-37502908 i2c_packet: data: "0x45 WR: 24 00 [SR] 0x45 RD: 67 D2 1C 47 DD EE" "45 WR: 24 00 [SR] 45 RD: 67 D2 1C 47 DD EE"
37508140-45502502 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 67 E1 8A 47 DF 8C" "45 WR: 24 16 [SR] 45 RD: 67 E1 8A 47 DF 8C"
45504803-53502096 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 67 E1 8A 47 9A 44" "45 WR: 24 16 [SR] 45 RD: 67 E1 8A 47 9A 44"
53504410-61501692 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 67 F6 5E 47 A9 D2" "45 WR: 24 16 [SR] 45 RD: 67 F6 5E 47 A9 D2"
61504004-69501287 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 67 F1 C9 46 F3 83" "45 WR: 24 16 [SR] 45 RD: 67 F1 C9 46 F3 83"
69503600-77500881 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 68 21 54 46 FB 3A" "45 WR: 24 16 [SR] 45 RD: 68 21 54 46 FB 3A"
77503194-85500477 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 68 1C DD 46 89 A0" "45 WR: 24 16 [SR] 45 RD: 68 1C DD 46 89 A0"
85502789-93500071 i2c_packet: data: "0x45 WR: 24 16 [SR] 0x45 RD: 68 37 B1 46 C5 E0" "45 WR: 24 16 [SR] 45 RD: 68 37 B1 46 C5 E0"
35 changes: 35 additions & 0 deletions decoder/test/i2c_packet/sensirion_sht31_25rh_28rh.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
5502999-5504530 i2c_packet: ('PACKET READ', (69, (103, 162, 228, 72, 127, 233)))
5504530-5504530 i2c_packet: ('TRANSACTION END', None)
5509775-5510452 i2c_packet: ('PACKET WRITE', (69, (36, 0)))
13502594-13504124 i2c_packet: ('PACKET READ', (69, (103, 173, 202, 72, 84, 133)))
13504124-13504124 i2c_packet: ('TRANSACTION END', None)
13509365-13510042 i2c_packet: ('PACKET WRITE', (69, (36, 0)))
21502188-21503719 i2c_packet: ('PACKET READ', (69, (103, 183, 82, 72, 51, 169)))
21503719-21503719 i2c_packet: ('TRANSACTION END', None)
21508960-21509636 i2c_packet: ('PACKET WRITE', (69, (36, 0)))
29501783-29503313 i2c_packet: ('PACKET READ', (69, (103, 194, 95, 71, 253, 104)))
29503313-29503313 i2c_packet: ('TRANSACTION END', None)
29508539-29509215 i2c_packet: ('PACKET WRITE', (69, (36, 0)))
37501377-37502908 i2c_packet: ('PACKET READ', (69, (103, 210, 28, 71, 221, 238)))
37502908-37502908 i2c_packet: ('TRANSACTION END', None)
37508140-37508814 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
45500972-45502502 i2c_packet: ('PACKET READ', (69, (103, 225, 138, 71, 223, 140)))
45502502-45502502 i2c_packet: ('TRANSACTION END', None)
45504803-45505478 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
53500566-53502096 i2c_packet: ('PACKET READ', (69, (103, 225, 138, 71, 154, 68)))
53502096-53502096 i2c_packet: ('TRANSACTION END', None)
53504410-53505085 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
61500161-61501692 i2c_packet: ('PACKET READ', (69, (103, 246, 94, 71, 169, 210)))
61501692-61501692 i2c_packet: ('TRANSACTION END', None)
61504004-61504679 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
69499756-69501287 i2c_packet: ('PACKET READ', (69, (103, 241, 201, 70, 243, 131)))
69501287-69501287 i2c_packet: ('TRANSACTION END', None)
69503600-69504274 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
77499350-77500881 i2c_packet: ('PACKET READ', (69, (104, 33, 84, 70, 251, 58)))
77500881-77500881 i2c_packet: ('TRANSACTION END', None)
77503194-77503869 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
85498946-85500477 i2c_packet: ('PACKET READ', (69, (104, 28, 221, 70, 137, 160)))
85500477-85500477 i2c_packet: ('TRANSACTION END', None)
85502789-85503464 i2c_packet: ('PACKET WRITE', (69, (36, 22)))
93498541-93500071 i2c_packet: ('PACKET READ', (69, (104, 55, 177, 70, 197, 224)))
93500071-93500071 i2c_packet: ('TRANSACTION END', None)
62 changes: 62 additions & 0 deletions decoder/test/i2c_packet/test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
test rtc
protocol-decoder i2c channel scl=0 channel sda=1 initial_pin scl=1 initial_pin sda=1
protocol-decoder i2c_packet
input i2c/rtc_dallas_ds1307/rtc_ds1307_200khz.sr
output i2c_packet annotation match rtc_ds1307_200khz.output
output i2c_packet python match rtc_ds1307_200khz.python

test rtc_no_samplerate
protocol-decoder i2c channel scl=0 channel sda=1 initial_pin scl=1 initial_pin sda=1
protocol-decoder i2c_packet
input i2c/rtc_dallas_ds1307/rtc_ds1307_200khz_no_samplerate.sr
output i2c_packet annotation match rtc_ds1307_200khz.output
output i2c_packet python match rtc_ds1307_200khz.python

test motherboard
protocol-decoder i2c channel scl=0 channel sda=3
protocol-decoder i2c_packet
input i2c/gigabyte_6vle-vxl_i2c/gigabyte_6vle_vxl_i2c.sr
output i2c_packet annotation match gigabyte_6vle_vxl_i2c.output
output i2c_packet python match gigabyte_6vle_vxl_i2c.python

test xfp
protocol-decoder i2c channel scl=0 channel sda=1
protocol-decoder i2c_packet
input i2c/network-transceivers/xfp.sr
output i2c_packet annotation match xfp.output
output i2c_packet python match xfp.python

test wii_nunchuk_init
protocol-decoder i2c channel scl=0 channel sda=1
protocol-decoder i2c_packet
input i2c/wii_nunchuk/wii_nunchuk_init.sr
output i2c_packet annotation match wii_nunchuk_init.output
output i2c_packet python match wii_nunchuk_init.python

test sensirion_sht21_humidity35
protocol-decoder i2c channel scl=2 channel sda=1
protocol-decoder i2c_packet option format=dec
input i2c/sensirion_sht2x/sensirion_sht21_humidity35.sr
output i2c_packet annotation match sensirion_sht21_humidity35.output
output i2c_packet python match sensirion_sht21_humidity35.python

test sensirion_sht31_25rh_28rh
protocol-decoder i2c channel scl=2 channel sda=1
protocol-decoder i2c_packet
input i2c/sensirion_sht3x/sensirion_sht31_25rh_28rh.sr
output i2c_packet annotation match sensirion_sht31_25rh_28rh.output
output i2c_packet python match sensirion_sht31_25rh_28rh.python

test bh1750_hresolutionmode
protocol-decoder i2c channel scl=0 channel sda=1
protocol-decoder i2c_packet
input i2c/rohm_bh1750/bh1750_hresolutionmode.sr
output i2c_packet annotation match bh1750_hresolutionmode.output
output i2c_packet python match bh1750_hresolutionmode.python

test bh1750_h2resolutionmode
protocol-decoder i2c channel scl=0 channel sda=1
protocol-decoder i2c_packet
input i2c/rohm_bh1750/bh1750_h2resolutionmode.sr
output i2c_packet annotation match bh1750_h2resolutionmode.output
output i2c_packet python match bh1750_h2resolutionmode.python
1 change: 1 addition & 0 deletions decoder/test/i2c_packet/wii_nunchuk_init.output
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
645807-646743 i2c_packet: data: "0x52 WR: 40 00" "52 WR: 40 00"
2 changes: 2 additions & 0 deletions decoder/test/i2c_packet/wii_nunchuk_init.python
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
645807-646743 i2c_packet: ('PACKET WRITE', (82, (64, 0)))
646743-646743 i2c_packet: ('TRANSACTION END', None)
Loading

0 comments on commit 3eb0a44

Please sign in to comment.