comparison L1/include/l1_macro.h @ 3:f93dab57b032

L1/include: TCS211-based version restored
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:45:00 +0000
parents 75a11d740a02
children
comparison
equal deleted inserted replaced
2:7c13c26f1aa4 3:f93dab57b032
1 /************* Revision Controle System Header ************* 1 /************* Revision Controle System Header *************
2 * GSM Layer 1 software 2 * GSM Layer 1 software
3 * L1_MACRO.H 3 * L1_MACRO.H
4 * 4 *
5 * Filename l1_macro.h 5 * Filename l1_macro.h
6 * Copyright 2003 (C) Texas Instruments 6 * Copyright 2003 (C) Texas Instruments
7 * 7 *
8 ************* Revision Controle System Header *************/ 8 ************* Revision Controle System Header *************/
9 9
10 #include "l1_confg.h" 10 #include "l1_confg.h"
11
11 #if(L1_DYN_DSP_DWNLD == 1) 12 #if(L1_DYN_DSP_DWNLD == 1)
12 #include "../dyn_dwl_include/l1_dyn_dwl_const.h" 13 #include "../dyn_dwl_include/l1_dyn_dwl_const.h"
13 #endif 14 #endif
14 #include "l1_types.h"
15 15
16 #if (TRACE_TYPE==5) && NUCLEUS_TRACE 16 #if (TRACE_TYPE==5) && NUCLEUS_TRACE
17 //WARNING : this type of trace takes a lot of space in data RAM (~16kB) 17 //WARNING : this type of trace takes a lot of space in data RAM (~16kB)
18 18
19 // switch for Nucleus debugging messages. 19 // switch for Nucleus debugging messages.
70 /************************************************************/ 70 /************************************************************/
71 /* Macros for FAST INTEGER MODULO implementation. */ 71 /* Macros for FAST INTEGER MODULO implementation. */
72 /************************************************************/ 72 /************************************************************/
73 #define IncMod(operand, increment, modulo) \ 73 #define IncMod(operand, increment, modulo) \
74 if( (operand += increment) >= modulo ) operand -= modulo 74 if( (operand += increment) >= modulo ) operand -= modulo
75 75
76 76
77 // Define MACRO for selecting the min. time to next task. 77 // Define MACRO for selecting the min. time to next task.
78 #define Select_min_time(Task_Time, Min_Time) \ 78 #define Select_min_time(Task_Time, Min_Time) \
79 if(Task_Time < Min_Time) Min_Time = Task_Time; 79 if(Task_Time < Min_Time) Min_Time = Task_Time;
80 80
81
81 /************************************************************/ 82 /************************************************************/
82 /* Macros for MCU/DSP API address conversion . */ 83 /* Macros for MCU/DSP API address conversion . */
83 /************************************************************/ 84 /************************************************************/
85 #if(L1_DYN_DSP_DWNLD == 1)
84 86
85 #define API_address_dsp2mcu(dsp_address) \ 87 #define API_address_dsp2mcu(dsp_address) \
86 (MCU_API_BASE_ADDRESS + ((API)((dsp_address) - DSP_API_BASE_ADDRESS) * 2)) 88 (MCU_API_BASE_ADDRESS + ((API)((dsp_address) - DSP_API_BASE_ADDRESS) * 2))
87 89
88 #define API_address_mcu2dsp(mcu_address) \ 90 #define API_address_mcu2dsp(mcu_address) \
89 (DSP_API_BASE_ADDRESS + ((UWORD32)((mcu_address) - MCU_API_BASE_ADDRESS) / 2)) 91 (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 92 #endif
119 93
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