CY8CKIT-040 PSoC
®
4000 Pioneer Kit Guide, Doc. # 001-91316 Rev. *F
61
Code Examples
5.3.2.2
Firmware Details
Firmware Structure
The firmware is written in a modular format, with different aspects of the functionality provided as
separate functions for easy understanding. The header provides a list of handy macros for configur-
ing the project's key aspects according to user requirements. The comments in the header file pro-
vide the details on the macro.
Firmware Flow Chart
shows the flow chart of code implemented in main.c.
Figure 5-16. CapSense Proximity and UART Project Flow Chart
Table 5-3. Source Files and Header Files in the CapSense Proximity Project
File Names
Purpose
main.c
This file contains all the function definitions used in the firmware.
main.h
This file contains all the macros used in the firmware. The details of the macros and their
usage can be found in the comments above each macro.
Start
Start the CapSense
block
Autotune Proximity
sensor parameters
Initialize Baseline of
the Proximity sensor
Setup PRSM &
UART TX Debug
output
If no Prox activity,
sleep for configured
period.
Scan the proximity
sensor
Update proximity
baseline
Is ProxSignal >
THRESHOLD?
Is ProxSignal <
SATURATION?
Yes
Duty =
ProxSignal /
PROX_SCALE
Yes
Duty = 100%
No
Duty = 0%
No
Update PRSm Duty
Send Proximity data
over UART TX
Input Initialize
Output Initialize
Input Process
Input Process
Output Process
– Calculation
Output Process
– Data output
Содержание 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...