]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/include/tsl_conf_stm32l1xx.h
Remove unused files from STM32L discovery board demo directory structure and build.
[freertos] / FreeRTOS / Demo / CORTEX_STM32L152_Discovery_IAR / include / tsl_conf_stm32l1xx.h
1 /**\r
2   ******************************************************************************\r
3   * @file    STM32L152_Ex06_Linear_DISC\inc\tsl_conf_stm32l1xx.h\r
4   * @author  MCD Application Team\r
5   * @version V1.0.3\r
6   * @date    May-2013\r
7   * @brief   Acquisition parameters for STM32L1xx products.\r
8   * @note    This file must be copied in the application project and values\r
9   *          changed for the application.\r
10   ******************************************************************************\r
11   * @attention\r
12   *\r
13   * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>\r
14   *\r
15   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");\r
16   * You may not use this file except in compliance with the License.\r
17   * You may obtain a copy of the License at:\r
18   *\r
19   *        http://www.st.com/software_license_agreement_liberty_v2\r
20   *\r
21   * Unless required by applicable law or agreed to in writing, software\r
22   * distributed under the License is distributed on an "AS IS" BASIS,\r
23   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
24   * See the License for the specific language governing permissions and\r
25   * limitations under the License.\r
26   *\r
27   ******************************************************************************\r
28   */\r
29 \r
30 /* Define to prevent recursive inclusion -------------------------------------*/\r
31 #ifndef __TSL_CONF_STM32L1xx_H\r
32 #define __TSL_CONF_STM32L1xx_H\r
33 \r
34 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
35 //+++++++++++++++++++++++++++ COMMON PARAMETERS ++++++++++++++++++++++++++++++++\r
36 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
37 \r
38 /** @defgroup Common_Parameters Common Parameters\r
39   * @{ */\r
40 \r
41 //==============================================================================\r
42 // Number of elements\r
43 //==============================================================================\r
44 \r
45 /** @defgroup Common_Parameters_Number_Of_Elements 01 - Number of elements\r
46   * @{ */\r
47 \r
48 /** Total number of channels in application (range=1..255)\r
49 */\r
50 #define TSLPRM_TOTAL_CHANNELS (3)\r
51 \r
52 /** Total number of banks in application (range=1..255)\r
53 */\r
54 #define TSLPRM_TOTAL_BANKS (1)\r
55 \r
56 /** Total number of "Extended" TouchKeys in application (range=0..255)\r
57 */\r
58 #define TSLPRM_TOTAL_TOUCHKEYS (0)\r
59 \r
60 /** Total number of "Basic" TouchKeys in application (range=0..255)\r
61 */\r
62 #define TSLPRM_TOTAL_TOUCHKEYS_B (0)\r
63 \r
64 /** Total number of "Extended" Linear and Rotary sensors in application (range=0..255)\r
65   - Count also the 1-channel linear sensor used as TouchKey\r
66 */\r
67 #define TSLPRM_TOTAL_LINROTS (1)\r
68 \r
69 /** Total number of "Basic" Linear and Rotary sensors in application (range=0..255)\r
70   - Count also the 1-channel linear sensor used as TouchKey\r
71 */\r
72 #define TSLPRM_TOTAL_LINROTS_B (0)\r
73 \r
74 /** Total number of sensors/objects in application (range=1..255)\r
75   - Count all TouchKeys, Linear and Rotary sensors\r
76 */\r
77 #define TSLPRM_TOTAL_OBJECTS (1)\r
78 \r
79 /** @} Common_Parameters_Number_Of_Elements */\r
80 \r
81 //==============================================================================\r
82 // Optional features\r
83 //==============================================================================\r
84 \r
85 /** @defgroup Common_Parameters_Options 02 - Optional features\r
86   * @{ */\r
87 \r
88 /** Record the last measure (0=No, 1=Yes)\r
89   - If No the measure is recalculated using the Reference and Delta\r
90 */\r
91 #define TSLPRM_USE_MEAS (1)\r
92 \r
93 /** Zone management usage (0=No, 1=Yes)\r
94 */\r
95 #define TSLPRM_USE_ZONE (0)\r
96 \r
97 /** Proximity detection usage (0=No, 1=Yes)\r
98 */\r
99 #define TSLPRM_USE_PROX (0)\r
100 \r
101 /** Use the Timer tick callback (0=No, 1=Yes)\r
102   - When equal to 1, the function TSL_CallBack_TimerTick must be defined in\r
103     the application code. It is called for each timer interruption.\r
104 */\r
105 #define TSLPRM_USE_TIMER_CALLBACK (0)\r
106 \r
107 /** Acquisition interrupt mode (0=No, 1=Yes)\r
108   - If No the TS interrupt is not used.\r
109   - If Yes the TS interrupt is used.\r
110 */\r
111 #define TSLPRM_USE_ACQ_INTERRUPT (0)\r
112 \r
113 /** @} Common_Parameters_Options */\r
114 \r
115 //==============================================================================\r
116 // Acquisition limits\r
117 //==============================================================================\r
118 \r
119 /** @defgroup Common_Parameters_Acquisition_Limits 03 - Acquisition limits\r
120   * @{ */\r
121 \r
122 /** Minimum acquisition measurement (range=0..65535)\r
123   - This is the minimum acceptable value for the acquisition measure.\r
124   - The acquisition will be in error if the measure is below this value.\r
125 */\r
126 #define TSLPRM_ACQ_MIN (50)\r
127 \r
128 /** Maximum acquisition measurement (range=0..65535)\r
129   - This is the maximum acceptable value for the acquisition measure.\r
130   - The acquisition will be in error if the measure is above this value.\r
131 */\r
132 #define TSLPRM_ACQ_MAX (4000)\r
133 \r
134 /** @} Common_Parameters_Acquisition_Limits */\r
135 \r
136 //==============================================================================\r
137 // Calibration\r
138 //==============================================================================\r
139 \r
140 /** @defgroup Common_Parameters_Calibration 04 - Calibration\r
141   * @{ */\r
142 \r
143 /** Number of calibration samples (range=4, 8, 16)\r
144   - Low value = faster calibration but less precision.\r
145   - High value = slower calibration but more precision.\r
146 */\r
147 #define TSLPRM_CALIB_SAMPLES (8)\r
148 \r
149 /** Delay in measurement samples before starting the calibration (range=0..40)\r
150   - This is usefull if a noise filter is used.\r
151   - Write 0 to disable the delay.\r
152 */\r
153 #define TSLPRM_CALIB_DELAY (10)\r
154 \r
155 /** @} Common_Parameters_Calibration */\r
156 \r
157 //==============================================================================\r
158 // Thresholds for TouchKey sensors\r
159 //==============================================================================\r
160 \r
161 /** @defgroup Common_Parameters_TouchKey_Thresholds 05 - Thresholds for TouchKey sensors\r
162   * @{ */\r
163 \r
164 /** TouchKeys Proximity state input threshold (range=0..255)\r
165   - Enter Proximity state if delta is above\r
166 */\r
167 #define TSLPRM_TKEY_PROX_IN_TH (20)\r
168 \r
169 /** TouchKeys Proximity state output threshold (range=0..255)\r
170   - Exit Proximity state if delta is below\r
171 */\r
172 #define TSLPRM_TKEY_PROX_OUT_TH (15)\r
173 \r
174 /** TouchKeys Detect state input threshold (range=0..255)\r
175   - Enter Detect state if delta is above\r
176 */\r
177 #define TSLPRM_TKEY_DETECT_IN_TH (30)\r
178 \r
179 /** TouchKeys Detect state output threshold (range=0..255)\r
180   - Exit Detect state if delta is below\r
181 */\r
182 #define TSLPRM_TKEY_DETECT_OUT_TH (25)\r
183 \r
184 /** TouchKeys re-Calibration threshold (range=0..255)\r
185   - @warning The value is inverted in the sensor state machine\r
186   - Enter Calibration state if delta is below\r
187 */\r
188 #define TSLPRM_TKEY_CALIB_TH (30)\r
189 \r
190 /** TouchKey, Linear and Rotary sensors thresholds coefficient (range=0..4)\r
191     This multiplier coefficient is applied on Detect thresholds only.\r
192   - 0: feature disabled\r
193   - 1: thresholds x 2\r
194   - 2: thresholds x 4\r
195   - 3: thresholds x 8\r
196   - 4: thresholds x 16\r
197 */\r
198 #define TSLPRM_COEFF_TH (0)\r
199 \r
200 /** @} Common_Parameters_TouchKey_Thresholds */\r
201 \r
202 //==============================================================================\r
203 // Thresholds for Linear and Rotary sensors\r
204 //==============================================================================\r
205 \r
206 /** @defgroup Common_Parameters_LinRot_Thresholds 06 - Thresholds for Linear and Rotary sensors\r
207   * @{ */\r
208 \r
209 /** Linear/Rotary Proximity state input threshold (range=0..255)\r
210   - Enter Proximity state if delta is above\r
211 */\r
212 #define TSLPRM_LINROT_PROX_IN_TH (30)\r
213 \r
214 /** Linear/Rotary Proximity state output threshold (range=0..255)\r
215   - Exit Proximity state if delta is below\r
216 */\r
217 #define TSLPRM_LINROT_PROX_OUT_TH (20)\r
218 \r
219 /** Linear/Rotary Detect state input threshold (range=0..255)\r
220   - Enter Detect state if delta is above\r
221 */\r
222 #define TSLPRM_LINROT_DETECT_IN_TH (50)\r
223 \r
224 /** Linear/Rotary Detect state output threshold (range=0..255)\r
225   - Exit Detect state if delta is below\r
226 */\r
227 #define TSLPRM_LINROT_DETECT_OUT_TH (40)\r
228 \r
229 /** Linear/Rotary re-Calibration threshold (range=0..255)\r
230   - @warning The value is inverted in the sensor state machine\r
231   - Enter Calibration state if delta is below\r
232   - A low absolute value will result in a higher sensitivity and thus some spurious\r
233     recalibration may be issued.\r
234 */\r
235 #define TSLPRM_LINROT_CALIB_TH (50)\r
236 \r
237 /** Linear/Rotary Delta normalization (0=No, 1=Yes)\r
238   - When this parameter is set, a coefficient is applied on all Delta of all sensors\r
239     in order to normalize them and to improve the position calculation.\r
240   - These coefficients must be defined in a constant table in the application (see Library examples).\r
241   - The MSB is the coefficient integer part, the LSB is the coefficient real part.\r
242   - Examples:\r
243     - To apply a factor 1.10:\r
244       0x01 to the MSB\r
245       0x1A to the LSB (0.10 x 256 = 25.6 -> rounded to 26 = 0x1A)\r
246     - To apply a factor 0.90:\r
247       0x00 to the MSB\r
248       0xE6 to the LSB (0.90 x 256 = 230.4 -> rounded to 230 = 0xE6)\r
249     - To apply no factor:\r
250       0x01 to the MSB\r
251       0x00 to the LSB\r
252 */\r
253 #define TSLPRM_LINROT_USE_NORMDELTA (1)\r
254 \r
255 /** @} Common_Parameters_LinRot_Thresholds */\r
256 \r
257 //==============================================================================\r
258 // Linear/Rotary sensors used\r
259 //==============================================================================\r
260 \r
261 /** @defgroup Common_Parameters_LinRot_Used 07 - Linear/Rotary sensors used\r
262   * @{ */\r
263 \r
264 /** Select which Linear and Rotary sensors you use in your application.\r
265     - 0 = Not Used\r
266     - 1 = Used\r
267 \r
268   LIN = Linear sensor\r
269   ROT = Rotary sensor\r
270   M = Mono electrodes design\r
271   H = Half-ended electrodes design\r
272   D = Dual electrodes design\r
273 */\r
274 #define TSLPRM_USE_3CH_LIN_M (0)\r
275 #define TSLPRM_USE_3CH_LIN_H (1)\r
276 #define TSLPRM_USE_3CH_ROT_M (0)\r
277 \r
278 #define TSLPRM_USE_4CH_LIN_M (0)\r
279 #define TSLPRM_USE_4CH_LIN_H (0)\r
280 #define TSLPRM_USE_4CH_ROT_M (0)\r
281 \r
282 #define TSLPRM_USE_5CH_LIN_M (0)\r
283 #define TSLPRM_USE_5CH_LIN_H (0)\r
284 #define TSLPRM_USE_5CH_ROT_M (0)\r
285 #define TSLPRM_USE_5CH_ROT_D (0)\r
286 \r
287 #define TSLPRM_USE_6CH_LIN_M (0)\r
288 #define TSLPRM_USE_6CH_LIN_H (0)\r
289 #define TSLPRM_USE_6CH_ROT_M (0)\r
290 \r
291 /** @} Common_Parameters_LinRot_used */\r
292 \r
293 //==============================================================================\r
294 // Linear/Rotary sensors position\r
295 //==============================================================================\r
296 \r
297 /** @defgroup Common_Parameters_LinRot_Position 08 - Linear/Rotary sensors position\r
298   * @{ */\r
299 \r
300 /** Position resolution in number of bits (range=1..8)\r
301   - A Low value will result in a low resolution and will be less subject to noise.\r
302   - A High value will result in a high resolution and will be more subject to noise.\r
303 */\r
304 #define TSLPRM_LINROT_RESOLUTION (7)\r
305 \r
306 /** Direction change threshold in position unit (range=0..255)\r
307   - Defines the default threshold used during the change direction process.\r
308   - A Low value will result in a faster direction change.\r
309   - A High value will result in a slower direction change.\r
310 */\r
311 #define TSLPRM_LINROT_DIR_CHG_POS (10)\r
312 \r
313 /** Direction change debounce (range=0..63)\r
314   - Defines the default integrator counter used during the change direction process.\r
315   - This counter is decremented when the same change in the position is detected and the direction will\r
316     change after this counter reaches zero.\r
317   - A Low value will result in a faster direction change.\r
318   - A High value will result in a slower direction change.\r
319 */\r
320 #define TSLPRM_LINROT_DIR_CHG_DEB (1)\r
321 \r
322 /** @} Common_Parameters_LinRot_Position */\r
323 \r
324 //==============================================================================\r
325 // Debounce counters\r
326 //==============================================================================\r
327 \r
328 /** @defgroup Common_Parameters_Debounce 09 - Debounce counters\r
329   * @{ */\r
330 \r
331 /** Proximity state debounce in samples unit (range=0..63)\r
332   - A Low value will result in a higher sensitivity during the Proximity detection but with less noise filtering.\r
333   - A High value will result in improving the system noise immunity but will increase the system response time.\r
334 */\r
335 #define TSLPRM_DEBOUNCE_PROX (3)\r
336 \r
337 /** Detect state debounce in samples unit (range=0..63)\r
338   - A Low value will result in a higher sensitivity during the detection but with less noise filtering.\r
339   - A High value will result in improving the system noise immunity but will increase the system response time.\r
340 */\r
341 #define TSLPRM_DEBOUNCE_DETECT (3)\r
342 \r
343 /** Release state debounce in samples unit (range=0..63)\r
344   - A Low value will result in a higher sensitivity during the end-detection but with less noise filtering.\r
345   - A High value will result in a lower sensitivity during the end-detection but with more noise filtering.\r
346 */\r
347 #define TSLPRM_DEBOUNCE_RELEASE (3)\r
348 \r
349 /** Re-calibration state debounce in samples unit (range=0..63)\r
350   - A Low value will result in a higher sensitivity during the recalibration but with less noise filtering.\r
351   - A High value will result in a lower sensitivity during the recalibration but with more noise filtering.\r
352 */\r
353 #define TSLPRM_DEBOUNCE_CALIB (3)\r
354 \r
355 /** Error state debounce in samples unit (range=0..63)\r
356   - A Low value will result in a higher sensitivity to enter in error state.\r
357   - A High value will result in a lower sensitivity to enter in error state.\r
358 */\r
359 #define TSLPRM_DEBOUNCE_ERROR (3)\r
360 \r
361 /** @} Common_Parameters_Debounce */\r
362 \r
363 //==============================================================================\r
364 // Environment Change System (ECS)\r
365 //==============================================================================\r
366 \r
367 /** @defgroup Common_Parameters_ECS 10 - ECS\r
368   * @{ */\r
369 \r
370 /** Environment Change System Slow K factor (range=0..255)\r
371   - The higher value is K, the faster is the response time.\r
372 */\r
373 #define TSLPRM_ECS_K_SLOW (10)\r
374 \r
375 /** Environment Change System Fast K factor (range=0..255)\r
376   - The higher value is K, the faster is the response time.\r
377 */\r
378 #define TSLPRM_ECS_K_FAST (20)\r
379 \r
380 /** Environment Change System delay in msec (range=0..5000)\r
381   - The ECS will be started after this delay and when all sensors are in Release state.\r
382 */\r
383 #define TSLPRM_ECS_DELAY (500)\r
384 \r
385 /** @} Common_Parameters_ECS */\r
386 \r
387 //==============================================================================\r
388 // Detection Time Out (DTO)\r
389 //==============================================================================\r
390 \r
391 /** @defgroup Common_Parameters_DTO 11 - DTO\r
392   * @{ */\r
393 \r
394 /** Detection Time Out delay in seconds (range=0..63)\r
395   - Value 0: DTO processing not compiled in the code (to gain size if not used).\r
396   - Value 1: Default time out infinite.\r
397   - Value between 2 and 63: Default time out between value n-1 and n.\r
398   - Examples:\r
399       - With a DTO equal to 2, the time out is between 1s and 2s.\r
400       - With a DTO equal to 63, the time out is between 62s and 63s.\r
401 \r
402 @note The DTO can be changed in run-time by the application only if the\r
403       default value is between 1 and 63.\r
404 */\r
405 #define TSLPRM_DTO (10)\r
406 \r
407 /** @} Common_Parameters_DTO */\r
408 \r
409 //==============================================================================\r
410 // Detection Exclusion System (DXS)\r
411 //==============================================================================\r
412 \r
413 /** @defgroup Common_Parameters_DXS 12 - DXS\r
414   * @{ */\r
415 \r
416 /** Detection Exclusion System (0=No, 1=Yes)\r
417 */\r
418 #define TSLPRM_USE_DXS (0)\r
419 \r
420 /** @} Common_Parameters_DXS */\r
421 \r
422 //==============================================================================\r
423 // Miscellaneous parameters\r
424 //==============================================================================\r
425 \r
426 /** @defgroup Common_Parameters_Misc 13 - Miscellaneous\r
427   * @{ */\r
428 \r
429 /** Timing tick frequency in Hz (range=125, 250, 500, 1000, 2000)\r
430   - Result to a timing interrupt respectively every 8ms, 4ms, 2ms, 1ms, 0.5ms\r
431 */\r
432 #define TSLPRM_TICK_FREQ (2000)\r
433 \r
434 /** @} Common_Parameters_Misc */\r
435 \r
436 /** @} Common_Parameters */\r
437 \r
438 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
439 //++++++++++++++++++++++++++++++ MCU PARAMETERS ++++++++++++++++++++++++++++++++\r
440 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
441 \r
442 /** @defgroup STM32L1xx_Parameters STM32L1xx Parameters\r
443   * @{ */\r
444 \r
445 /** @defgroup STM32L1xx_Parameters_Misc 01 - Miscellaneous\r
446   * @{ */\r
447 \r
448 /** Shield with a channel (0=No, 1=Yes)\r
449 */\r
450 #define TSLPRM_USE_SHIELD (0)\r
451 \r
452 /** IOs default mode when no on-going acquisition (range=0..1)\r
453     - 0: Output push-pull low\r
454     - 1: Input floating\r
455 */\r
456 #define TSLPRM_IODEF (0)\r
457 \r
458 /** Master timer prescaler for HW acquisition only (range=0..65535)\r
459     - Divide the timer input clock by this value plus one\r
460 */\r
461 #define TSLPRM_TIM_PRESCALER (0)\r
462 \r
463 /** Master timer reload value for HW acquisition only (range=4..65534, even number)\r
464     - Set the auto-reload value for the center aligned counter\r
465 */\r
466 #define TSLPRM_TIM_RELOAD (64)\r
467 \r
468 /** IT disabling for IO protection for SW acquisition only (range=0..1)\r
469     - 0: IO not protected\r
470     - 1: IO protected\r
471 */\r
472 #define TSLPRM_PROTECT_IO_ACCESS (1)\r
473 \r
474 /** Which GPIO will be used for SW acquisition only (range=0..1)\r
475     - 0: Not used\r
476     - 1: Used\r
477 */\r
478 #define TSLPRM_USE_GPIOA   (1)\r
479 #define TSLPRM_USE_GPIOB   (1)\r
480 #define TSLPRM_USE_GPIOC   (1)\r
481 #define TSLPRM_USE_GPIOF   (0)\r
482 #define TSLPRM_USE_GPIOG   (0)\r
483 \r
484 /** @} STM32L1xx_Parameters_Misc */\r
485 \r
486 /** @} STM32L1xx_Parameters */\r
487 \r
488 // DO NOT REMOVE !!!\r
489 #include "tsl_check_config.h"\r
490 \r
491 #endif /* __TSL_CONF_STM32L1xx_H */\r
492 \r
493 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r