tsc.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*!
  2. * @file tsc.h
  3. *
  4. * @brief This file contains external declarations of the tsc.c file.
  5. *
  6. * @version V1.0.1
  7. *
  8. * @date 2022-09-20
  9. *
  10. * @attention
  11. *
  12. * Copyright (C) 2020-2022 Geehy Semiconductor
  13. *
  14. * You may not use this file except in compliance with the
  15. * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
  16. *
  17. * The program is only for reference, which is distributed in the hope
  18. * that it will be useful and instructional for customers to develop
  19. * their software. Unless required by applicable law or agreed to in
  20. * writing, the program is distributed on an "AS IS" BASIS, WITHOUT
  21. * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
  23. * and limitations under the License.
  24. */
  25. /* Define to prevent recursive inclusion */
  26. #ifndef __TSC_H
  27. #define __TSC_H
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /* Includes */
  32. #include "tsc_acq.h"
  33. #include "tsc_time.h"
  34. #include "tsc_touchkey.h"
  35. #include "tsc_linrot.h"
  36. #include "tsc_object.h"
  37. #include "tsc_dxs.h"
  38. #include "tsc_ecs.h"
  39. #include "tsc_filter.h"
  40. /** @addtogroup TSC_Driver_Library TSC Driver Library
  41. @{
  42. */
  43. /** @addtogroup TSC_Driver TSC Driver
  44. @{
  45. */
  46. /** @defgroup TSC_Macros Macros
  47. @{
  48. */
  49. /**@} end of group TSC_Macros */
  50. /** @defgroup TSC_Enumerations Enumerations
  51. @{
  52. */
  53. /**@} end of group TSC_Enumerations */
  54. /** @defgroup TSC_Structures Structures
  55. @{
  56. */
  57. /**
  58. * @brief Store all global variables shared between the Touch Driver and the Application.
  59. */
  60. typedef struct
  61. {
  62. TSC_tTick_ms_T Tick_ms; /*!< Incremented each 0.5ms by timing interrupt routine */
  63. TSC_tTick_sec_T Tick_sec; /*!< Incremented each second by timing interrupt routine */
  64. CONST TSC_Block_T* Block_Array; /*!< Pointer to the array containing all Blocks */
  65. TSC_tIndex_T For_Block; /*!< Pointer to the current Block */
  66. CONST TSC_Object_T* For_Obj; /*!< Pointer to the current Object */
  67. #if TOUCH_USE_ZONE > 0
  68. CONST TSC_Zone_T* For_Zone; /*!< Pointer to the current Zone */
  69. TSC_tIndex_T Index_For_Zone; /*!< Index in the current Zone */
  70. #endif
  71. #if TOUCH_TOTAL_KEYS > 0
  72. CONST TSC_TouchKey_T* For_Key; /*!< Pointer to the current Touch Key */
  73. #endif
  74. #if TOUCH_TOTAL_LNRTS > 0
  75. CONST TSC_LinRot_T* For_LinRot; /*!< Pointer to the current Linear or Rotary sensor */
  76. #endif
  77. } TSC_Globals_T;
  78. /**
  79. * @brief Store all global parametersshared between the Touch Driver and the Application.
  80. * @warning Only one variable of this structure type must be created and be placed in RAM only.
  81. */
  82. typedef struct
  83. {
  84. TSC_tMeas_T AcqMin; /*!< Acquisition minimum limit */
  85. TSC_tMeas_T AcqMax; /*!< Acquisition maximum limit */
  86. TSC_tNum_T NumCalibSample; /*!< Number of Calibration samples */
  87. TSC_tTick_sec_T DTO; /*!< Detection Time Out */
  88. #if TOUCH_TOTAL_KEYS > 0
  89. CONST TSC_State_T* p_KeySta; /*!< Default state machine for TouchKey sensors */
  90. CONST TSC_TouchKeyMethods_T* p_KeyMet; /*!< Default methods for TouchKey sensors */
  91. #endif
  92. #if TOUCH_TOTAL_LNRTS > 0
  93. CONST TSC_State_T* p_LinRotSta; /*!< Default state machine for Linear/Rotary sensors */
  94. CONST TSC_LinRotMethods_T* p_LinRotMet; /*!< Default methods for Linear/Rotary sensors */
  95. #endif
  96. } TSC_Params_T;
  97. /**@} end of group TSC_Structures */
  98. /** @defgroup TSC_Variables Variables
  99. @{
  100. */
  101. extern TSC_Globals_T TSC_Globals;
  102. extern TSC_Params_T TSC_Params;
  103. /**@} end of group TSC_Variables */
  104. /** @defgroup TSC_Functions Functions
  105. @{
  106. */
  107. TSC_STATUS_T TSC_Config(CONST TSC_Block_T* block);
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111. #endif /* __TSC_H */
  112. /**@} end of group TSC_Functions */
  113. /**@} end of group TSC_Driver */
  114. /**@} end of group TSC_Driver_Library */