Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tsl_globals.h « inc « STM32_TouchSensing_Library « ST « Middlewares - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 65e45d328bad756424e54c1841a5c0c60cfad8af (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
/**
  ******************************************************************************
  * @file    tsl_globals.h
  * @author  MCD Application Team
  * @brief   This file contains external declarations of the tsl_globals.c file.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
  ******************************************************************************
  */

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

/* Includes ------------------------------------------------------------------*/
#include "tsl_acq.h"
#include "tsl_object.h"

/* Exported types ------------------------------------------------------------*/

/** Store all global variables shared between the STMTouch Driver and the Application.
  */
typedef struct
{
  TSL_tTick_ms_T       Tick_ms;     /**< Incremented each 0.5ms by timing interrupt routine */
  TSL_tTick_sec_T      Tick_sec;    /**< Incremented each second by timing interrupt routine */
  CONST TSL_Bank_T     *Bank_Array; /**< Pointer to the array containing all Banks */
  TSL_tIndex_T         This_Bank;   /**< Pointer to the current Bank */
  CONST TSL_Object_T   *This_Obj;   /**< Pointer to the current Object */
  uint32_t             DelayDischarge; /**< Delay used to discharge all capacitors */
#if TSLPRM_TOTAL_TKEYS > 0
  CONST TSL_TouchKey_T *This_TKey; /**< Pointer to the current TKey */
#endif
#if TSLPRM_TOTAL_LNRTS > 0
  CONST TSL_LinRot_T   *This_LinRot; /**< Pointer to the current Linear or Rotary sensor */
#endif
}
TSL_Globals_T;

/** Store all global parametersshared between the STMTouch Driver and the Application .
  @warning Only one variable of this structure type must be created and be placed
  in RAM only.
  */
typedef struct
{
  TSL_tMeas_T       AcqMin;         /**< Acquisition minimum limit */
  TSL_tMeas_T       AcqMax;         /**< Acquisition maximum limit */
  TSL_tNb_T         NbCalibSamples; /**< Number of Calibration samples */
  TSL_tTick_sec_T   DTO;            /**< Detection Time Out */
#if TSLPRM_TOTAL_TKEYS > 0
  CONST TSL_State_T           *p_TKeySM; /**< Default state machine for TouchKey sensors */
  CONST TSL_TouchKeyMethods_T *p_TKeyMT; /**< Default methods for TouchKey sensors */
#endif
#if TSLPRM_TOTAL_LNRTS > 0
  CONST TSL_State_T         *p_LinRotSM; /**< Default state machine for Linear/Rotary sensors */
  CONST TSL_LinRotMethods_T *p_LinRotMT; /**< Default methods for Linear/Rotary sensors */
#endif
}
TSL_Params_T;

/* Exported variables --------------------------------------------------------*/
extern TSL_Globals_T TSL_Globals;
extern TSL_Params_T TSL_Params;

#endif /* __TSL_GLOBALS_H */

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