CapSense is a Cypress capacitive sensing solution. Capacitive sensing can be used in a variety of applications and products where conventional mechanical buttons can be replaced with sleek human interfaces to transform the way users interact with electronic systems. These include home appliances, and automotive, IoT, and industrial applications. CapSense supports multiple interfaces (widgets) using both CSX and CSD sensing methods with robust performance.
CapSense has become a popular technology to replace conventional mechanical- and optical-based user interfaces. There are fewer parts involved, which saves cost and increases reliability with no wear-and-tear. The main advantages of CapSense compared with other solutions are: robust performance in harsh environmental conditions and rejection of a wide range of external noise sources.
Use CapSense for:
The CSD HW block enables multiple sensing capabilities on PSoC devices including self-cap and mutual-cap capacitive touch sensing solution, a 10-bit ADC, IDAC, and Comparator. The CSD driver is a low-level peripheral driver, a wrapper to manage access to the CSD HW block. Each middleware access to the CSD HW block is through the CSD Driver.
The CSD HW block can support only one function at a time. However, all supported functionality (like CapSense, ADC, etc.) can be time-multiplexed in a design. I.e. you can save the existing state of the CapSense middleware, restore the state of the ADC middleware, perform ADC measurements, and then switch back to the CapSense functionality. For more details and code examples refer to the description of the Cy_CapSense_Save() and Cy_CapSense_Restore() functions.
This section describes only CapSense middleware. Refer to the corresponding sections for documentation of other middleware supported by the CSD HW block.
A CapSense solution includes:
Include cy_capsense.h to get access to all functions and other declarations in this library. If you are using the ModusToolbox CapSense Configurator tool, you can include cycfg_capsense.h only.
The CapSense operates on the top of the CapSense Sigma Delta (CSD) driver. Refer to the PDL API Reference Manual.
This document provides descriptions of the functions in the CapSense middleware library, and descriptions of the data structures (register map) used by the middleware library.
The Application Programming Interface (API) routines allow controlling and executing specific tasks using the CapSense middleware. The CapSense API is described in the following sections:
MISRA Rule | Rule Class (Required/Advisory) | Rule Description | Description of Deviation(s) |
---|---|---|---|
11.4 | A | A conversion should not be performed between a pointer to object and an integer type. | Such conversion is performed with CapSense context in two cases: interrupt handler and DeepSleepCallback function. Both cases are verified on correct operation. |
12.13 | A | The increment (++) and decrement (–) operators should not be mixed with other operators in an expression. | These violations are reported for the GCC ARM optimized form of the "for" loop that have the following syntax: for(index = COUNT; index –> 0u;) It is used to improve performance. |
1.2 | R | Constant: Dereference of NULL pointer. | These violations are reported as a result of using of offset macros of CSD Driver with corresponding documented violation 20.6. Refer to CSD Driver API Ref Guide. |
20.3 |
Important information about the CapSense-technology overview, appropriate Cypress device for the design, CapSense system and sensor design guidelines, different interfaces and tuning guidelines necessary for a successful design of a CapSense system is available in the Getting Started with CapSense document and the product-specific CapSense design guide. Cypress highly recommends starting with these documents. They can be found on the Cypress web site at www.cypress.com. For details about application notes, code examples, and kits, see the References section in this datasheet.
For more information, refer to the following documents:
Version | Changes | Reason for Change |
---|---|---|
1.20 | Added ARMC6 compiler support | Feature enhancement |
Changed the hierarchy of the binary files folders | MBED OS compatibility | |
1.1 | The following functions made obsolete:
Two simple functions introduced to replace the listed above functions: | User experience improvement |
Fixed the shield operation when Csh is disabled | Defect fixing | |
Fixed the implementation of the position filtering for the Radial Slider widget | Defect fixing | |
Added restoring hardware to its default state in the Cy_CapSense_DeInit() implementation | Defect fixing | |
Added the capability to enable the shield electrode without dedicated electrodes | Feature enhancement | |
Added support of a protocol-agnostic tuner interface (UART, SPI, etc.) | Feature enhancement | |
1.0 | The initial version |