FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/L1/include/l1_const.h @ 533:bc3656cfe0d8
gsm-fw/L1/include: l1_const.h reconciled
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Fri, 01 Aug 2014 22:53:45 +0000 |
parents | de635895e0be |
children | 10b4bed10192 |
comparison
equal
deleted
inserted
replaced
532:d9fd344d7570 | 533:bc3656cfe0d8 |
---|---|
18 #define FAR far | 18 #define FAR far |
19 #endif | 19 #endif |
20 #else // Running ARM compiler. | 20 #else // Running ARM compiler. |
21 #define FAR | 21 #define FAR |
22 #define EXIT exit(0) | 22 #define EXIT exit(0) |
23 #undef stricmp // appease gcc | |
23 #define stricmp strcmp | 24 #define stricmp strcmp |
24 #endif | 25 #endif |
25 | 26 |
26 | 27 |
27 #if (CODE_VERSION != SIMULATION) | 28 #if (CODE_VERSION != SIMULATION) |
29 #undef NULL // appease gcc | |
28 #define NULL 0 | 30 #define NULL 0 |
29 #endif | 31 #endif |
30 | 32 |
31 #define NO_PAR 0 | 33 #define NO_PAR 0 |
32 | 34 |
71 // GAUGING SAMPLES | 73 // GAUGING SAMPLES |
72 #define SIZE_HIST 10 | 74 #define SIZE_HIST 10 |
73 #define MAX_BAD_GAUGING 3 | 75 #define MAX_BAD_GAUGING 3 |
74 | 76 |
75 // GAUG_IN_32T = (HF in clock of 13Mhz*dpll) * ( LF in Khz) | 77 // GAUG_IN_32T = (HF in clock of 13Mhz*dpll) * ( LF in Khz) |
76 #define GAUG_IN_32T 605 // gauging duration is 1348*T32 measured on eva4 | 78 // Leonardo version had it set to 1348, but TCS3.2 (LoCosto) has it set |
79 // to 605 instead. I'll revert it to the Leonardo value for now. | |
80 // -- Space Falcon | |
81 #define GAUG_IN_32T 1348 // gauging duration is 1348*T32 measured on eva4 | |
77 | 82 |
78 // DSP state need to be used to enter Deep Sleep mode | 83 // DSP state need to be used to enter Deep Sleep mode |
79 #if (W_A_DSP_IDLE3 == 1) | 84 #if (W_A_DSP_IDLE3 == 1) |
80 #define C_DSP_IDLE3 3 | 85 #define C_DSP_IDLE3 3 |
81 #endif | 86 #endif |
168 #define NB_MEAS_MAX 4 | 173 #define NB_MEAS_MAX 4 |
169 #define NB_MEAS_MAX_GPRS 4 | 174 #define NB_MEAS_MAX_GPRS 4 |
170 | 175 |
171 #elif ((CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12) || (CHIPSET == 15)) | 176 #elif ((CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12) || (CHIPSET == 15)) |
172 | 177 |
173 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39) | 178 #if (DSP >= 33) |
174 | 179 |
175 // DSP code 33: upto 8 PMs with GSM and GPRS scheduler | 180 // DSP code 33: upto 8 PMs with GSM and GPRS scheduler |
176 | 181 |
177 #define NB_MEAS_MAX 8 | 182 #define NB_MEAS_MAX 8 |
178 #define NB_MEAS_MAX_GPRS 8 | 183 #define NB_MEAS_MAX_GPRS 8 |
435 #if (W_A_DSP_PR20037 == 1) | 440 #if (W_A_DSP_PR20037 == 1) |
436 //--------------------------------- | 441 //--------------------------------- |
437 // DSP vocoder Enable/ Disable | 442 // DSP vocoder Enable/ Disable |
438 //--------------------------------- | 443 //--------------------------------- |
439 #if (FF_L1_TCH_VOCODER_CONTROL == 1) | 444 #if (FF_L1_TCH_VOCODER_CONTROL == 1) |
440 #if (L1_VOCODER_IF_CHANGE == 0) | 445 #if (L1_VOCODER_IF_CHANGE == 0) |
441 #define TCH_VOCODER_DISABLE_REQ 0 | 446 #define TCH_VOCODER_DISABLE_REQ 0 |
442 #define TCH_VOCODER_ENABLE_REQ 1 | 447 #define TCH_VOCODER_ENABLE_REQ 1 |
443 #define TCH_VOCODER_ENABLED 2 | 448 #define TCH_VOCODER_ENABLED 2 |
444 #define TCH_VOCODER_DISABLED 3 | 449 #define TCH_VOCODER_DISABLED 3 |
445 #else | 450 #else |
446 #define TCH_VOCODER_RESET_COMMAND 0 | 451 #define TCH_VOCODER_RESET_COMMAND 0 |
447 #define TCH_VOCODER_ENABLE_COMMAND 1 | 452 #define TCH_VOCODER_ENABLE_COMMAND 1 |
448 #define TCH_VOCODER_DISABLE_COMMAND 2 | 453 #define TCH_VOCODER_DISABLE_COMMAND 2 |
449 #endif // L1_VOCODER_IF_CHANGE == 0 | 454 #endif // L1_VOCODER_IF_CHANGE == 0 |
450 | 455 |
451 #if (W_A_WAIT_DSP_RESTART_AFTER_VOCODER_ENABLE ==1) | 456 #if (W_A_WAIT_DSP_RESTART_AFTER_VOCODER_ENABLE ==1) |
452 // Number of TDMA wait frames until the DSP output is steady | 457 // Number of TDMA wait frames until the DSP output is steady |
453 #define DSP_VOCODER_ON_TRANSITION 165 | 458 #define DSP_VOCODER_ON_TRANSITION 165 |
454 #endif | 459 #endif |
455 #endif // FF_L1_TCH_VOCODER_CONTROL | 460 #endif // FF_L1_TCH_VOCODER_CONTROL |
456 #endif // W_A_DSP_PR20037 | 461 #endif // W_A_DSP_PR20037 |
457 | 462 |
458 | 463 |
459 //--------------------------------- | 464 //--------------------------------- |
494 #define AFC_INIT_CENTER 4 | 499 #define AFC_INIT_CENTER 4 |
495 #define AFC_INIT_MAX 5 | 500 #define AFC_INIT_MAX 5 |
496 #define AFC_INIT_MIN 6 | 501 #define AFC_INIT_MIN 6 |
497 #endif | 502 #endif |
498 | 503 |
504 #if 0 | |
499 // For Locosto | 505 // For Locosto |
500 #define L1_AFC_MANUAL_MODE 0 | 506 #define L1_AFC_MANUAL_MODE 0 |
501 #define L1_AFC_SCRIPT_MODE 1 | 507 #define L1_AFC_SCRIPT_MODE 1 |
502 #define L1_AFC_NONE 2 | 508 #define L1_AFC_NONE 2 |
503 | 509 |
505 #define L1_CTL_LOW_IF 1 | 511 #define L1_CTL_LOW_IF 1 |
506 | 512 |
507 #define L1_IL_INVALID 0 | 513 #define L1_IL_INVALID 0 |
508 #define L1_IL_VALID 1 | 514 #define L1_IL_VALID 1 |
509 | 515 |
510 | |
511 // End Locosto | 516 // End Locosto |
517 #endif | |
512 | 518 |
513 //--------------------------------- | 519 //--------------------------------- |
514 // TOA control defines. | 520 // TOA control defines. |
515 //--------------------------------- | 521 //--------------------------------- |
516 #define TOA_INIT 1 | 522 #define TOA_INIT 1 |
1261 // Identifier for measurement, FB / SB search tasks. | 1267 // Identifier for measurement, FB / SB search tasks. |
1262 // Values 1,2,3 reserved for "number of measurements". | 1268 // Values 1,2,3 reserved for "number of measurements". |
1263 #define TCH_LOOP_A 31 | 1269 #define TCH_LOOP_A 31 |
1264 #define TCH_LOOP_B 32 | 1270 #define TCH_LOOP_B 32 |
1265 | 1271 |
1266 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39) | 1272 #if (DSP >= 33) |
1267 #define SC_CHKSUM_VER (DB_W_PAGE_0 + (2 * (0x08DB - 0x800))) | 1273 #define SC_CHKSUM_VER (DB_W_PAGE_0 + (2 * (0x08DB - 0x800))) |
1268 #else | 1274 #else |
1269 #define SC_CHKSUM_VER (DB_W_PAGE_0 + (2 * (0x09A0 - 0x800))) | 1275 #define SC_CHKSUM_VER (DB_W_PAGE_0 + (2 * (0x09A0 - 0x800))) |
1270 #endif | 1276 #endif |
1271 | 1277 |
1321 #define D_SD_MIN_THR_TCHFS 15L //(24L *C_POND_RED) | 1327 #define D_SD_MIN_THR_TCHFS 15L //(24L *C_POND_RED) |
1322 #define D_MA_MIN_THR_TCHFS 738L //(1200L *C_POND_RED) | 1328 #define D_MA_MIN_THR_TCHFS 738L //(1200L *C_POND_RED) |
1323 #define D_MD_MAX_THR_TCHFS 1700L //(2000L *C_POND_RED) | 1329 #define D_MD_MAX_THR_TCHFS 1700L //(2000L *C_POND_RED) |
1324 #define D_MD1_MAX_THR_TCHFS 99L //(160L *C_POND_RED) | 1330 #define D_MD1_MAX_THR_TCHFS 99L //(160L *C_POND_RED) |
1325 | 1331 |
1326 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38)|| (DSP == 39) | 1332 #if (DSP >= 33) |
1327 // Frequency burst definitions | 1333 // Frequency burst definitions |
1328 #define D_FB_MARGIN_BEG 24 | 1334 #define D_FB_MARGIN_BEG 24 |
1329 #define D_FB_MARGIN_END 22 | 1335 #define D_FB_MARGIN_END 22 |
1330 | 1336 |
1331 // V42bis definitions | 1337 // V42bis definitions |
1333 #define D_V42B_SWITCH_MIN 64L | 1339 #define D_V42B_SWITCH_MIN 64L |
1334 #define D_V42B_SWITCH_MAX 250L | 1340 #define D_V42B_SWITCH_MAX 250L |
1335 #define D_V42B_RESET_DELAY 10L | 1341 #define D_V42B_RESET_DELAY 10L |
1336 | 1342 |
1337 // Latencies definitions | 1343 // Latencies definitions |
1338 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39) | 1344 #if (DSP >= 33) |
1339 // C.f. BUG1404 | 1345 // C.f. BUG1404 |
1340 #define D_LAT_MCU_BRIDGE 0x000FL | 1346 #define D_LAT_MCU_BRIDGE 0x000FL |
1341 #else | 1347 #else |
1342 #define D_LAT_MCU_BRIDGE 0x0009L | 1348 #define D_LAT_MCU_BRIDGE 0x0009L |
1343 #endif | 1349 #endif |
1428 #define D_DSP_TEST 0 | 1434 #define D_DSP_TEST 0 |
1429 #define D_VERSION_NUMBER 0 | 1435 #define D_VERSION_NUMBER 0 |
1430 #define D_TI_VERSION 0 | 1436 #define D_TI_VERSION 0 |
1431 | 1437 |
1432 | 1438 |
1433 /*------------------------------------------------------------------------------*/ | 1439 /*----------------------------------------------------------------------------*/ |
1434 /* */ | 1440 /* */ |
1435 /* DEFINITIONS FOR DSP <-> MCU COMMUNICATION. */ | 1441 /* DEFINITIONS FOR DSP <-> MCU COMMUNICATION. */ |
1436 /* ++++++++++++++++++++++++++++++++++++++++++ */ | 1442 /* ++++++++++++++++++++++++++++++++++++++++++ */ |
1437 /* */ | 1443 /* */ |
1438 /*------------------------------------------------------------------------------*/ | 1444 /*----------------------------------------------------------------------------*/ |
1439 // COMMUNICATION Interrupt definition | 1445 // COMMUNICATION Interrupt definition |
1440 //------------------------------------ | 1446 //------------------------------------ |
1441 #define ALL_16BIT 0xffffL | 1447 #define ALL_16BIT 0xffffL |
1442 #define B_GSM_PAGE (TRUE_L << 0) | 1448 #define B_GSM_PAGE (TRUE_L << 0) |
1443 #define B_GSM_TASK (TRUE_L << 1) | 1449 #define B_GSM_TASK (TRUE_L << 1) |
1674 // DSP ADRESSES | 1680 // DSP ADRESSES |
1675 //-------------------- | 1681 //-------------------- |
1676 | 1682 |
1677 #define DB_SIZE (4*20L) // 4 pages of 20 words... | 1683 #define DB_SIZE (4*20L) // 4 pages of 20 words... |
1678 | 1684 |
1679 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39) | 1685 #if (DSP >= 33) |
1680 #define MCU_API_BASE_ADDRESS 0xFFD00000L | 1686 #define MCU_API_BASE_ADDRESS 0xFFD00000L |
1681 #define DSP_API_BASE_ADDRESS 0x800 | 1687 #define DSP_API_BASE_ADDRESS 0x800 |
1682 #define DB_W_PAGE_0 0xFFD00000L // DB page 0 write : 20 words long | 1688 #define DB_W_PAGE_0 0xFFD00000L // DB page 0 write : 20 words long |
1683 #define DB_W_PAGE_1 0xFFD00028L // DB page 1 write : 20 words long | 1689 #define DB_W_PAGE_1 0xFFD00028L // DB page 1 write : 20 words long |
1684 #define DB_R_PAGE_0 0xFFD00050L // DB page 0 read : 20 words long | 1690 #define DB_R_PAGE_0 0xFFD00050L // DB page 0 read : 20 words long |