Date:2011-06-06 05:49:53 (9 years 2 months ago)
Author:Werner Almesberger
Commit:38a08c09ca6005f1abcb430780a46ccec37a5362
Message:prod/atusb: added GPIO test

Files: prod/atusb (1 diff)

Change Details

prod/atusb
2424
2525gpio_usb()
2626{
27    step "GPIO scan"
28    todo
27    # P_ON state (after reset; transceiver pull-up/downs active)
28
29#
30# BBBBBBBB CCCCCCCC DDDDDDDD
31# 01234567 01234567 01234567
32#
33# -xxxS-L- -x-----n InMM-S--
34# T E R RSIO C
35#
36# Pull in P_ON v ^ -^-v v
37#
38
39    step "GPIO scan (P_ON)"
40    cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT -p \
41        HHHHoHxH.HxHxHxHh.ohzoHoHH '# reset state (H)' \
42        HHHH0HxH.HxHxHxHh.ohzoHoHH '# test SLP_TR (0)' \
43        HHHHoH0H.HxHxHxHh.ohzoHoHH '# test LED (0)' \
44        HHHHoHxH.HxHxHxHh.LhzoHoHH '# test IRQ_RF (0)' \
45        HHHHoHxH.HxHxHxHh.o0zoHoHH '# test nSEL (0)' \
46        HHHHoHxH.HxHxHxHh.ohz0HoHH '# test MOSI (0)' \
47        HHHHoHxH.HxHxHxHh.ohzoH0HH '# test SCLK (0)' \
48        0000o0x0.0x0x0x0h.ohzo0o00 '# reset state (0)' \
49        000010x0.0x0x0x0h.ohzo0o00 '# test SLP_TR (1)' \
50        0000o010.0x0x0x0h.ohzo0o00 '# test LED (1)' \
51        0000o0x0.0x0x0x0h.o1zo0o00 '# test nSEL (1)' \
52        0000o0x0.0x0x0x0h.ohz10o00 '# test MOSI (1)' \
53        0000o0x0.0x0x0x0h.ohzo0100 '# test SCLK (1)'"
54    doit
55
56    # TRX_OFF state (transceiver pull-up/downs inactive)
57
58    # -xxxS-L- -x-----n InMM-S--
59    # T E R RSIO C
60
61    step "GPIO scan (TRX_OFF)"
62    cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
63        HHHH0HzH.HxHxHxHh.oHzHHHHH '# TRX_OFF state (H)' \
64        HHHH0H0H.HxHxHxHh.oHzHHHHH '# test LED' \
65        HHHH0HzH.HxHxHxHh.o0zHHHHH '# test nSEL' \
66        HHHH0HzH.HxHxHxHh.oHz0HHHH '# test MOSI' \
67        HHHH0HzH.HxHxHxHh.oHzHH0HH '# test SCLK'"
68    doit
69
70    # INT
71
72    # -xxxS-L- -x-----n InMM-S--
73    # T E R RSIO C
74
75    step "GPIO scan (INT)"
76    cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT -p \
77        xxxxxxxx.xxxxxxxx.oxxxxxxx '# reset state' \
78        0x04=1 '# IRQ_POLARITY = 1' \
79        xxxxxxxx.xxxxxxxx.hxxxxxxx '# test INT (1)' \
80        xxxxxxxx.xxxxxxxx.h0xxxxxx '# test INT (2)' \
81        xxxxxxxx.xxxxxxxx.h1xxxxxx '# restore nSEL' \
82        0x04=0 '# IRQ_POLARITY = 0' \
83        xxxxxxxx.xxxxxxxx.o1xxxxxx '# test INT again'"
84    doit
85
86    # SLP_TR
87
88    # -xxxS-L- -x-----n InMM-S--
89    # T E R RSIO C
90
91    step "GPIO scan (SLP_TR)"
92    cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
93        02=9 delay '# enter PLL_ON' \
94        02:9/0x1f '# verify state' \
95        frame '# one-byte frame' \
96        0xf: '# clear interrupts' \
97        0xe=8 '# enable TRX_END intr' \
98        xxxxxxxx.xxxxxxxx.oxxxxxxx '# confirm INT' \
99        slp_tr delay '# send frame' \
100        xxxxxxxx.xxxxxxxx.hxxxxxxx '# check INT'"
101    doit
102
103    # nRST
104
105    step "GPIO scan (nRST)"
106    cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
107        02:8/0x1f '# verify TRX_OFF' \
108        reset '# reset transceiver' \
109        02:0/0x1f '# verify P_ON'"
110    doit
29111}
30112
31113

Archive Download the corresponding diff file



interactive