]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/ST_Code/Libraries/STMTouch_Driver/inc/tsl_touchkey.h
Remove unused files from STM32L discovery board demo directory structure and build.
[freertos] / FreeRTOS / Demo / CORTEX_STM32L152_Discovery_IAR / ST_Code / Libraries / STMTouch_Driver / inc / tsl_touchkey.h
1 /**\r
2   ******************************************************************************\r
3   * @file    tsl_touchkey.h\r
4   * @author  MCD Application Team\r
5   * @version V1.3.2\r
6   * @date    22-January-2013\r
7   * @brief   This file contains external declarations of the tsl_touchkey.c file.\r
8   ******************************************************************************\r
9   * @attention\r
10   *\r
11   * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>\r
12   *\r
13   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");\r
14   * You may not use this file except in compliance with the License.\r
15   * You may obtain a copy of the License at:\r
16   *\r
17   *        http://www.st.com/software_license_agreement_liberty_v2\r
18   *\r
19   * Unless required by applicable law or agreed to in writing, software\r
20   * distributed under the License is distributed on an "AS IS" BASIS,\r
21   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
22   * See the License for the specific language governing permissions and\r
23   * limitations under the License.\r
24   *\r
25   ******************************************************************************\r
26   */\r
27 \r
28 /* Define to prevent recursive inclusion -------------------------------------*/\r
29 #ifndef __TSL_TOUCHKEY_H\r
30 #define __TSL_TOUCHKEY_H\r
31 \r
32 /* Includes ------------------------------------------------------------------*/\r
33 #include "tsl_acq.h"\r
34 #include "tsl_time.h"\r
35 \r
36 /* Exported types ------------------------------------------------------------*/\r
37 \r
38 /** Contains all data related to TouchKey sensor.\r
39   * Variables of this structure type must be placed in RAM only.\r
40   */\r
41 typedef struct\r
42 {\r
43   TSL_StateId_enum_T StateId; /**< Current state identifier */\r
44   unsigned int Counter : 6; /**< Generic counter for debounce, calibration & DTO */\r
45   unsigned int Change  : 1; /**< The State is different from the previous one (TSL_StateChange_enum_T) */\r
46   unsigned int DxSLock : 1; /**< The State is locked by the DxS (TSL_Bool_enum_T) */\r
47 }\r
48 TSL_TouchKeyData_T;\r
49 \r
50 /** Contains all parameters related to TouchKey sensor.\r
51   * Variables of this structure type can be placed in RAM or ROM.\r
52   */\r
53 typedef struct\r
54 {\r
55 #if TSLPRM_USE_PROX > 0\r
56   TSL_tThreshold_T  ProxInTh;          /**< Proximity in threshold */\r
57   TSL_tThreshold_T  ProxOutTh;         /**< Proximity out threshold */\r
58 #endif\r
59   TSL_tThreshold_T  DetectInTh;        /**< Detection in threshold */\r
60   TSL_tThreshold_T  DetectOutTh;       /**< Detection out threshold */\r
61   TSL_tThreshold_T  CalibTh;           /**< Calibration threshold */\r
62   TSL_tCounter_T    CounterDebCalib;   /**< Debounce counter to enter in Calibration state */\r
63 #if TSLPRM_USE_PROX > 0\r
64   TSL_tCounter_T    CounterDebProx;    /**< Debounce counter to enter in Proximity state */\r
65 #endif\r
66   TSL_tCounter_T    CounterDebDetect;  /**< Debounce counter to enter in Detect state */\r
67   TSL_tCounter_T    CounterDebRelease; /**< Debounce counter to enter in Release state */\r
68   TSL_tCounter_T    CounterDebError;   /**< Debounce counter to enter in Error state */\r
69 }\r
70 TSL_TouchKeyParam_T;\r
71 \r
72 /** Contains definition of a TouchKey sensor.\r
73   * Variables of this structure type can be placed in RAM or ROM.\r
74   */\r
75 typedef struct\r
76 {\r
77   TSL_TouchKeyData_T          *p_Data;    /**< Data (state id, counter, flags, ...) */\r
78   TSL_TouchKeyParam_T         *p_Param;   /**< Parameters (thresholds, debounce, ...) */\r
79   TSL_ChannelData_T           *p_ChD;     /**< Channel Data (Meas, Ref, Delta, ...) */\r
80   CONST TSL_State_T           *p_SM;      /**< State Machine */\r
81   CONST TSL_TouchKeyMethods_T *p_Methods; /**< Methods */\r
82 }\r
83 TSL_TouchKey_T;\r
84 \r
85 /** Contains definition of a Basic TouchKey sensor.\r
86   * Variables of this structure type can be placed in RAM or ROM.\r
87   * Basic sensor does not contain its own state machine and methods. It used\r
88   * default ones instead to gain memory space.\r
89   */\r
90 typedef struct\r
91 {\r
92   TSL_TouchKeyData_T          *p_Data;    /**< Data (state id, counter, flags, ...) */\r
93   TSL_TouchKeyParam_T         *p_Param;   /**< Parameters (thresholds, debounce, ...) */\r
94   TSL_ChannelData_T           *p_ChD;     /**< Channel Data (Meas, Ref, Delta, ...) */\r
95 }\r
96 TSL_TouchKeyB_T;\r
97 \r
98 /* Exported variables --------------------------------------------------------*/\r
99 /* Exported macros -----------------------------------------------------------*/\r
100 \r
101 /* Exported functions --------------------------------------------------------*/\r
102 \r
103 // "Object methods" functions\r
104 void TSL_tkey_Init(void);\r
105 void TSL_tkey_Process(void);\r
106 \r
107 // Utility functions\r
108 void TSL_tkey_SetStateCalibration(TSL_tCounter_T delay);\r
109 void TSL_tkey_SetStateOff(void);\r
110 #if !defined(TSLPRM_STM8TL5X) && !defined(STM8TL5X)\r
111 void TSL_tkey_SetStateBurstOnly(void);\r
112 #endif\r
113 TSL_StateId_enum_T TSL_tkey_GetStateId(void);\r
114 TSL_StateMask_enum_T TSL_tkey_GetStateMask(void);\r
115 TSL_tNb_T TSL_tkey_IsChanged(void);\r
116 \r
117 // State machine functions\r
118 void TSL_tkey_CalibrationStateProcess(void);\r
119 void TSL_tkey_DebCalibrationStateProcess(void);\r
120 void TSL_tkey_ReleaseStateProcess(void);\r
121 void TSL_tkey_DebReleaseProxStateProcess(void);\r
122 void TSL_tkey_DebReleaseDetectStateProcess(void);\r
123 void TSL_tkey_DebReleaseTouchStateProcess(void);\r
124 void TSL_tkey_ProxStateProcess(void);\r
125 void TSL_tkey_DebProxStateProcess(void);\r
126 void TSL_tkey_DebProxDetectStateProcess(void);\r
127 void TSL_tkey_DebProxTouchStateProcess(void);\r
128 void TSL_tkey_DetectStateProcess(void);\r
129 void TSL_tkey_DebDetectStateProcess(void);\r
130 void TSL_tkey_TouchStateProcess(void);\r
131 void TSL_tkey_DebTouchStateProcess(void);\r
132 void TSL_tkey_ErrorStateProcess(void);\r
133 void TSL_tkey_DebErrorStateProcess(void);\r
134 void TSL_tkey_OffStateProcess(void);\r
135 \r
136 #endif /* __TSL_TOUCHKEY_H */\r
137 \r
138 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r