Dana
2025-11-30 556261d15c1c3ac91604824c4df140a633bacff7
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#include "ROMData.h"
 
unsigned short RomStringAddr[ROMSTRADDRCNT] = { 0x9FF8, 0xD2B2, 0xDFF8, 0xBFF8, 0xC7F8, 0xAFF8 };    // shawn 2009/05/04 add 232R0 v1
 
unsigned int uiRomID = 0;
 
ROM_INFO RomInfo[ROMCOUNT] =
{
    { 0x9FF8, { 0x32, 0x32, 0x30, 0x52, 0x30, 0x01, 0x00, 0x00 }, 0x03C5,    // 220R0 (21x, 21xA, 21xB)
    0x0000, 0x0000, 40 * 1024, true, false, false, false, false, false },
    { 0x9FF8, { 0x32, 0x32, 0x35, 0x52, 0x30, 0x03, 0x00, 0x00 }, 0x031D,    // 225R0
    0x0000, 0x01E8, 40 * 1024, true, false, false, false, false, false },
    { 0x9FF8, { 0x32, 0x35, 0x30, 0x52, 0x30, 0x01, 0x00, 0x00 }, 0x0530,    // 250R0 v1
    0x0000, 0x01E8, 40 * 1024, false, false, false, false, false, false },
    { 0x9FF8, { 0x32, 0x35, 0x30, 0x52, 0x30, 0x02, 0x00, 0x00 }, 0x05F0,    // 250R0 v2 and new version
    0x0000, 0x01E8, 40 * 1024, true, false, false, false, false, false },
    { 0xD2B2, { 0x32, 0x33, 0x30, 0x52, 0x30, 0x01, 0x00, 0x00 }, 0x0530,    // 230R0 v1
    0x0000, 0x01E8, 56 * 1024, false, false, false, false, false, false },
    { 0xDFF8, { 0x32, 0x33, 0x30, 0x52, 0x30, 0x02, 0x00, 0x00 }, 0x05E0,    // 230R0 v2
    0x0000, 0x01E8, 56 * 1024, false, true, false, false, false, false },
    { 0xDFF8, { 0x32, 0x33, 0x30, 0x52, 0x30, 0x03, 0x00, 0x03 }, 0x05F0,    // 230R0 v3 and new version
    0x0000, 0x01E8, 56 * 1024, true, true, false, false, false, false },
    { 0xDFF8, { 0x32, 0x33, 0x31, 0x52, 0x30, 0x01, 0x00, 0x01 }, 0x05F0,    // 231R0 v1
    0x0000, 0x01E8, 56 * 1024, false, true, false, false, false, false },
    { 0xDFF8, { 0x32, 0x31, 0x36, 0x52, 0x30, 0x01, 0x00, 0x01 }, 0x05F0,    // shawn 2009/10/15 add 216R0
    0x0000, 0x0148, 56 * 1024, true, true, true, true, false, false },
    { 0xBFF8, { 0x32, 0x31, 0x35, 0x52, 0x30, 0x01, 0x00, 0x00 }, 0x05F0,    // 215R0
    0x0000, 0x01E8, 48 * 1024, true, false, false, false, false, false },
    { 0xBFF8, { 0x32, 0x33, 0x36, 0x52, 0x30, 0x01, 0x00, 0x00 }, 0x0690,    // 236R0 v1
    0x0000, 0x01E8, 48 * 1024, false, false, false, false, false, false },
    { 0xBFF8, { 0x32, 0x33, 0x36, 0x52, 0x30, 0x02, 0x00, 0x02 }, 0x05F0,    // 236R0 v2 and new version
    0x0000, 0x01E8, 48 * 1024, true, true, false, false, false, false },
    { 0xBFF8, { 0x32, 0x35, 0x36, 0x52, 0x30, 0x01, 0x00, 0x01 }, 0x05F0,    // 256R0 
    0x0000, 0x01E8, 48 * 1024, true, true, true, false, false, false },
    { 0xBFF8, { 0x32, 0x33, 0x31, 0x52, 0x30, 0x02, 0x10, 0x01 }, 0x05F0,    // 231R0 v2 and new version 
    0x6000, 0x61E8, 48 * 1024, true, true, true, false, false, false },
    { 0xBFF8, { 0x32, 0x36, 0x36, 0x52, 0x30, 0x01, 0x00, 0x01 }, 0x05F0,    // shawn 2009/05/18 add 266R0
    0x0000, 0x01E8, 48 * 1024, true, true, true, false, false, false },
    { 0xBFF8, { 0x32, 0x37, 0x36, 0x52, 0x30, 0x01, 0x40, 0x06 }, 0x05F0,    // shawn 2009/02/18 add 276R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, false, false },
    { 0xBFF8, { 0x32, 0x37, 0x35, 0x52, 0x30, 0x01, 0x30, 0x05 }, 0x05F0,    // shawn 2009/07/09 add 275R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, false, false },
    { 0xBFF8, { 0x32, 0x39, 0x30, 0x52, 0x30, 0x01, 0x60, 0x07 }, 0x05F0,     // shawn 2010/08/11 add 290R0 v1
    0x0000, 0x0148, 48 * 1024, false, true, true, true, false, false },
    { 0xBFF8, { 0x32, 0x39, 0x30, 0x52, 0x30, 0x02, 0x61, 0x20 }, 0x05F0,    // shawn 2011/01/31 add 290R0 v2
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, false },
    { 0xBFF8, { 0x32, 0x38, 0x36, 0x52, 0x30, 0x01, 0x41, 0x19 }, 0x05F0,     // shawn 2010/12/30 add 286R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xBFF8, { 0x32, 0x38, 0x38, 0x52, 0x30, 0x01, 0x42, 0x21 }, 0x05F0,     // shawn 2011/06/10 add 288R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xBFF8, { 0x32, 0x38, 0x38, 0x52, 0x30, 0x01, 0x42, 0x21 }, 0x05F0,     // shawn 2011/08/23 add 289R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xBFF8, { 0x32, 0x37, 0x30, 0x52, 0x30, 0x01, 0x43, 0x22 }, 0x05F0,     // shawn 2012/02/08 add 270R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xBFF8, { 0x32, 0x37, 0x31, 0x52, 0x30, 0x01, 0x43, 0x22 }, 0x05F0,     // shawn 2012/02/08 add 271R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xBFF8, { 0x32, 0x38, 0x30, 0x52, 0x30, 0x01, 0x45, 0x23 }, 0x05F0,    // Daniel 2012/09/13 add 280R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xBFF8, { 0x32, 0x38, 0x31, 0x52, 0x30, 0x01, 0x45, 0x23 }, 0x05F0,     // Daniel 2012/09/13 add 281R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xC7F8, { 0x32, 0x33, 0x32, 0x52, 0x30, 0x01, 0x20, 0x05 }, 0x05F0,     // shawn 2009/04/03 add 232R0 v1
    0x0000, 0x0148, 56 * 1024, false, true, true, true, false, false },
    { 0xC7F8, { 0x32, 0x33, 0x32, 0x52, 0x30, 0x02, 0x50, 0x07 }, 0x05F0,     // shawn 2010/05/11 add 232R0 v2 (L232)
    0x0000, 0x0148, 56 * 1024, true, true, true, true, true, true },
    { 0xAFF8, { 0x32, 0x37, 0x32, 0x52, 0x30, 0x01, 0x46, 0x25 }, 0x05F0,     // Jyh 2015/02/05 add 272R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xAFF8, { 0x32, 0x37, 0x33, 0x52, 0x30, 0x01, 0x46, 0x25 }, 0x05F0,     // Tzsiang 2015/06/04 add 273R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xAFF8, { 0x32, 0x37, 0x35, 0x52, 0x30, 0x01, 0x46, 0x25 }, 0x05F0,     // Tzsiang 2015/06/04 add 275R0
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xAFF8, { 0x32, 0x38, 0x33, 0x52, 0x30, 0x01, 0x46, 0x24 }, 0x05F0,     // wei add 283R0
    0x0000, 0x0148, 48 * 1024, false, true, true, false, true, false },
    { 0x9FF8, { 0x32, 0x39, 0x32, 0x52, 0x30, 0x01, 0x61, 0x08 }, 0x05F0,    // 292R0 wei add 292
    0x0000, 0x0148, 48 * 1024, false, true, true, false, true, false },
    { 0xAFF8, { 0x32, 0x38, 0x37, 0x52, 0x30, 0x01, 0x46, 0x31 }, 0x05F0,    // 287R0 wei add 287
    0x0000, 0x0148, 48 * 1024, false, true, true, false, true, false },
    { 0xAFF8, { 0x32, 0x36, 0x37, 0x52, 0x30, 0x01, 0x46, 0x32 }, 0x05F0,   //yiling add 267
    0x0000, 0x0148, 48 * 1024, true, true, true, true, true, true },
    { 0xAFF8, { 0x32, 0x37, 0x36, 0x52, 0x30, 0x01, 0x46, 0x35 }, 0x05F0,   //liwei add 276R0 v2
    0x0000, 0x0148, 48 * 1024, true, true, true, true, false, false },
    { 0xAFF8, { 0x32, 0x38, 0x35, 0x52, 0x30, 0x01, 0x46, 0x36 }, 0x05F0,   //liwei add 285R0 
    0x0000, 0x0148, 48 * 1024, true, true, true, false, true, false },
    { 0xAFF8, { 0x32, 0x38, 0x36, 0x52, 0x30, 0x01, 0x46, 0x36 }, 0x05F0,   //liwei add 286R0 
    0x0000, 0x0148, 48 * 1024, true, true, true, false, true, false }
};
 
 
DSP_ARCH_INFO g_DspArchInfo[DSP_ARCH_COUNT] = 
{
    { 0x101f, 0x1084, 0x1073, 0x1005, 0x1006, 0x1007, 0x1080, 0x1091, 0x1082, 0x1083, 0x1081 },
    { 0x80f0, 0x8e04, 0x8c00, 0x8200, 0x8201, 0x8202, 0x8e00, 0x8e11, 0x8e02, 0x8e03, 0x8e01 },
};
 
USHORT dspIdAddr = 0x101f;
USHORT sfRdyAddr = 0x1084;
USHORT usbResetAddr = 0x1073;
USHORT gpioInputAddr = 0x1005;
USHORT gpioOutputAddr = 0x1006;
USHORT gpioOEAddr = 0x1007;
USHORT sfModeAddr = 0x1080;
USHORT sfCSAddr = 0x1091;
USHORT sfWriteDataAddr = 0x1082;
USHORT sfReadDataAddr = 0x1083;
USHORT sfReadWriteTriggerAddr = 0x1081;
 
USHORT i2cDev = 0x10d0;
USHORT i2cMode = 0x10d9;
USHORT i2cTrg = 0x10d7;
USHORT i2cSclSelOD = 0x10d8;
USHORT i2cSlaveID = 0x10d1;
USHORT i2cDataArrStartAddr = 0x10d2;
 
BOOL LibUsb_SetAsicArchInfo(DSP_ARCH_TYPE dspArchType)
{
    if (dspArchType <= DAT_UNKNOW || dspArchType >= DSP_ARCH_COUNT)
        return FALSE;
 
    dspIdAddr = g_AsicArchInfo[dspArchType].asicIdAddr;
    sfRdyAddr = g_AsicArchInfo[dspArchType].sfRdyAddr;
    usbResetAddr = g_AsicArchInfo[dspArchType].usbResetAddr;
    gpioInputAddr = g_AsicArchInfo[dspArchType].gpioInputAddr;
    gpioOutputAddr = g_AsicArchInfo[dspArchType].gpioOutputAddr;
    gpioOEAddr = g_AsicArchInfo[dspArchType].gpioOEAddr;
    sfModeAddr = g_AsicArchInfo[dspArchType].sfModeAddr;
    sfCSAddr = g_AsicArchInfo[dspArchType].sfCSAddr;
    sfWriteDataAddr = g_AsicArchInfo[dspArchType].sfWriteDataAddr;
    sfReadDataAddr = g_AsicArchInfo[dspArchType].sfReadDataAddr;
    sfReadWriteTriggerAddr = g_AsicArchInfo[dspArchType].sfReadWriteTriggerAddr;
 
    i2cDev = g_AsicArchInfo[dspArchType].i2cDev;
    i2cMode = g_AsicArchInfo[dspArchType].i2cMode;
    i2cTrg = g_AsicArchInfo[dspArchType].i2cTrg;
    i2cSclSelOD = g_AsicArchInfo[dspArchType].i2cSclSelOD;
    i2cSlaveID = g_AsicArchInfo[dspArchType].i2cSlaveID;
    i2cDataArrStartAddr = g_AsicArchInfo[dspArchType].i2cDataArrStartAddr;
}
 
USHORT g_CurDspExtendUnitID = 0x300;
 
DSP_ARCH_INFO g_AsicArchInfo[DSP_ARCH_COUNT] = 
{
    { 0x101f, 0x1084, 0x1073, 0x1005, 0x1006, 0x1007, 0x1080, 0x1091, 0x1082, 0x1083, 0x1081, 
        0x10d0, 0x10d9, 0x10d7, 0x10d8, 0x10d1, 0x10d2},
    { 0x80f0, 0x8e04, 0x8c00, 0x8200, 0x8201, 0x8202, 0x8e00, 0x8e11, 0x8e02, 0x8e03, 0x8e01, 
        0x8600, 0x8609, 0x8607, 0x8608, 0x8601, 0x8602},
};