2 ******************************************************************************
\r
3 * @file tsl_check_config_stm8tl5x.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 * STM8TL5X 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_STM8TL5X_H
\r
31 #define __TSL_CHECK_CONFIG_STM8TL5X_H
\r
33 //------------------------------------------------------------------------------
\r
35 #if ((TSLPRM_MCU < 0) && (TSLPRM_MCU > 4))
\r
36 #error "The MCU selected is not in the STM8TL5x MCU list !"
\r
39 #if (TSLPRM_MCU > 0)
\r
45 //------------------------------------------------------------------------------
\r
47 #if ((TSLPRM_TOTAL_CHANNELS < 1) || (TSLPRM_TOTAL_CHANNELS > 300))
\r
48 #error "TSLPRM_TOTAL_CHANNELS is out of range (1 .. 300)."
\r
51 #if ((TSLPRM_TOTAL_BANKS < 1) || (TSLPRM_TOTAL_BANKS > 15))
\r
52 #error "TSLPRM_TOTAL_BANKS is out of range (1 .. 15)."
\r
55 #if ((TSLPRM_TOTAL_TOUCHKEYS < 0) || (TSLPRM_TOTAL_TOUCHKEYS > 256))
\r
56 #error "TSLPRM_TOTAL_TOUCHKEYS is out of range (0 .. 256)."
\r
59 #if ((TSLPRM_TOTAL_TOUCHKEYS_B < 0) || (TSLPRM_TOTAL_TOUCHKEYS_B > 256))
\r
60 #error "TSLPRM_TOTAL_TOUCHKEYS_B is out of range (0 .. 256)."
\r
63 #if ((TSLPRM_TOTAL_LINROTS < 0) || (TSLPRM_TOTAL_LINROTS > 256))
\r
64 #error "TSLPRM_TOTAL_LINROTS is out of range (0 .. 256)."
\r
67 #if ((TSLPRM_TOTAL_LINROTS_B < 0) || (TSLPRM_TOTAL_LINROTS_B > 256))
\r
68 #error "TSLPRM_TOTAL_LINROTS_B is out of range (0 .. 256)."
\r
71 #if ((TSLPRM_TOTAL_OBJECTS < 1) || (TSLPRM_TOTAL_OBJECTS > 256))
\r
72 #error "TSLPRM_TOTAL_OBJECTS is out of range (1 .. 256)."
\r
75 //------------------------------------------------------------------------------
\r
77 #ifndef TSLPRM_KEY_TARGET_REFERENCE
\r
78 #error "TSLPRM_KEY_TARGET_REFERENCE is not defined."
\r
81 #if ((TSLPRM_KEY_TARGET_REFERENCE < 100) || (TSLPRM_KEY_TARGET_REFERENCE > 2000))
\r
82 #error "TSLPRM_KEY_TARGET_REFERENCE is out of range (100 .. 2000)."
\r
85 //------------------------------------------------------------------------------
\r
87 #ifndef TSLPRM_KEY_TARGET_REFERENCE_ERROR
\r
88 #error "TSLPRM_KEY_TARGET_REFERENCE_ERROR is not defined."
\r
91 #if ((TSLPRM_KEY_TARGET_REFERENCE_ERROR < 1) || (TSLPRM_KEY_TARGET_REFERENCE_ERROR > TSLPRM_KEY_TARGET_REFERENCE))
\r
92 #error "TSLPRM_KEY_TARGET_REFERENCE_ERROR is out of range (1 .. TSLPRM_KEY_TARGET_REFERENCE)."
\r
95 //------------------------------------------------------------------------------
\r
97 #ifndef TSLPRM_PXS_EPCC_FINE_TUNING_ITERATION
\r
98 #error "TSLPRM_PXS_EPCC_FINE_TUNING_ITERATION is not defined."
\r
101 #if ((TSLPRM_PXS_EPCC_FINE_TUNING_ITERATION < 3) || (TSLPRM_PXS_EPCC_FINE_TUNING_ITERATION > 5))
\r
102 #error "TSLPRM_PXS_EPCC_FINE_TUNING_ITERATION is out of range (3 .. 5)."
\r
105 //------------------------------------------------------------------------------
\r
107 #ifndef TSLPRM_KEY_TARGET_ATTENUATION
\r
108 #error "TSLPRM_KEY_TARGET_ATTENUATION is not defined."
\r
111 #if ((TSLPRM_KEY_TARGET_ATTENUATION != 1) && (TSLPRM_KEY_TARGET_ATTENUATION != 2) &&\
\r
112 (TSLPRM_KEY_TARGET_ATTENUATION != 4) && (TSLPRM_KEY_TARGET_ATTENUATION != 8))
\r
113 #error "TSLPRM_KEY_TARGET_ATTENUATION is out of range (1,2,4,8)."
\r
116 //------------------------------------------------------------------------------
\r
118 #ifndef TSLPRM_TOUCHKEY_REFERENCE_RANGE
\r
119 #error "TSLPRM_TOUCHKEY_REFERENCE_RANGE is not defined."
\r
122 #if ((TSLPRM_TOUCHKEY_REFERENCE_RANGE < 1) || (TSLPRM_TOUCHKEY_REFERENCE_RANGE > TSLPRM_KEY_TARGET_REFERENCE))
\r
123 #error "TSLPRM_TOUCHKEY_REFERENCE_RANGE is out of range (1 .. TSLPRM_KEY_TARGET_REFERENCE)."
\r
126 //------------------------------------------------------------------------------
\r
128 #ifndef TSLPRM_LINROT_REFERENCE_RANGE
\r
129 #error "TSLPRM_LINROT_REFERENCE_RANGE is not defined."
\r
132 #if ((TSLPRM_LINROT_REFERENCE_RANGE < 1) || (TSLPRM_LINROT_REFERENCE_RANGE > TSLPRM_KEY_TARGET_REFERENCE))
\r
133 #error "TSLPRM_LINROT_REFERENCE_RANGE is out of range (1 .. TSLPRM_KEY_TARGET_REFERENCE)."
\r
136 //------------------------------------------------------------------------------
\r
138 #ifndef TSLPRM_PXS_HSI
\r
139 #error "TSLPRM_PXS_HSI is not defined."
\r
142 #if ((TSLPRM_PXS_HSI != 16000) && (TSLPRM_PXS_HSI != 8000) && (TSLPRM_PXS_HSI != 4000) && \
\r
143 (TSLPRM_PXS_HSI != 2000) && (TSLPRM_PXS_HSI != 1000) && (TSLPRM_PXS_HSI != 500) && \
\r
144 (TSLPRM_PXS_HSI != 250) && (TSLPRM_PXS_HSI != 125))
\r
145 #error "TSLPRM_PXS_HSI is out of range (16000, 8000, 4000, 2000, 1000, 500, 250, 125)."
\r
148 //------------------------------------------------------------------------------
\r
150 #ifndef TSLPRM_PXS_UP_LENGTH
\r
151 #error "TSLPRM_PXS_UP_LENGTH is not defined."
\r
154 #if ((TSLPRM_PXS_UP_LENGTH < 1) || (TSLPRM_PXS_UP_LENGTH > 7))
\r
155 #error "TSLPRM_PXS_UP_LENGTH is out of range (1 .. 7)."
\r
158 //------------------------------------------------------------------------------
\r
160 #ifndef TSLPRM_PXS_PASS_LENGTH
\r
161 #error "TSLPRM_PXS_PASS_LENGTH is not defined."
\r
164 #if ((TSLPRM_PXS_PASS_LENGTH < 1) || (TSLPRM_PXS_PASS_LENGTH > 7))
\r
165 #error "TSLPRM_PXS_PASS_LENGTH is out of range (1 .. 7)."
\r
168 //------------------------------------------------------------------------------
\r
170 #ifndef TSLPRM_PXS_LOW_POWER_MODE
\r
171 #error "TSLPRM_PXS_LOW_POWER_MODE is not defined."
\r
174 #if ((TSLPRM_PXS_LOW_POWER_MODE != 0) && (TSLPRM_PXS_LOW_POWER_MODE != 1))
\r
175 #error "TSLPRM_PXS_LOW_POWER_MODE is out of range (0 .. 1)."
\r
178 //------------------------------------------------------------------------------
\r
180 #ifndef TSLPRM_PXS_RF_DETECTION
\r
181 #error "TSLPRM_PXS_RF_DETECTION is not defined."
\r
184 #if ((TSLPRM_PXS_RF_DETECTION != 0) && (TSLPRM_PXS_RF_DETECTION != 1))
\r
185 #error "TSLPRM_PXS_RF_DETECTION is out of range (0 .. 1)."
\r
188 //------------------------------------------------------------------------------
\r
190 #ifndef TSLPRM_PXS_SYNCHRONIZE
\r
191 #error "TSLPRM_PXS_SYNCHRONIZE is not defined."
\r
194 #if ((TSLPRM_PXS_SYNCHRONIZE != 0) && (TSLPRM_PXS_SYNCHRONIZE != 1))
\r
195 #error "TSLPRM_PXS_SYNCHRONIZE is out of range (0 .. 1)."
\r
198 //------------------------------------------------------------------------------
\r
200 #ifndef TSLPRM_PXS_SYNCHRO_EDGE
\r
201 #error "TSLPRM_PXS_SYNCHRO_EDGE is not defined."
\r
204 #if ((TSLPRM_PXS_SYNCHRO_EDGE != 0) && (TSLPRM_PXS_SYNCHRO_EDGE != 1))
\r
205 #error "TSLPRM_PXS_SYNCHRO_EDGE is out of range (0 .. 1)."
\r
208 //------------------------------------------------------------------------------
\r
210 #ifndef TSLPRM_PXS_INACTIVE_TX
\r
211 #error "TSLPRM_PXS_INACTIVE_TX is not defined."
\r
214 #if ((TSLPRM_PXS_INACTIVE_TX != 0) && (TSLPRM_PXS_INACTIVE_TX != 1))
\r
215 #error "TSLPRM_PXS_INACTIVE_TX is out of range (0 .. 1)."
\r
218 //------------------------------------------------------------------------------
\r
220 #ifndef TSLPRM_PXS_INACTIVE_RX
\r
221 #error "TSLPRM_PXS_INACTIVE_RX is not defined."
\r
224 #if ((TSLPRM_PXS_INACTIVE_RX != 0) && (TSLPRM_PXS_INACTIVE_RX != 1))
\r
225 #error "TSLPRM_PXS_INACTIVE_RX is out of range (0 .. 1)."
\r
228 //------------------------------------------------------------------------------
\r
230 #ifndef TSLPRM_PXS_RX_COUPLING
\r
231 #error "TSLPRM_PXS_RX_COUPLING is not defined."
\r
234 #if ((TSLPRM_PXS_RX_COUPLING != 0) && (TSLPRM_PXS_RX_COUPLING != 1))
\r
235 #error "TSLPRM_PXS_RX_COUPLING is out of range (0 .. 1)."
\r
238 //------------------------------------------------------------------------------
\r
240 #ifndef TSLPRM_PXS_STAB
\r
241 #error "TSLPRM_PXS_STAB is not defined."
\r
244 #if ((TSLPRM_PXS_STAB != LONG_STAB) && (TSLPRM_PXS_STAB != MEDIUM_STAB) && (TSLPRM_PXS_STAB != SHORT_STAB))
\r
245 #error "TSLPRM_PXS_STAB is out of range (LONG_STAB, MEDIUM_STAB, SHORT_STAB)."
\r
248 //------------------------------------------------------------------------------
\r
250 #ifndef TSLPRM_PXS_BIAS
\r
251 #error "TSLPRM_PXS_BIAS is not defined."
\r
254 #if ((TSLPRM_PXS_BIAS != HIGH_BIAS) && (TSLPRM_PXS_BIAS != MEDIUM_BIAS) && (TSLPRM_PXS_BIAS != LOW_BIAS) && (TSLPRM_PXS_BIAS != VERY_LOW_BIAS))
\r
255 #error "TSLPRM_PXS_BIAS is out of range (HIGH_BIAS, MEDIUM_BIAS, LOW_BIAS, VERY_LOW_BIAS)."
\r
258 //------------------------------------------------------------------------------
\r
260 #ifndef TSLPRM_HIGH_CHANNEL_NB
\r
261 #error "TSLPRM_HIGH_CHANNEL_NB is not defined."
\r
264 #if ((TSLPRM_HIGH_CHANNEL_NB < 0) || (TSLPRM_HIGH_CHANNEL_NB > __MAX_RX))
\r
265 #error "TSLPRM_HIGH_CHANNEL_NB is out of range (0..9 for STM8TL53C4, 0..7 for STM8TL53G4)."
\r
268 #endif /* __TSL_CHECK_CONFIG_STM8TL5X_H */
\r
270 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r