www.ti.com
34
CapTIvate™ Touch Getting Started Manual
Copyright © 2020, Texas Instruments Incorporated
commonly used structures are Sensor and Element. Sensor can be directly accessed globally, and the Element
structure needs to be declared as a global variable and then accessed.
The most commonly used variables of the Sensor structure are shown in Table 5-11.
Table 5-11 Table of commonly used variables in the Sensor structure
Number
Variable
Types
Comment
1
. bSensorProx
Bool
Indicate the Element under the Sensor whether
detect a proximity event.
2
. bSensorTouch
Bool
Indicate the Element under the Sensor whether
detect a touch event.
3
. bSensorPrevTouch
Bool
Indicate the Element under the Sensor whether
detect a touch event in the previous scan cycle.
4
.pSensorParams->
SliderPosition.ui16Natural
uint16_t
Get the current wheel or slider position.
5
.pvCallback
void (*
pvCallback)(struct
tSensor *)
The callback function can be linked to the sensor to
handle the state change of the Sensor during
scanning, and it will be called every time the button
is scanned.
The most commonly used variables of the Element structure are shown in Table 5-12.
Table 5-12 Table of commonly used variables in the Element structure
Number
Variable
Types
Comment
1
. bProx
Bool
The Element has detected proximity sensor.
2
. bTouch
Bool
Indicate whether the Element detect a touch.
The state change of the processing button can be realized through the callback function of the Sensor. For specific
instructions, please refer to
. For examples of custom projects, please refer to the
CCS/IAR routines corresponding to EVM430-CAPMINI:
。
5.5.3
Realization and customization of communication function
It is recommended to use the provided UART and I2C library functions for development to communicate with the
host MCU. First of all, the default code generated by GUI will complete the IO configuration and clock
configuration of UART (eUSCI_A0) and I2C (eUSCI_B0) in the BSP_configureMCU() function. Therefore, it is only
necessary to configure the communication module and write the communication protocol. If you need to modify
the communication interface, check the datasheet to see if you need to modify the SYSCFG3 register to redirect
the communication port.
UART-based communication development:
•
Communication Interface configuration: NONE
•
Clock configuration: BSP_configureMCU()
•
IO configuration: BSP_configureMCU()
•
UART peripheral configuration and interrupt usage:
o
Comment
:
▪
Baud rate parameter configuration tool:
MSP430 USCI/EUSCI UART Baud Rate Calculation
▪
See the frequency of different system clock sources at captivate_app->CAPT_BSP.h
There are two schemes for I2C-based communication development for reference. The scheme occupies less code,
and the second scheme saves development time.
Option one:
•
Communication Interface configuration: NONE
•
Clock configuration: BSP_configureMCU()
•
IO configuration: BSP_configureMCU()