2011-04-20 14:13:27 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. ./Common
|
|
|
|
|
|
|
|
|
2011-05-28 13:03:20 +03:00
|
|
|
USB_ID=20b7:1540
|
2011-05-31 02:04:54 +03:00
|
|
|
CLOCK_DRIFT_PPM=50
|
2011-05-28 13:03:20 +03:00
|
|
|
|
|
|
|
|
2011-04-20 14:13:27 +03:00
|
|
|
enumerate()
|
|
|
|
{
|
|
|
|
step "Enumeration"
|
2011-05-28 13:03:20 +03:00
|
|
|
cmd "usbwait -t 5 $USB_ID && echo okay"
|
2011-05-18 03:58:09 +03:00
|
|
|
expect okay
|
2011-04-20 14:13:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
led()
|
|
|
|
{
|
2011-06-07 01:58:13 +03:00
|
|
|
#
|
|
|
|
# BBBBBBBB CCCCCCCC DDDDDDDD
|
|
|
|
# 01234567 01234567 01234567
|
|
|
|
#
|
|
|
|
# -xxxS-L- -x-----n InMM-S--
|
|
|
|
# T E R RSIO C
|
|
|
|
#
|
2011-04-20 14:13:27 +03:00
|
|
|
step "LED"
|
2011-06-07 01:58:13 +03:00
|
|
|
cmd "echo >/dev/tty; \
|
2011-06-21 04:36:24 +03:00
|
|
|
g_echo 'Press \033[7m P \033[mass if the LED blinks, \033[7m F \033[mail if not' \
|
2011-06-07 01:58:13 +03:00
|
|
|
>/dev/tty; \
|
|
|
|
atrf-gpio -c -p \
|
|
|
|
xxxxxx1x.xxxxxxxx.xxxxxxxx \
|
|
|
|
delay=50 \
|
|
|
|
xxxxxx0x.xxxxxxxx.xxxxxxxx \
|
|
|
|
delay=200"
|
|
|
|
doit
|
2011-04-20 14:13:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gpio_usb()
|
|
|
|
{
|
2011-06-06 06:49:53 +03:00
|
|
|
# TRX_OFF state (transceiver pull-up/downs inactive)
|
|
|
|
|
|
|
|
# -xxxS-L- -x-----n InMM-S--
|
|
|
|
# T E R RSIO C
|
|
|
|
|
|
|
|
step "GPIO scan (TRX_OFF)"
|
|
|
|
cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
|
2011-06-12 03:04:25 +03:00
|
|
|
HHHH0HzH.HxHxHHHh.oHHHHHHH '# TRX_OFF state (H)' \
|
|
|
|
0HHH0HzH.HxHxHHHh.oHHHHHHH '# test B0' \
|
|
|
|
H0HH0HzH.HxHxHHHh.oHHHHHHH '# test B1 (ICSP SCK)' \
|
|
|
|
HH0H0HzH.HxHxHHHh.oHHHHHHH '# test B2 (ICSP MOSI)' \
|
|
|
|
HHH00HzH.HxHxHHHh.oHHHHHHH '# test B3 (ICSP MISO)' \
|
|
|
|
HHHH00zH.HxHxHHHh.oHHHHHHH '# test B5' \
|
|
|
|
HHHH0H0H.HxHxHHHh.oHHHHHHH '# test B6 (LED, 0)' \
|
|
|
|
HHHH0H1H.HxHxHHHh.oHHHHHHH '# test B6 (LED, 1)' \
|
|
|
|
HHHH0Hz0.HxHxHHHh.oHHHHHHH '# test B7' \
|
|
|
|
HHHH0HzH.0xHxHHHh.oHHHHHHH '# test C0' \
|
|
|
|
HHHH0HzH.Hx0xHHHh.oHHHHHHH '# test C2' \
|
|
|
|
HHHH0HzH.HxHx0HHh.oHHHHHHH '# test C4' \
|
|
|
|
HHHH0HzH.HxHxH0Hh.oHHHHHHH '# test C5' \
|
|
|
|
HHHH0HzH.HxHxHH0h.oHHHHHHH '# test C6' \
|
|
|
|
HHHH0HzH.HxHxHHH1.oHHHHHHH '# test C7 (nRST_RF)' \
|
|
|
|
HHHH0HzH.HxHxHHHh.0HHHHHHH '# test D0 (IRQ_RF)' \
|
|
|
|
HHHH0HzH.HxHxHHHh.o0zHHHHH '# test D1 (nSS)' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oH0HHHHH '# test D2 (MISO)' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oHz0HHHH '# test D3 (MOSI)' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oHzH0HHH '# test D4' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oHzHH0HH '# test D5 (SCLK)' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oHzHHH0H '# test D6' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oHzHHHH0 '# test D7' \
|
|
|
|
HHHH0HzH.HxHxHHHh.oHzHHHHH '# test LED'"
|
2011-06-06 06:49:53 +03:00
|
|
|
doit
|
|
|
|
|
|
|
|
# INT
|
|
|
|
|
|
|
|
# -xxxS-L- -x-----n InMM-S--
|
|
|
|
# T E R RSIO C
|
|
|
|
|
|
|
|
step "GPIO scan (INT)"
|
2011-06-12 13:46:26 +03:00
|
|
|
cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
|
2011-06-06 06:49:53 +03:00
|
|
|
xxxxxxxx.xxxxxxxx.oxxxxxxx '# reset state' \
|
|
|
|
0x04=1 '# IRQ_POLARITY = 1' \
|
|
|
|
xxxxxxxx.xxxxxxxx.hxxxxxxx '# test INT (1)' \
|
|
|
|
xxxxxxxx.xxxxxxxx.h0xxxxxx '# test INT (2)' \
|
|
|
|
xxxxxxxx.xxxxxxxx.h1xxxxxx '# restore nSEL' \
|
|
|
|
0x04=0 '# IRQ_POLARITY = 0' \
|
|
|
|
xxxxxxxx.xxxxxxxx.o1xxxxxx '# test INT again'"
|
|
|
|
doit
|
|
|
|
|
|
|
|
# SLP_TR
|
|
|
|
|
|
|
|
# -xxxS-L- -x-----n InMM-S--
|
|
|
|
# T E R RSIO C
|
|
|
|
|
|
|
|
step "GPIO scan (SLP_TR)"
|
|
|
|
cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
|
|
|
|
02=9 delay '# enter PLL_ON' \
|
|
|
|
02:9/0x1f '# verify state' \
|
|
|
|
frame '# one-byte frame' \
|
|
|
|
0xf: '# clear interrupts' \
|
|
|
|
0xe=8 '# enable TRX_END intr' \
|
|
|
|
xxxxxxxx.xxxxxxxx.oxxxxxxx '# confirm INT' \
|
|
|
|
slp_tr delay '# send frame' \
|
|
|
|
xxxxxxxx.xxxxxxxx.hxxxxxxx '# check INT'"
|
|
|
|
doit
|
|
|
|
|
|
|
|
# nRST
|
|
|
|
|
|
|
|
step "GPIO scan (nRST)"
|
|
|
|
cmd "$LOCAL_EXEC atrf-gpio -d $LOCAL_DUT \
|
|
|
|
02:8/0x1f '# verify TRX_OFF' \
|
|
|
|
reset '# reset transceiver' \
|
|
|
|
02:0/0x1f '# verify P_ON'"
|
|
|
|
doit
|
2011-04-20 14:13:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
xtal_usb()
|
|
|
|
{
|
|
|
|
step "Crystal frequency"
|
2011-05-31 02:04:54 +03:00
|
|
|
cmd "$LOCAL_EXEC atrf-xtal -d $LOCAL_DUT -p $CLOCK_DRIFT_PPM"
|
|
|
|
expect_re ppm # we catch any problems via the exit code
|
2011-04-20 14:13:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
begin usb.profile
|
|
|
|
enumerate
|
|
|
|
led
|
|
|
|
# power ?
|
|
|
|
gpio_usb
|
2011-05-18 03:58:09 +03:00
|
|
|
identify
|
2011-04-20 14:13:27 +03:00
|
|
|
xtal_usb
|
|
|
|
spectrum
|
|
|
|
transmit
|