]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32L152_Discovery_IAR/ST_Code/Libraries/STMTouch_Driver/inc/tsl_object.h
Add STM32L Discovery board project as a starting point to adapt to an RTOS demo.
[freertos] / FreeRTOS / Demo / CORTEX_STM32L152_Discovery_IAR / ST_Code / Libraries / STMTouch_Driver / inc / tsl_object.h
1 /**\r
2   ******************************************************************************\r
3   * @file    tsl_object.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_object.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_OBJECT_H\r
30 #define __TSL_OBJECT_H\r
31 \r
32 /* Includes ------------------------------------------------------------------*/\r
33 #include "tsl_touchkey.h"\r
34 #include "tsl_linrot.h"\r
35 \r
36 /* Exported types ------------------------------------------------------------*/\r
37 \r
38 #define TSL_OBJ_TYPE_TKEY_MASK     (0x10) /**< TouchKey object mask */\r
39 #define TSL_OBJ_TYPE_LINROT_MASK   (0x20) /**< Linear and Rotary objects mask */\r
40 #define TSL_OBJ_TYPE_TRACKNAV_MASK (0x40) /**< TrackPad and NaviPad objects mask */\r
41 \r
42 /** Contains all different kinds of sensors.\r
43   */\r
44 typedef enum\r
45 {\r
46   TSL_OBJ_TOUCHKEY   = (TSL_OBJ_TYPE_TKEY_MASK + 0),     /**< Normal TouchKey */\r
47   TSL_OBJ_TOUCHKEYB  = (TSL_OBJ_TYPE_TKEY_MASK + 1),     /**< Basic TouchKey */\r
48   TSL_OBJ_LINEAR     = (TSL_OBJ_TYPE_LINROT_MASK + 0),   /**< Normal Linear sensor */\r
49   TSL_OBJ_LINEARB    = (TSL_OBJ_TYPE_LINROT_MASK + 1),   /**< Basic Linear sensor */\r
50   TSL_OBJ_ROTARY     = (TSL_OBJ_TYPE_LINROT_MASK + 2),   /**< Normal Rotary sensor */\r
51   TSL_OBJ_ROTARYB    = (TSL_OBJ_TYPE_LINROT_MASK + 3),   /**< Basic Rotary sensor */\r
52   TSL_OBJ_TRACKPAD   = (TSL_OBJ_TYPE_TRACKNAV_MASK + 0), /**< TrackPad sensor */\r
53   TSL_OBJ_NAVIPAD    = (TSL_OBJ_TYPE_TRACKNAV_MASK + 1)  /**< NaviPad sensor */\r
54 }\r
55 TSL_ObjectType_enum_T;\r
56 \r
57 /** Contains the definition of an Object.\r
58   * Variables of this structure type can be placed in RAM or ROM.\r
59   */\r
60 typedef struct\r
61 {\r
62   TSL_ObjectType_enum_T  Type; /**< Object type */\r
63   void *Elmt;                  /**< Pointer to the object  */\r
64 }\r
65 TSL_Object_T;\r
66 \r
67 /** Contains the definition of a Group of Objects.\r
68   * Variables of this structure type must be placed in RAM only.\r
69   */\r
70 typedef struct\r
71 {\r
72   CONST TSL_Object_T     *p_Obj;    /**< Pointer to the first object */\r
73   TSL_tNb_T              NbObjects; /**< Number of objects in the group */\r
74   TSL_tNb_T              StateMask; /**< "OR" of all objects state mask */\r
75   TSL_StateChange_enum_T Change;    /**< The State is different from the previous one */\r
76 }\r
77 TSL_ObjectGroup_T;\r
78 \r
79 /* Exported functions --------------------------------------------------------*/\r
80 \r
81 void TSL_obj_GroupInit(TSL_ObjectGroup_T *objgrp);\r
82 void TSL_obj_GroupProcess(TSL_ObjectGroup_T *objgrp);\r
83 void TSL_obj_SetGlobalObj(CONST TSL_Object_T *pobj);\r
84 \r
85 #endif /* __TSL_OBJECT_H */\r
86 \r
87 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r