FreeCalypso > hg > freecalypso-citrine
comparison L1/include/l1_macro.h @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children | f93dab57b032 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /************* Revision Controle System Header ************* | |
2 * GSM Layer 1 software | |
3 * L1_MACRO.H | |
4 * | |
5 * Filename l1_macro.h | |
6 * Copyright 2003 (C) Texas Instruments | |
7 * | |
8 ************* Revision Controle System Header *************/ | |
9 | |
10 #include "l1_confg.h" | |
11 #if(L1_DYN_DSP_DWNLD == 1) | |
12 #include "../dyn_dwl_include/l1_dyn_dwl_const.h" | |
13 #endif | |
14 #include "l1_types.h" | |
15 | |
16 #if (TRACE_TYPE==5) && NUCLEUS_TRACE | |
17 //WARNING : this type of trace takes a lot of space in data RAM (~16kB) | |
18 | |
19 // switch for Nucleus debugging messages. | |
20 #define NU_ALLOC_ERR 0 | |
21 #define NU_DEALLOC_ERR 1 | |
22 #define NU_RCVE_QUEUE_ERR 2 | |
23 #define NU_SEND_QUEUE_ERR 3 | |
24 #define NU_OBTA_SEMA_ERR 4 | |
25 #define NU_RLSE_SEMA_ERR 5 | |
26 | |
27 // Nucleus debug function. | |
28 #define DEBUGMSG(status,type) \ | |
29 if(status) switch(type) \ | |
30 { \ | |
31 case NU_ALLOC_ERR: \ | |
32 printf("NU mem. allocation error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
33 exit(0); \ | |
34 break; \ | |
35 \ | |
36 case NU_DEALLOC_ERR: \ | |
37 printf("NU mem. deallocation error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
38 exit(0); \ | |
39 break; \ | |
40 \ | |
41 case NU_RCVE_QUEUE_ERR: \ | |
42 printf("NU rcve queue error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
43 exit(0); \ | |
44 break; \ | |
45 \ | |
46 case NU_SEND_QUEUE_ERR: \ | |
47 printf("NU send queue error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
48 exit(0); \ | |
49 break; \ | |
50 \ | |
51 case NU_OBTA_SEMA_ERR: \ | |
52 printf("NU obtain semaph. error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
53 exit(0); \ | |
54 break; \ | |
55 \ | |
56 case NU_RLSE_SEMA_ERR: \ | |
57 printf("NU release semaph. error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
58 exit(0); \ | |
59 break; \ | |
60 \ | |
61 default: \ | |
62 printf("Unknown error %d file %s line %d\n", status,__FILE__,__LINE__); \ | |
63 exit(0); \ | |
64 break; \ | |
65 } | |
66 #else | |
67 #define DEBUGMSG(status,type) | |
68 #endif | |
69 | |
70 /************************************************************/ | |
71 /* Macros for FAST INTEGER MODULO implementation. */ | |
72 /************************************************************/ | |
73 #define IncMod(operand, increment, modulo) \ | |
74 if( (operand += increment) >= modulo ) operand -= modulo | |
75 | |
76 | |
77 // Define MACRO for selecting the min. time to next task. | |
78 #define Select_min_time(Task_Time, Min_Time) \ | |
79 if(Task_Time < Min_Time) Min_Time = Task_Time; | |
80 | |
81 /************************************************************/ | |
82 /* Macros for MCU/DSP API address conversion . */ | |
83 /************************************************************/ | |
84 | |
85 #define API_address_dsp2mcu(dsp_address) \ | |
86 (MCU_API_BASE_ADDRESS + ((API)((dsp_address) - DSP_API_BASE_ADDRESS) * 2)) | |
87 | |
88 #define API_address_mcu2dsp(mcu_address) \ | |
89 (DSP_API_BASE_ADDRESS + ((UWORD32)((mcu_address) - MCU_API_BASE_ADDRESS) / 2)) | |
90 | |
91 | |
92 | |
93 | |
94 /* Added temporirly for RF_KEypad build */ | |
95 | |
96 #if (L1_RF_KBD_FIX == 1) | |
97 | |
98 #if(OP_L1_STANDALONE == 1) | |
99 | |
100 #if 0 | |
101 typedef struct | |
102 { | |
103 // T_RVF_MB_ID prim_id; | |
104 // T_RVF_ADDR_ID addr_id; | |
105 // BOOL swe_is_initialized; | |
106 // T_RVM_RETURN (*error_ft)(T_RVM_NAME swe_name, | |
107 // T_RVM_RETURN error_cause, | |
108 // T_RVM_ERROR_TYPE error_type, | |
109 // T_RVM_STRING error_msg); | |
110 #if ((CHIPSET == 12) || (CHIPSET == 15)) | |
111 // T_KPD_RECEIVED_KEY_INFO received_key_info[KPD_MAX_DETECTABLE]; | |
112 //UINT8 nb_active_keys; | |
113 UWORD16 repeat_time; | |
114 UWORD16 long_time; | |
115 #endif | |
116 } T_KPD_ENV_CTRL_BLK_L1; | |
117 | |
118 #endif | |
119 | |
120 // typedef unsigned char KPD_CORRECTION_RATIO; //UWORD8 //omaps00090550 | |
121 void kpd_timer_modify(UWORD8 ratio,UWORD32 frameNumber); //omaps00090550 | |
122 #define KBR_DEBOUNCING_TIME (MEM_KEYBOARD + 0x02) /* KBR debouncing time reg */ | |
123 #define KPD_DEBOUNCING_TIME (0x3F) | |
124 #define KBR_LONG_KEY_TIME (MEM_KEYBOARD + 0x04) /* KBR long key time reg */ | |
125 #define KBR_TIME_OUT (MEM_KEYBOARD + 0x06) /* KBR Time out reg */ | |
126 #define KBR_CTRL_REG (MEM_KEYBOARD + 0x00) /* KBR control reg */ | |
127 #define KBR_STATE_MACHINE_STATUS (MEM_KEYBOARD + 0x0E) /* KBR state machine status reg */ | |
128 #define KPD_CLK_DIV32 4 | |
129 #define KPD_CLOCK_DIVIDER KPD_CLK_DIV32 | |
130 | |
131 #define SetGroupBits16(registre,position,number,value) {\ | |
132 UINT16 tmp=registre;\ | |
133 volatile UINT16 tmpvalue;\ | |
134 tmpvalue = (value<<(16-(number)));\ | |
135 tmpvalue = (tmpvalue>>(16-(number)));\ | |
136 tmp&=~((0xFFFF>>(16-(number)))<<(position));\ | |
137 tmp|=((tmpvalue&(0xFFFF>>(16-(number))))<<(position));\ | |
138 registre=tmp;\ | |
139 } | |
140 #endif/* #if(OP_L1_STANDALONE == 1) */ | |
141 | |
142 #endif /* #if (L1_RF_KBD_FIX == 1) */ | |
143 /* Added temporirly for RF_KEypad build */ | |
144 | |
145 | |
146 | |
147 | |
148 | |
149 |