cy_capsense_processing.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /***************************************************************************//**
  2. * \file cy_capsense_processing.h
  3. * \version 3.0
  4. *
  5. * \brief
  6. * This file provides the function prototypes for the Data Processing module.
  7. * The Data Processing module is responsible for the low level raw counts
  8. * processing provided by the sensing module, maintaining baseline and
  9. * difference values and performing high-level widget processing like updating
  10. * button status or calculating slider position.
  11. *
  12. ********************************************************************************
  13. * \copyright
  14. * Copyright 2018-2021, Cypress Semiconductor Corporation (an Infineon company)
  15. * or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
  16. * You may use this file only in accordance with the license, terms, conditions,
  17. * disclaimers, and limitations in the end user license agreement accompanying
  18. * the software package with which this file was provided.
  19. *******************************************************************************/
  20. #if !defined(CY_CAPSENSE_PROCESSING_H)
  21. #define CY_CAPSENSE_PROCESSING_H
  22. #include "cycfg_capsense_defines.h"
  23. #include "cy_capsense_common.h"
  24. #include "cy_capsense_structure.h"
  25. #include "cy_capsense_lib.h"
  26. #if (defined(CY_IP_MXCSDV2) || defined(CY_IP_M0S8CSDV2) || defined(CY_IP_M0S8MSCV3))
  27. #if defined(__cplusplus)
  28. extern "C" {
  29. #endif
  30. /*******************************************************************************
  31. * Function Prototypes
  32. *******************************************************************************/
  33. /******************************************************************************/
  34. /** \addtogroup group_capsense_high_level *//** \{ */
  35. /******************************************************************************/
  36. #if (CY_CAPSENSE_DISABLE != CY_CAPSENSE_GESTURE_EN)
  37. uint32_t Cy_CapSense_DecodeWidgetGestures(
  38. uint32_t widgetId,
  39. const cy_stc_capsense_context_t * context);
  40. #endif
  41. /** \} */
  42. /******************************************************************************/
  43. /** \addtogroup group_capsense_low_level *//** \{ */
  44. /******************************************************************************/
  45. #if (CY_CAPSENSE_DISABLE != CY_CAPSENSE_GESTURE_EN)
  46. void Cy_CapSense_InitializeWidgetGestures(
  47. uint32_t widgetId,
  48. const cy_stc_capsense_context_t * context);
  49. #endif
  50. void Cy_CapSense_InitializeAllStatuses(const cy_stc_capsense_context_t * context);
  51. void Cy_CapSense_InitializeWidgetStatus(
  52. uint32_t widgetId,
  53. const cy_stc_capsense_context_t * context);
  54. #if (CY_CAPSENSE_PLATFORM_BLOCK_FIFTH_GEN)
  55. #if (CY_CAPSENSE_DISABLE != CY_CAPSENSE_MULTI_PHASE_ENABLED)
  56. cy_capsense_status_t Cy_CapSense_ProcessWidgetMptxDeconvolution(
  57. uint32_t widgetId,
  58. cy_stc_capsense_context_t * context);
  59. #endif
  60. void Cy_CapSense_PreProcessWidget(
  61. uint32_t widgetId,
  62. const cy_stc_capsense_context_t * context);
  63. void Cy_CapSense_PreProcessSensor(
  64. uint32_t widgetId,
  65. uint32_t sensorId,
  66. const cy_stc_capsense_context_t * context);
  67. #if (CY_CAPSENSE_DISABLE != CY_CAPSENSE_MULTI_FREQUENCY_WIDGET_EN)
  68. cy_capsense_status_t Cy_CapSense_RunMfsMedian(
  69. uint32_t widgetId,
  70. const cy_stc_capsense_context_t * context);
  71. #endif
  72. #endif
  73. /** \} */
  74. /******************************************************************************/
  75. /** \cond SECTION_CAPSENSE_INTERNAL */
  76. /** \addtogroup group_capsense_internal *//** \{ */
  77. /******************************************************************************/
  78. #if((CY_CAPSENSE_DISABLE != CY_CAPSENSE_BUTTON_EN) ||\
  79. (CY_CAPSENSE_DISABLE != CY_CAPSENSE_CSX_MATRIX_EN))
  80. void Cy_CapSense_DpProcessButton(
  81. const cy_stc_capsense_widget_config_t * ptrWdConfig);
  82. #endif
  83. #if(CY_CAPSENSE_DISABLE != CY_CAPSENSE_CSX_TOUCHPAD_EN)
  84. void Cy_CapSense_DpProcessCsxTouchpad(
  85. const cy_stc_capsense_widget_config_t * ptrWdConfig);
  86. #endif
  87. #if(CY_CAPSENSE_DISABLE != CY_CAPSENSE_CSD_PROXIMITY_EN)
  88. void Cy_CapSense_DpProcessProximity(
  89. const cy_stc_capsense_widget_config_t * ptrWdConfig);
  90. #endif
  91. #if(CY_CAPSENSE_DISABLE != CY_CAPSENSE_CSD_TOUCHPAD_EN)
  92. void Cy_CapSense_DpProcessCsdTouchpad(
  93. const cy_stc_capsense_widget_config_t * ptrWdConfig,
  94. const cy_stc_capsense_context_t * context);
  95. #endif
  96. #if(CY_CAPSENSE_DISABLE != CY_CAPSENSE_SLIDER_EN)
  97. void Cy_CapSense_DpProcessSlider(
  98. const cy_stc_capsense_widget_config_t * ptrWdConfig);
  99. #endif
  100. #if(CY_CAPSENSE_DISABLE != CY_CAPSENSE_CSD_MATRIX_EN)
  101. void Cy_CapSense_DpProcessCsdMatrix(
  102. const cy_stc_capsense_widget_config_t * ptrWdConfig);
  103. #endif
  104. #if (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSD_EN)
  105. void Cy_CapSense_DpProcessCsdWidgetStatus(
  106. const cy_stc_capsense_widget_config_t * ptrWdConfig,
  107. cy_stc_capsense_context_t * context);
  108. uint32_t Cy_CapSense_DpProcessCsdWidgetRawCounts(
  109. uint32_t widgetId,
  110. const cy_stc_capsense_context_t * context);
  111. uint32_t Cy_CapSense_DpProcessCsdSensorRawCountsExt(
  112. const cy_stc_capsense_widget_config_t * ptrWdConfig,
  113. cy_stc_capsense_sensor_context_t * ptrSnsContext,
  114. uint16_t * ptrSnsRawHistory,
  115. uint8_t * ptrSnsRawHistoryLow,
  116. uint32_t mode,
  117. uint16_t * ptrBslnInvSns,
  118. const cy_stc_capsense_context_t * context);
  119. #endif /* (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSD_EN) */
  120. #if (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSX_EN)
  121. void Cy_CapSense_DpProcessCsxWidgetStatus(
  122. const cy_stc_capsense_widget_config_t * ptrWdConfig);
  123. uint32_t Cy_CapSense_DpProcessCsxWidgetRawCounts(
  124. uint32_t widgetId,
  125. const cy_stc_capsense_context_t * context);
  126. uint32_t Cy_CapSense_DpProcessCsxSensorRawCountsExt(
  127. const cy_stc_capsense_widget_config_t * ptrWdConfig,
  128. cy_stc_capsense_sensor_context_t * ptrSnsContext,
  129. uint16_t * ptrSnsRawHistory,
  130. uint8_t * ptrSnsRawHistoryLow,
  131. uint32_t mode,
  132. uint16_t * ptrSnsBslnInv,
  133. const cy_stc_capsense_context_t * context);
  134. #endif /* (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSX_EN) */
  135. void Cy_CapSense_DpUpdateDifferences(
  136. const cy_stc_capsense_widget_context_t * ptrWdContext,
  137. cy_stc_capsense_sensor_context_t * ptrSnsContext);
  138. void Cy_CapSense_DpUpdateThresholds(
  139. cy_stc_capsense_widget_context_t * ptrWdContext,
  140. const cy_stc_capsense_smartsense_csd_noise_envelope_t * ptrNoiseEnvelope,
  141. uint32_t startFlag);
  142. #if (CY_CAPSENSE_DISABLE != CY_CAPSENSE_MULTI_FREQUENCY_SCAN_EN)
  143. void Cy_CapSense_RunMfsFiltering(
  144. cy_stc_capsense_sensor_context_t * ptrSnsContext,
  145. const cy_stc_capsense_context_t * context);
  146. #endif
  147. #if (CY_CAPSENSE_PLATFORM_BLOCK_FIFTH_GEN)
  148. #if (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSX_EN)
  149. void Cy_CapSense_PreProcessWidgetInvertRaw(
  150. uint32_t widgetId,
  151. const cy_stc_capsense_context_t * context);
  152. void Cy_CapSense_PreProcessSensorInvertRaw(
  153. uint32_t widgetId,
  154. uint32_t sensorId,
  155. const cy_stc_capsense_context_t * context);
  156. #endif /* (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSX_EN) */
  157. void Cy_CapSense_PreProcessWidgetLimitRaw(
  158. uint32_t widgetId,
  159. const cy_stc_capsense_context_t * context);
  160. void Cy_CapSense_PreProcessSensorLimitRaw(
  161. uint32_t widgetId,
  162. uint32_t sensorId,
  163. const cy_stc_capsense_context_t * context);
  164. #if (CY_CAPSENSE_DISABLE != CY_CAPSENSE_CIC2_FILTER_EN)
  165. void Cy_CapSense_PreProcessWidgetCic2Raw(
  166. uint32_t widgetId,
  167. const cy_stc_capsense_context_t * context);
  168. void Cy_CapSense_PreProcessSensorCic2Raw(
  169. uint32_t widgetId,
  170. uint32_t sensorId,
  171. const cy_stc_capsense_context_t * context);
  172. uint32_t Cy_CapSense_GetCIC2HwDivider(
  173. uint32_t cic2Samples);
  174. #endif
  175. #endif /* CY_CAPSENSE_PLATFORM_BLOCK_FIFTH_GEN */
  176. /** \} \endcond */
  177. #if defined(__cplusplus)
  178. }
  179. #endif
  180. #endif /* (defined(CY_IP_MXCSDV2) || defined(CY_IP_M0S8CSDV2) || defined(CY_IP_M0S8MSCV3)) */
  181. #endif /* CY_CAPSENSE_PROCESSING_H */
  182. /* [] END OF FILE */