CY8CKIT-040 PSoC
®
4000 Pioneer Kit Guide, Doc. # 001-91316 Rev. *F
65
Code Examples
void CapSense_ScanWidget(uint32
widget)
The API sets the CapSense block settings for the selected widget and
starts scanning the widget.
It can be used if scanning of only an individual widget is desired.
void CapSense_ScanSensor(uint32
sensor)
The API scans the selected sensor. After scanning is complete, the ISR
copies the measured sensor raw data to the CapSense_Sensor-
Raw[sensor] array element.
It can be used to perform individual sensor scanning.
uint32 CapSense_IsBusy(void)
The API returns the status of sensor scanning.
After calling any of the scan APIs, this API can be used to check
whether the triggered scan is complete.
Returns
‘1’ if scan is in progress
‘0’ if scan is complete
void CapSense_UpdateSensor-
Baseline(uint32 sensor)
The API filters the CapSense_SensorRaw[sensor] element using the fil-
ter selected in the component. It updates the CapSense_SensorBase-
line[sensor] element using a low-pass filter with k = 256 on the filtered
CapSense_SensorRaw[sensor] value.
This API should be called after completion of the ScanSensor() API,
before checking for any activity on the sensor.
void CapSense_UpdateEnabled-
Baselines(void)
The API applies selected filter to the CapSense_SensorRaw[] array and
updates the CapSense_SensorBaseline[] array of all the sensors pres-
ent in the enabled widgets.
This API should be called after the completion of the ScanEnabledWid-
gets() API before checking for any activity on any of the sensors.
uint32 CapSense_CheckIsWidget-
Active(uint32 widget)
The API compares the selected sensor CapSense_Signal[ ] array value
to its finger threshold. Hysteresis and debounce are applied to deter-
mine if a sensor in the selected widget is active.
This API should be called after the UpdateSensorBaseline() or Upda-
teEnabledBaselines() API to check if any sensor in the widget is active.
Returns
‘1’ if one or more sensors within the widget are active
‘0’ if all sensors within the widget are inactive
uint32 CapSense_CheckIsAnyWid-
getActive(void)
The API performs the same task as CapSense_CheckIsWidgetActive()
on all the enabled widgets.
This API should be called after the UpdateEnabledBaselines() API or
after updating the baseline of all enabled sensors/widgets, to check if
any of the sensors is active in all the enabled widgets.
Returns
‘1’ if any widget is active
‘0’ if all the widgets are inactive
Table 5-6. CapSense Component APIs
API
Description/Usage
Содержание CY8CKIT-040 PSoC 4000 Pioneer Kit
Страница 20: ...CY8CKIT 040 PSoC 4000 Pioneer Kit Guide Doc 001 91316 Rev F 20 Kit Operation...
Страница 37: ...CY8CKIT 040 PSoC 4000 Pioneer Kit Guide Doc 001 91316 Rev F 37 Hardware...
Страница 73: ...CY8CKIT 040 PSoC 4000 Pioneer Kit Guide Doc 001 91316 Rev F 73 Code Examples Raw count and Baseline...