[processor-sdk/performance-audio-sr.git] / procsdk_audio_x_xx_xx_xx / tools / pyalpha / run_pyAlpha_tests.py
1 import time
2 from pyalpha import PyAlpha
4 port = 'COM1'
5 hfile = 'pa_i13_evmda830_io_a'
7 tests = [
8 #['readPCEMode'],
9 [0xC625, 0x6020],
10 [0xC024, 0x0A49],
11 [0xC805, 0x0D00],
12 [0xC100],
13 [0xDEAD],
14 [0xC224, 0x0400],
15 [0xCA24, 0x2E01],
16 [0xC324, 0x0030],
17 [0xCB20, 0x0024, 0x0000],
18 [0xC424, 0x0040],
19 [0xCC24, 0x0038, 0x0108, 0x0000],
20 [0xCE34, 0x1808, 0x0000, 0x0000, 0x0000, 0x0000],
21 [0xC509, 0x0400],
22 [0xCD09, 0x0400],
23 ]
25 p = PyAlpha(port, hfile, inc='./alpha', bins='./bin')
27 def test(t, fast=False):
28 #print "SEND:", map(hex,t)
29 print t
30 t = map(str, t)
31 ret = p.send(alpha_list=t, fast=fast)
33 if ret:
34 print "RECV:",ret
35 else:
36 print "~FAIL~"
38 ############################
39 # EDIT THESE
40 ############################
41 fast = False
42 delay = 0
43 ############################
45 print "TEST ALL ONCE"
46 for t in tests:
47 test(t, fast=fast)
48 time.sleep(delay)
50 print "TEST ALL 100 TIMES"
51 for t in tests:
52 for i in range(100):
53 test(t, fast=fast)
54 time.sleep(delay)