summaryrefslogtreecommitdiff
path: root/Libraries/TouchSense/tsl_user.h
blob: cbf5d34ee491af7ab91e0f5176e44da177c0e879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
  ******************************************************************************
  * @file    STM32F072B_Ex01_2TKeys_EVAL\inc\tsl_user.h
  * @author  MCD Application Team
  * @version V1.1.0
  * @date    04-April-2014
  * @brief   Touch-Sensing user configuration and api file.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __TSL_USER_H
#define __TSL_USER_H

#include "tsl.h"

//==============================================================================
//                             U S E R    S E T T I N G S
//==============================================================================

// Select to use or not the LCD (0=No, 1=Yes)
// Warning: the usage of LCD slows down the touch-sensing reactivity observed on the LEDs
#define USE_LCD (0)

// STMStudio software usage (0=No, 1=Yes)
// Warning: The low-power mode must be disabled when STMStudio is used.
#define USE_STMSTUDIO (0)

//==============================================================================


#if USE_STMSTUDIO > 0
#include "stmCriticalSection.h"
#define STMSTUDIO_LOCK {enterLock();}
#define STMSTUDIO_UNLOCK {exitLock();}
#else
#define STMSTUDIO_LOCK
#define STMSTUDIO_UNLOCK
#endif

//=======================
// Channel IOs definition
//=======================

#define CHANNEL_0_IO_MSK    (TSL_GROUP1_IO3)
#define CHANNEL_0_GRP_MSK   (TSL_GROUP1)
#define CHANNEL_0_SRC       (0) // Index in source register (TSC->IOGXCR[])
#define CHANNEL_0_DEST      (0) // Index in destination result array

#define CHANNEL_1_IO_MSK    (TSL_GROUP5_IO1)
#define CHANNEL_1_GRP_MSK   (TSL_GROUP5)
#define CHANNEL_1_SRC       (4) // Index in source register (TSC->IOGXCR[])
#define CHANNEL_1_DEST      (1) // Index in destination result array

//======================
// Shield IOs definition
//======================

//#define SHIELD_IO_MSK       (TSL_GROUP4_IO1)

//=================
// Banks definition
//=================

#define BANK_0_NBCHANNELS    (1)
#define BANK_0_MSK_CHANNELS  (CHANNEL_0_IO_MSK)
#define BANK_0_MSK_GROUPS    (CHANNEL_0_GRP_MSK) // Only these groups will be acquired

#define BANK_1_NBCHANNELS    (1)
#define BANK_1_MSK_CHANNELS  (CHANNEL_1_IO_MSK)
#define BANK_1_MSK_GROUPS    (CHANNEL_1_GRP_MSK) // Only these groups will be acquired

// User Parameters
extern CONST TSL_Bank_T MyBanks[];
extern CONST TSL_TouchKey_T MyTKeys[];
extern CONST TSL_Object_T MyObjects[];
extern TSL_ObjectGroup_T MyObjGroup;

void TSL_user_Init(void);
TSL_Status_enum_T TSL_user_Action(void);
void TSL_user_SetThresholds(void);

#endif /* __TSL_USER_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/