2 ******************************************************************************
\r
3 * @file tsl_check_config.h
\r
4 * @author MCD Application Team
\r
6 * @date 22-January-2013
\r
7 * @brief This file contains the check of all parameters defined in the
\r
8 * common configuration file.
\r
9 ******************************************************************************
\r
12 * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
\r
14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
\r
15 * You may not use this file except in compliance with the License.
\r
16 * You may obtain a copy of the License at:
\r
18 * http://www.st.com/software_license_agreement_liberty_v2
\r
20 * Unless required by applicable law or agreed to in writing, software
\r
21 * distributed under the License is distributed on an "AS IS" BASIS,
\r
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
23 * See the License for the specific language governing permissions and
\r
24 * limitations under the License.
\r
26 ******************************************************************************
\r
29 /* Define to prevent recursive inclusion -------------------------------------*/
\r
30 #ifndef __TSL_CHECK_CONFIG_H
\r
31 #define __TSL_CHECK_CONFIG_H
\r
33 //==============================================================================
\r
34 // Common parameters check
\r
35 //==============================================================================
\r
37 //------------------------------------------------------------------------------
\r
39 #ifndef TSLPRM_TOTAL_CHANNELS
\r
40 #error "TSLPRM_TOTAL_CHANNELS is not defined."
\r
43 #ifndef TSLPRM_TOTAL_BANKS
\r
44 #error "TSLPRM_TOTAL_BANKS is not defined."
\r
47 #ifndef TSLPRM_TOTAL_TOUCHKEYS
\r
48 #error "TSLPRM_TOTAL_TOUCHKEYS is not defined."
\r
51 #ifndef TSLPRM_TOTAL_TOUCHKEYS_B
\r
52 #error "TSLPRM_TOTAL_TOUCHKEYS_B is not defined."
\r
55 #ifndef TSLPRM_TOTAL_LINROTS
\r
56 #error "TSLPRM_TOTAL_LINROTS is not defined."
\r
59 #ifndef TSLPRM_TOTAL_LINROTS_B
\r
60 #error "TSLPRM_TOTAL_LINROTS_B is not defined."
\r
63 #ifndef TSLPRM_TOTAL_OBJECTS
\r
64 #error "TSLPRM_TOTAL_OBJECTS is not defined."
\r
67 #define TSLPRM_TOTAL_TKEYS (TSLPRM_TOTAL_TOUCHKEYS + TSLPRM_TOTAL_TOUCHKEYS_B)
\r
68 #define TSLPRM_TOTAL_LNRTS (TSLPRM_TOTAL_LINROTS + TSLPRM_TOTAL_LINROTS_B)
\r
70 #if ((TSLPRM_TOTAL_TKEYS == 0) && (TSLPRM_TOTAL_LNRTS == 0))
\r
71 #error "No TouchKey and No Linear/Rotary sensors are defined."
\r
74 //------------------------------------------------------------------------------
\r
76 #ifndef TSLPRM_CALIB_SAMPLES
\r
77 #error "TSLPRM_CALIB_SAMPLES is not defined."
\r
80 #if ((TSLPRM_CALIB_SAMPLES != 4) && (TSLPRM_CALIB_SAMPLES != 8) && (TSLPRM_CALIB_SAMPLES != 16))
\r
81 #error "TSLPRM_CALIB_SAMPLES is out of range (4, 8, 16)."
\r
84 //------------------------------------------------------------------------------
\r
86 #ifndef TSLPRM_CALIB_DELAY
\r
87 #error "TSLPRM_CALIB_DELAY is not defined."
\r
90 #if ((TSLPRM_CALIB_DELAY < 0) || (TSLPRM_CALIB_DELAY > 40))
\r
91 #error "TSLPRM_CALIB_DELAY is out of range (0..40)."
\r
94 //------------------------------------------------------------------------------
\r
96 #ifndef TSLPRM_ACQ_MIN
\r
97 #error "TSLPRM_ACQ_MIN is not defined."
\r
100 #ifndef TSLPRM_ACQ_MAX
\r
101 #error "TSLPRM_ACQ_MAX is not defined."
\r
104 #if ((TSLPRM_ACQ_MIN < 1) || (TSLPRM_ACQ_MIN > (TSLPRM_ACQ_MAX-1)))
\r
105 #error "TSLPRM_ACQ_MIN is out of range (1 .. ACQ_MAX-1)."
\r
108 #if ((TSLPRM_ACQ_MAX < (TSLPRM_ACQ_MIN+1)) || (TSLPRM_ACQ_MAX > 50000))
\r
109 #error "TSLPRM_ACQ_MAX is out of range (ACQ_MIN+1 .. 50000)."
\r
112 //------------------------------------------------------------------------------
\r
114 #ifndef TSLPRM_TKEY_PROX_IN_TH
\r
115 #error "TSLPRM_TKEY_PROX_IN_TH is not defined."
\r
118 #ifndef TSLPRM_TKEY_PROX_OUT_TH
\r
119 #error "TSLPRM_TKEY_PROX_OUT_TH is not defined."
\r
122 #if ((TSLPRM_TKEY_PROX_OUT_TH < 0) || (TSLPRM_TKEY_PROX_OUT_TH > (TSLPRM_TKEY_PROX_IN_TH-1)))
\r
123 #error "TSLPRM_TKEY_PROX_OUT_TH is out of range (0 .. TSLPRM_TKEY_PROX_IN_TH-1)."
\r
126 #if TSLPRM_COEFF_TH == 0
\r
127 #if ((TSLPRM_TKEY_PROX_IN_TH < (TSLPRM_TKEY_PROX_OUT_TH+1)) || (TSLPRM_TKEY_PROX_IN_TH > (TSLPRM_TKEY_DETECT_OUT_TH-1)))
\r
128 #error "TSLPRM_TKEY_PROX_IN_TH is out of range (TSLPRM_TKEY_PROX_OUT_TH+1 .. TSLPRM_TKEY_DETECT_OUT_TH-1)."
\r
132 //------------------------------------------------------------------------------
\r
134 #ifndef TSLPRM_LINROT_PROX_IN_TH
\r
135 #error "TSLPRM_LINROT_PROX_IN_TH is not defined."
\r
138 #ifndef TSLPRM_LINROT_PROX_OUT_TH
\r
139 #error "TSLPRM_LINROT_PROX_OUT_TH is not defined."
\r
142 #if ((TSLPRM_LINROT_PROX_OUT_TH < 0) || (TSLPRM_LINROT_PROX_OUT_TH > (TSLPRM_LINROT_PROX_IN_TH-1)))
\r
143 #error "TSLPRM_LINROT_PROX_OUT_TH is out of range (0 .. TSLPRM_LINROT_PROX_IN_TH-1)."
\r
146 #if TSLPRM_COEFF_TH == 0
\r
147 #if ((TSLPRM_LINROT_PROX_IN_TH < (TSLPRM_LINROT_PROX_OUT_TH+1)) || (TSLPRM_LINROT_PROX_IN_TH > (TSLPRM_LINROT_DETECT_OUT_TH-1)))
\r
148 #error "TSLPRM_LINROT_PROX_IN_TH is out of range (TSLPRM_LINROT_PROX_OUT_TH+1 .. TSLPRM_LINROT_DETECT_OUT_TH-1)."
\r
152 //------------------------------------------------------------------------------
\r
154 #ifndef TSLPRM_TKEY_DETECT_IN_TH
\r
155 #error "TSLPRM_TKEY_DETECT_IN_TH is not defined."
\r
158 #ifndef TSLPRM_TKEY_DETECT_OUT_TH
\r
159 #error "TSLPRM_TKEY_DETECT_OUT_TH is not defined."
\r
162 #if TSLPRM_COEFF_TH == 0
\r
163 #if ((TSLPRM_TKEY_DETECT_OUT_TH < (TSLPRM_TKEY_PROX_IN_TH+1)) || (TSLPRM_TKEY_DETECT_OUT_TH > (TSLPRM_TKEY_DETECT_IN_TH-1)))
\r
164 #error "TSLPRM_TKEY_DETECT_OUT_TH is out of range (TSLPRM_TKEY_PROX_IN_TH+1 .. TSLPRM_TKEY_DETECT_IN_TH-1)."
\r
168 #if ((TSLPRM_TKEY_DETECT_IN_TH < (TSLPRM_TKEY_DETECT_OUT_TH+1)) || (TSLPRM_TKEY_DETECT_IN_TH > 255))
\r
169 #error "TSLPRM_TKEY_DETECT_IN_TH is out of range (TSLPRM_TKEY_DETECT_OUT_TH+1 .. 255)."
\r
172 //------------------------------------------------------------------------------
\r
174 #ifndef TSLPRM_LINROT_DETECT_IN_TH
\r
175 #error "TSLPRM_LINROT_DETECT_IN_TH is not defined."
\r
178 #ifndef TSLPRM_LINROT_DETECT_OUT_TH
\r
179 #error "TSLPRM_LINROT_DETECT_OUT_TH is not defined."
\r
182 #if TSLPRM_COEFF_TH == 0
\r
183 #if ((TSLPRM_LINROT_DETECT_OUT_TH < (TSLPRM_LINROT_PROX_IN_TH+1)) || (TSLPRM_LINROT_DETECT_OUT_TH > (TSLPRM_LINROT_DETECT_IN_TH-1)))
\r
184 #error "TSLPRM_LINROT_DETECT_OUT_TH is out of range (TSLPRM_LINROT_PROX_IN_TH+1 .. TSLPRM_LINROT_DETECT_IN_TH-1)."
\r
188 #if ((TSLPRM_LINROT_DETECT_IN_TH < (TSLPRM_LINROT_DETECT_OUT_TH+1)) || (TSLPRM_LINROT_DETECT_IN_TH > 255))
\r
189 #error "TSLPRM_LINROT_DETECT_IN_TH is out of range (TSLPRM_LINROT_DETECT_OUT_TH+1 .. 255)."
\r
192 //------------------------------------------------------------------------------
\r
194 #ifndef TSLPRM_TKEY_CALIB_TH
\r
195 #error "TSLPRM_TKEY_CALIB_TH is not defined."
\r
198 #if ((TSLPRM_TKEY_CALIB_TH < 0) || (TSLPRM_TKEY_CALIB_TH > 255))
\r
199 #error "TSLPRM_TKEY_CALIB_TH is out of range (0 .. 255)."
\r
202 //------------------------------------------------------------------------------
\r
204 #ifndef TSLPRM_LINROT_CALIB_TH
\r
205 #error "TSLPRM_LINROT_CALIB_TH is not defined."
\r
208 #if ((TSLPRM_LINROT_CALIB_TH < 0) || (TSLPRM_LINROT_CALIB_TH > 255))
\r
209 #error "TSLPRM_LINROT_CALIB_TH is out of range (0 .. 255)."
\r
212 //------------------------------------------------------------------------------
\r
214 #ifndef TSLPRM_LINROT_USE_NORMDELTA
\r
215 #error "TSLPRM_LINROT_USE_NORMDELTA is not defined."
\r
218 #if ((TSLPRM_LINROT_USE_NORMDELTA < 0) || (TSLPRM_LINROT_USE_NORMDELTA > 1))
\r
219 #error "TSLPRM_LINROT_USE_NORMDELTA is out of range (0 .. 1)."
\r
222 //------------------------------------------------------------------------------
\r
224 #ifndef TSLPRM_COEFF_TH
\r
225 #error "TSLPRM_COEFF_TH is not defined."
\r
228 #if ((TSLPRM_COEFF_TH < 0) || (TSLPRM_COEFF_TH > 4))
\r
229 #error "TSLPRM_COEFF_TH is out of range (0 .. 4)."
\r
232 //------------------------------------------------------------------------------
\r
234 #ifndef TSLPRM_LINROT_DIR_CHG_POS
\r
235 #error "TSLPRM_LINROT_DIR_CHG_POS is not defined."
\r
238 #if ((TSLPRM_LINROT_DIR_CHG_POS < 0) || (TSLPRM_LINROT_DIR_CHG_POS > 255))
\r
239 #error "TSLPRM_LINROT_DIR_CHG_POS is out of range (0 .. 255)."
\r
242 //------------------------------------------------------------------------------
\r
244 #ifndef TSLPRM_LINROT_RESOLUTION
\r
245 #error "TSLPRM_LINROT_RESOLUTION is not defined."
\r
248 #if ((TSLPRM_LINROT_RESOLUTION < 1) || (TSLPRM_LINROT_RESOLUTION > 8))
\r
249 #error "TSLPRM_LINROT_RESOLUTION is out of range (1 .. 8)."
\r
252 //------------------------------------------------------------------------------
\r
254 #ifndef TSLPRM_DEBOUNCE_PROX
\r
255 #error "TSLPRM_DEBOUNCE_PROX is not defined."
\r
258 #if ((TSLPRM_DEBOUNCE_PROX < 0) || (TSLPRM_DEBOUNCE_PROX > 63))
\r
259 #error "TSLPRM_DEBOUNCE_PROX is out of range (0 .. 63)."
\r
262 //------------------------------------------------------------------------------
\r
264 #ifndef TSLPRM_DEBOUNCE_DETECT
\r
265 #error "TSLPRM_DEBOUNCE_DETECT is not defined."
\r
268 #if ((TSLPRM_DEBOUNCE_DETECT < 0) || (TSLPRM_DEBOUNCE_DETECT > 63))
\r
269 #error "TSLPRM_DEBOUNCE_DETECT is out of range (0 .. 63)."
\r
272 //------------------------------------------------------------------------------
\r
274 #ifndef TSLPRM_DEBOUNCE_RELEASE
\r
275 #error "TSLPRM_DEBOUNCE_RELEASE is not defined."
\r
278 #if ((TSLPRM_DEBOUNCE_RELEASE < 0) || (TSLPRM_DEBOUNCE_RELEASE > 63))
\r
279 #error "TSLPRM_DEBOUNCE_RELEASE is out of range (0 .. 63)."
\r
282 //------------------------------------------------------------------------------
\r
284 #ifndef TSLPRM_DEBOUNCE_CALIB
\r
285 #error "TSLPRM_DEBOUNCE_CALIB is not defined."
\r
288 #if ((TSLPRM_DEBOUNCE_CALIB < 0) || (TSLPRM_DEBOUNCE_CALIB > 63))
\r
289 #error "TSLPRM_DEBOUNCE_CALIB is out of range (0 .. 63)."
\r
292 //------------------------------------------------------------------------------
\r
294 #ifndef TSLPRM_DEBOUNCE_ERROR
\r
295 #error "TSLPRM_DEBOUNCE_ERROR is not defined."
\r
298 #if ((TSLPRM_DEBOUNCE_ERROR < 0) || (TSLPRM_DEBOUNCE_ERROR > 63))
\r
299 #error "TSLPRM_DEBOUNCE_ERROR is out of range (0 .. 63)."
\r
302 //------------------------------------------------------------------------------
\r
304 #ifndef TSLPRM_LINROT_DIR_CHG_DEB
\r
305 #error "TSLPRM_LINROT_DIR_CHG_DEB is not defined."
\r
308 #if ((TSLPRM_LINROT_DIR_CHG_DEB < 0) || (TSLPRM_LINROT_DIR_CHG_DEB > 63))
\r
309 #error "TSLPRM_LINROT_DIR_CHG_DEB is out of range (0 .. 63)."
\r
312 //------------------------------------------------------------------------------
\r
314 #ifndef TSLPRM_ECS_K_SLOW
\r
315 #error "TSLPRM_ECS_K_SLOW is not defined."
\r
318 #if ((TSLPRM_ECS_K_SLOW < 0) || (TSLPRM_ECS_K_SLOW > 255))
\r
319 #error "TSLPRM_ECS_K_SLOW is out of range (0 .. 255)."
\r
322 //------------------------------------------------------------------------------
\r
324 #ifndef TSLPRM_ECS_K_FAST
\r
325 #error "TSLPRM_ECS_K_FAST is not defined."
\r
328 #if ((TSLPRM_ECS_K_FAST < 0) || (TSLPRM_ECS_K_FAST > 255))
\r
329 #error "TSLPRM_ECS_K_FAST is out of range (0 .. 255)."
\r
332 //------------------------------------------------------------------------------
\r
334 #ifndef TSLPRM_ECS_DELAY
\r
335 #error "TSLPRM_ECS_DELAY is not defined."
\r
338 #if ((TSLPRM_ECS_DELAY < 0) || (TSLPRM_ECS_DELAY > 5000))
\r
339 #error "TSLPRM_ECS_DELAY is out of range (0 .. 5000)."
\r
342 //------------------------------------------------------------------------------
\r
344 #ifndef TSLPRM_USE_MEAS
\r
345 #error "TSLPRM_USE_MEAS is not defined."
\r
348 #if ((TSLPRM_USE_MEAS != 0) && (TSLPRM_USE_MEAS != 1))
\r
349 #error "TSLPRM_USE_MEAS is out of range (0 .. 1)."
\r
352 //------------------------------------------------------------------------------
\r
354 #ifndef TSLPRM_USE_PROX
\r
355 #error "TSLPRM_USE_PROX is not defined."
\r
358 #if ((TSLPRM_USE_PROX != 0) && (TSLPRM_USE_PROX != 1))
\r
359 #error "TSLPRM_USE_PROX is out of range (0 .. 1)."
\r
362 //------------------------------------------------------------------------------
\r
364 #ifndef TSLPRM_USE_ZONE
\r
365 #error "TSLPRM_USE_ZONE is not defined."
\r
368 #if ((TSLPRM_USE_ZONE != 0) && (TSLPRM_USE_ZONE != 1))
\r
369 #error "TSLPRM_USE_ZONE is out of range (0 .. 1)."
\r
372 //------------------------------------------------------------------------------
\r
374 #ifndef TSLPRM_USE_ACQ_INTERRUPT
\r
375 #error "TSLPRM_USE_ACQ_INTERRUPT is not defined."
\r
378 #if ((TSLPRM_USE_ACQ_INTERRUPT != 0) && (TSLPRM_USE_ACQ_INTERRUPT != 1))
\r
379 #error "TSLPRM_USE_ACQ_INTERRUPT is out of range (0 .. 1)."
\r
382 //------------------------------------------------------------------------------
\r
385 #error "TSLPRM_DTO is not defined."
\r
388 #if ((TSLPRM_DTO < 0) || (TSLPRM_DTO > 63))
\r
389 #error "TSLPRM_DTO is out of range (0 .. 63)."
\r
392 //------------------------------------------------------------------------------
\r
394 #ifndef TSLPRM_TICK_FREQ
\r
395 #error "TSLPRM_TICK_FREQ is not defined."
\r
398 #if ((TSLPRM_TICK_FREQ != 125) && (TSLPRM_TICK_FREQ != 250) && (TSLPRM_TICK_FREQ != 500) &&\
\r
399 (TSLPRM_TICK_FREQ != 1000) && (TSLPRM_TICK_FREQ != 2000))
\r
400 #error "TSLPRM_TICK_FREQ is out of range (125, 250, 500, 1000, 2000)."
\r
403 //------------------------------------------------------------------------------
\r
405 #ifndef TSLPRM_USE_DXS
\r
406 #error "TSLPRM_USE_DXS is not defined."
\r
409 #if ((TSLPRM_USE_DXS < 0) || (TSLPRM_USE_DXS > 1))
\r
410 #error "TSLPRM_USE_DXS is out of range (0 .. 1)."
\r
413 //------------------------------------------------------------------------------
\r
415 #ifndef TSLPRM_USE_TIMER_CALLBACK
\r
416 #error "TSLPRM_USE_TIMER_CALLBACK is not defined."
\r
419 #if ((TSLPRM_USE_TIMER_CALLBACK != 0) && (TSLPRM_USE_TIMER_CALLBACK != 1))
\r
420 #error "TSLPRM_USE_TIMER_CALLBACK is out of range (0 .. 1)."
\r
423 //==============================================================================
\r
424 // Specific parameters check
\r
425 //==============================================================================
\r
427 #if defined(STM8TL5X)
\r
428 #include "tsl_check_config_stm8tl5x.h"
\r
431 #if defined(STM32F0XX)
\r
432 #include "tsl_check_config_stm32f0xx.h"
\r
435 #if defined(STM32F30X) || defined(STM32F37X)
\r
436 #include "tsl_check_config_stm32f3xx.h"
\r
439 #if defined(STM32L1XX_MD) || defined(STM32L1XX_HD) || defined(STM32L1XX_MDP)
\r
440 #include "tsl_check_config_stm32l1xx.h"
\r
443 #endif /* __TSL_CHECK_CONFIG_H */
\r
445 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r