CapSense Structures

group group_capsense_structures

The CapSense structures.

Typedefs

typedef uint32_t cy_capsense_status_t

Unified return status of CapSense operation:

  • CY_CAPSENSE_STATUS_SUCCESS

  • CY_CAPSENSE_STATUS_BAD_PARAM

  • CY_CAPSENSE_STATUS_BAD_DATA

  • CY_CAPSENSE_STATUS_TIMEOUT

  • CY_CAPSENSE_STATUS_INVALID_STATE

  • CY_CAPSENSE_STATUS_BAD_CONFIG

  • CY_CAPSENSE_STATUS_CONFIG_OVERFLOW

  • CY_CAPSENSE_STATUS_HW_BUSY

  • CY_CAPSENSE_STATUS_UNKNOWN

typedef uint32_t cy_capsense_mw_state_t

Unified return state of CapSense Middleware:

  • CY_CAPSENSE_MW_STATE_READY - No scan is in progress and a next scan frame can be initiated.

  • CY_CAPSENSE_MW_STATE_INITIALIZATION_MASK - Middleware initialization is in progress and a next scan frame can be initiated.

  • CY_CAPSENSE_MW_STATE_SCAN_CHANNEL_MASK[x] - The set [x] bit of the result means that the previously initiated scan for the [x] channel is in progress. The next scan frame cannot be started.

  • CY_CAPSENSE_MW_STATE_CALIBRATION_MASK - The auto-calibration is in progress. The next scan frame cannot be started.

  • CY_CAPSENSE_MW_STATE_VERIFY_CALIBRATION_MASK - The auto-calibration verification is in progress. The next scan frame cannot be started.

  • CY_CAPSENSE_MW_STATE_BIST_MASK - BIST in progress - widget CRC test.

  • CY_CAPSENSE_MW_STATE_SCAN_SLOT_MASK[x] - The set [x] bit of the result means that the previously initiated scan for the [x] slot is in progress. The next scan frame cannot be started.

typedef void (*cy_capsense_callback_t)(cy_stc_active_scan_sns_t *ptrActiveScan)

Provides the typedef for the callback function that is intended to be called when the cy_en_capsense_callback_event_t events occurs.

typedef void (*cy_capsense_ds_init_callback_t)(void *context)

Provides the typedef for the callback function that is called by the Cy_CapSense_Enable() function to change the CapSense configuration from the default configuration to the user’s specific use cases.

Refer to Callbacks section.

note

This callback function is available only for the fifth-generation CapSense.

typedef void (*cy_capsense_tuner_send_callback_t)(void *context)

Provides the typedef for the callback function that is called by the Cy_CapSense_RunTuner() function to establish communication with the CapSense Tuner tool to monitor CapSense operation.

Refer to Callbacks section.

typedef void (*cy_capsense_tuner_receive_callback_t)(uint8_t **commandPacket, uint8_t **tunerPacket, void *context)

Provides the typedef for the callback function that is called by the Cy_CapSense_RunTuner() function to establish communication with the CapSense Tuner tool to support life-time tunning.

Refer to Callbacks section.

typedef void (*cy_func_capsense_csd_setup_widget_ptr_t)(uint32_t widgetId, cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSDSetupWidget() function.

typedef void (*cy_func_capsense_csd_scan_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSDScan() function.

typedef uint32_t (*cy_func_capsense_dp_process_csd_widget_raw_counts_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsdWidgetRawCounts() function.

typedef void (*cy_func_capsense_dp_process_csd_widget_status_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsdWidgetStatus() function.

typedef void (*cy_func_capsense_csd_disable_mode_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSDDisableMode() function.

typedef void (*cy_func_capsense_csd_initialize_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSDInitialize() function.

typedef void (*cy_func_capsense_csd_scan_isr_ptr_t)(void *capsenseContext)

The type of a pointer to the Cy_CapSense_CSDScanISR() function.

typedef void (*cy_func_capsense_csx_setup_widget_ptr_t)(uint32_t widgetId, cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSXSetupWidget() function.

typedef void (*cy_func_capsense_csx_scan_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSXScan() function.

typedef uint32_t (*cy_capsense_dp_process_csx_widget_raw_counts_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsxWidgetRawCounts() function.

typedef void (*cy_func_capsense_dp_process_csx_widget_status_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsxWidgetStatus() function.

typedef void (*cy_func_capsense_csx_initialize_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSXInitialize() function.

typedef void (*cy_func_capsense_csx_disablemode_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSXDisableMode() function.

typedef void (*cy_func_capsense_csx_scan_isr_ptr_t)(void *capsenseContext)

The type of a pointer to the Cy_CapSense_CSXScanISR() function.

typedef void (*cy_func_capsense_adaptive_filter_initialize_lib_ptr_t)(const cy_stc_capsense_adaptive_filter_config_t *config, cy_stc_capsense_position_t *context)

The type of a pointer to the Cy_CapSense_AdaptiveFilterInitialize_Lib() function.

typedef void (*cy_func_capsense_adaptive_filter_run_lib_ptr_t)(const cy_stc_capsense_adaptive_filter_config_t *config, cy_stc_capsense_position_t *context, uint32_t *currentX, uint32_t *currentY)

The type of a pointer to the Cy_CapSense_AdaptiveFilterRun_Lib() function.

typedef void (*cy_func_capsense_ballistic_multiplier_lib_ptr_t)(const cy_stc_capsense_ballistic_config_t *config, const cy_stc_capsense_touch_t *touch, cy_stc_capsense_ballistic_delta_t *delta, uint32_t timestamp, cy_stc_capsense_ballistic_context_t *context)

The type of a pointer to the Cy_CapSense_BallisticMultiplier_Lib() function.

typedef void (*cy_func_capsense_initialize_all_filters_ptr_t)(const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_InitializeAllFilters() function.

typedef void (*cy_func_capsense_ft_run_enabled_filters_internal_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, cy_stc_capsense_sensor_context_t *ptrSnsContext, uint16_t *ptrSnsRawHistory, uint8_t *ptrSnsRawHistoryLow)

The type of a pointer to the Cy_CapSense_FtRunEnabledFiltersInternal() function.

typedef void (*cy_func_capsense_process_position_filters_ptr_t)(cy_stc_capsense_touch_t *newTouch, const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_ProcessPositionFilters() function.

typedef void (*cy_func_capsense_run_position_filters_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, cy_stc_capsense_position_t *ptrInput, cy_stc_capsense_position_t *ptrHistory, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_RunPositionFilters() function.

typedef void (*cy_func_capsense_init_position_filters_ptr_t)(uint32_t filterConfig, const cy_stc_capsense_position_t *ptrInput, cy_stc_capsense_position_t *ptrHistory)

The type of a pointer to the Cy_CapSense_InitPositionFilters() function.

typedef void (*cy_func_capsense_dp_process_button_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessButton() function.

typedef void (*cy_func_capsense_dp_process_slider_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessSlider() function.

typedef void (*cy_func_capsense_dp_process_csd_matrix_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsdMatrix() function.

typedef void (*cy_func_capsense_dp_process_csd_touchpad_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsdTouchpad() function.

typedef void (*cy_func_capsense_dp_advanced_centroid_touchpad_ptr_t)(cy_stc_capsense_touch_t *newTouch, const cy_stc_capsense_widget_config_t *ptrWdConfig)

The type of a pointer to the Cy_CapSense_DpAdvancedCentroidTouchpad() function.

typedef void (*cy_func_capsense_dp_process_proximity_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig)

The type of a pointer to the Cy_CapSense_DpProcessProximity() function.

typedef void (*cy_func_capsense_dp_process_csx_touchpad_ptr_t)(const cy_stc_capsense_widget_config_t *ptrWdConfig, const cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_DpProcessCsxTouchpad() function.

typedef cy_capsense_status_t (*cy_func_capsense_calibrate_all_csd_widgets_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CalibrateAllCsdWidgets() function.

typedef cy_capsense_status_t (*cy_func_capsense_csd_calibrate_widget_ptr_t)(uint32_t widgetId, uint32_t target, cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CSDCalibrateWidget() function.

typedef cy_capsense_status_t (*cy_func_capsense_calibrate_all_csx_widgets_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_CalibrateAllCsxWidgets() function.

typedef cy_capsense_status_t (*cy_func_capsense_ss_auto_tune_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_SsAutoTune() function.

typedef void (*cy_func_capsense_run_noise_envelope_lib_ptr_t)(uint16_t rawCount, uint16_t sigPFC, cy_stc_capsense_smartsense_csd_noise_envelope_t *ptrNoiseEnvelope)

The type of a pointer to the Cy_CapSense_RunNoiseEnvelope_Lib() function.

typedef void (*cy_func_capsense_dp_update_thresholds_ptr_t)(cy_stc_capsense_widget_context_t *ptrWdContext, const cy_stc_capsense_smartsense_csd_noise_envelope_t *ptrNoiseEnvelope, uint32_t startFlag)

The type of a pointer to the Cy_CapSense_DpUpdateThresholds() function.

typedef void (*cy_func_capsense_initialize_noise_envelope_lib_ptr_t)(uint16_t rawCount, uint16_t sigPFC, cy_stc_capsense_smartsense_csd_noise_envelope_t *ptrNoiseEnvelope)

The type of a pointer to the Cy_CapSense_InitializeNoiseEnvelope_Lib() function.

typedef void (*cy_func_capsense_bist_initialize_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_BistInitialize() function.

typedef void (*cy_func_capsense_bist_disable_mode_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_BistDisableMode() function.

typedef void (*cy_func_capsense_bist_ds_initialize_ptr_t)(cy_stc_capsense_context_t *context)

The type of a pointer to the Cy_CapSense_BistDsInitialize() function.

struct cy_stc_capsense_adaptive_filter_config_t
#include <cy_capsense_lib.h>

Declares Adaptive Filter configuration parameters.

struct cy_stc_capsense_advanced_centroid_config_t
#include <cy_capsense_lib.h>

Declares Advanced Centroid configuration parameters.

struct cy_stc_capsense_position_t
#include <cy_capsense_lib.h>

Declares position structure that keep information of a single touch.

Depending on a widget type each structure field keeps the following information:

Structure Field

Slider

Matrix Buttons

CSD Touchpad

CSX Touchpad

x

X-axis position

Active Column

X-axis position

X-axis position

y

Reserved

Active Row

Y-axis position

Y-axis position

z

Reserved

Reserved

Reserved

MSB = Age of touch; LSB = Z-value

id

Reserved

Logical number of button

Reserved

MSB = Debounce; LSB = touch ID

struct cy_stc_capsense_touch_t
#include <cy_capsense_lib.h>

Declares touch structure used to store positions of Touchpad, Matrix buttons and Slider widgets.

struct cy_stc_capsense_auto_tune_config_t
#include <cy_capsense_lib.h>

Declares HW SmartSense data structure for CSD widgets for fourth-generation CapSense.

struct cy_stc_capsense_hw_smartsense_config_t
#include <cy_capsense_lib.h>

Declares HW SmartSense data structure for CSD widgets for fifth-generation CapSense.

struct cy_stc_capsense_smartsense_csd_noise_envelope_t
#include <cy_capsense_lib.h>

Declares Noise envelope data structure for CSD widgets when SmartSense is enabled.

struct cy_stc_capsense_smartsense_update_thresholds_t
#include <cy_capsense_lib.h>

Declares Update Thresholds structure.

struct cy_stc_capsense_ballistic_config_t
#include <cy_capsense_lib.h>

Declares Ballistics Multiplier Configuration data structure.

struct cy_stc_capsense_ballistic_context_t
#include <cy_capsense_lib.h>

Declares Ballistics Multiplier Configuration data structure.

struct cy_stc_capsense_ballistic_delta_t
#include <cy_capsense_lib.h>

Declares Ballistic Displacement structure.

struct cy_stc_capsense_sensor_context_t
#include <cy_capsense_structure.h>

Sensor context structure.

struct cy_stc_capsense_csx_touch_history_t
#include <cy_capsense_structure.h>

CSX Touchpad touch tracking history.

struct cy_stc_capsense_csx_touch_buffer_t
#include <cy_capsense_structure.h>

Internal CSX Touchpad buffer structure for CSX for Touchpads’ processing.

struct cy_stc_capsense_widget_context_t
#include <cy_capsense_structure.h>

Widget context structure.

struct cy_stc_capsense_pin_config_t
#include <cy_capsense_structure.h>

Legacy mode pin configuration structure.

struct cy_stc_capsense_electrode_config_t
#include <cy_capsense_structure.h>

Electrode objects configuration structure.

struct cy_stc_capsense_advanced_touchpad_config_t
#include <cy_capsense_structure.h>

Configuration structure of advanced touchpad.

struct cy_stc_capsense_mptx_table_t
#include <cy_capsense_structure.h>

Multi-phase TX table for de-convolution structure.

note

This structure is available only for the fifth-generation CapSense.

struct cy_stc_capsense_widget_config_t
#include <cy_capsense_structure.h>

Widget configuration structure.

struct cy_stc_capsense_idac_gain_table_t
#include <cy_capsense_structure.h>

Declares the IDAC gain table.

note

This structure is available only for the fourth-generation CapSense.

struct cy_stc_capsense_scan_slot_t
#include <cy_capsense_structure.h>

Declares the scan order of widget and sensor.

note

This structure is available only for the fifth-generation CapSense.

struct cy_stc_msc_channel_config_t
#include <cy_capsense_structure.h>

Declares MSC channel (HW block) configuration.

note

This structure is available only for the fifth-generation CapSense.

struct cy_stc_capsense_common_config_t
#include <cy_capsense_structure.h>

Common configuration structure.

struct cy_stc_capsense_bist_context_t
#include <cy_capsense_structure.h>

Declares BIST Context Data Structure.

note

This structure is available only for the fourth-generation CapSense.

struct cy_stc_capsense_bist_custom_parameters_t
#include <cy_capsense_structure.h>

Declares the BIST structure with custom scan parameters.

note

This structure is available only for the fourth-generation CapSense.

struct cy_stc_active_scan_sns_t
#include <cy_capsense_structure.h>

Declares active sensor details.

note

This structure is available only for the fourth-generation CapSense.

struct cy_stc_capsense_internal_context_t
#include <cy_capsense_structure.h>

Declares internal Context Data Structure.

struct cy_stc_capsense_widget_crc_data_t
#include <cy_capsense_structure.h>

Declares the structure that is intended to store the cy_stc_capsense_widget_context_t data structure fields, the CRC checking should be applied for.

note

This structure is available only for the fourth-generation CapSense.

struct cy_stc_capsense_common_context_t
#include <cy_capsense_structure.h>

Declares top-level Context Data Structure.

struct cy_stc_capsense_context_t
#include <cy_capsense_structure.h>

Declares top-level CapSense context data structure.

struct cy_stc_capsense_fptr_config_t
#include <cy_capsense_structure.h>

Function pointers configuration structure.