FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/ccd/ccddata_ccdmtab.c @ 648:970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 04 Sep 2014 05:48:57 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
647:a60b375014e3 | 648:970d6199f2c5 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : | |
4 | Modul : ccddata_ccdmtab.c | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : Ccddata abstraction for use in lib/dll. The six tables | |
18 | mvar, spare, calc, mcomp, melem, and mmtx, genererated by ccdgen | |
19 | (in ccdmtab.cdg) are supplied as well as the table calcidx | |
20 | (generated in an extra file). In addition, corresponding | |
21 | functions deliver specified elements of the tables. For | |
22 | mmtx the function must be used, because this three-dimesional | |
23 | array cannot be declared as extern without knowing the constants | |
24 | at compile time. | |
25 +----------------------------------------------------------------------------- | |
26 */ | |
27 | |
28 #include "typedefs.h" | |
29 #include "mconst.cdg" | |
30 #include "ccdtable.h" | |
31 | |
32 static const T_CCD_VarTabEntry ccddata_mvar [] = | |
33 { | |
34 #include "mvar.cdg" | |
35 }; | |
36 | |
37 static const T_CCD_SpareTabEntry ccddata_spare [] = | |
38 { | |
39 #include "spare.cdg" | |
40 }; | |
41 | |
42 static const T_CCD_CalcTabEntry ccddata_calc [] = | |
43 { | |
44 #include "calc.cdg" | |
45 }; | |
46 | |
47 static const T_CCD_CompTabEntry ccddata_mcomp [] = | |
48 { | |
49 #include "mcomp.cdg" | |
50 }; | |
51 | |
52 static const T_CCD_ElemTabEntry ccddata_melem [] = | |
53 { | |
54 #include "melem.cdg" | |
55 }; | |
56 | |
57 static const USHORT ccddata_mmtx [MAX_MMTX_SIZE] = | |
58 { | |
59 #include "mmtxval.cdg" | |
60 }; | |
61 | |
62 static const T_CCD_CalcIndex ccddata_calcidx [] = | |
63 { | |
64 #include "calcidx.cdg" | |
65 }; | |
66 | |
67 const T_CCD_MTXIDX ccddata_mmtx_idx [] = | |
68 { | |
69 #include "mmtxidx.cdg" | |
70 }; | |
71 | |
72 const T_CCD_CalcIndex* ccddata_get_calcidx (USHORT idx) | |
73 { | |
74 return &ccddata_calcidx[idx]; | |
75 } | |
76 | |
77 const T_CCD_VarTabEntry* ccddata_get_mvar (USHORT idx) | |
78 { | |
79 return &ccddata_mvar[idx]; | |
80 } | |
81 | |
82 const T_CCD_SpareTabEntry* ccddata_get_spare (USHORT idx) | |
83 { | |
84 return &ccddata_spare[idx]; | |
85 } | |
86 | |
87 const T_CCD_CalcTabEntry* ccddata_get_calc (USHORT idx) | |
88 { | |
89 return &ccddata_calc[idx]; | |
90 } | |
91 | |
92 const T_CCD_CompTabEntry* ccddata_get_mcomp (USHORT idx) | |
93 { | |
94 return &ccddata_mcomp[idx]; | |
95 } | |
96 | |
97 const T_CCD_ElemTabEntry* ccddata_get_melem (USHORT idx) | |
98 { | |
99 return &ccddata_melem[idx]; | |
100 } | |
101 | |
102 USHORT ccddata_get_mmtx (USHORT entity, USHORT msgid, USHORT index) | |
103 { | |
104 if ((entity >= NUM_OF_ENTITIES) || (msgid >= ccddata_mmtx_idx[entity].numitems)) | |
105 return NO_REF; | |
106 return ccddata_mmtx[2*(ccddata_mmtx_idx[entity].idx + msgid) + index]; | |
107 } |