SLAU857A May   2021  – July 2021 MSP430FR2476 , MSP430FR2512 , MSP430FR2522 , MSP430FR2532 , MSP430FR2533 , MSP430FR2632 , MSP430FR2633 , MSP430FR2672 , MSP430FR2673 , MSP430FR2675 , MSP430FR2676

 

  1.   1
  2.   2
    1.     3
    2.     4
  3.   5
    1.     6
    2.     7
    3.     8
  4.   9
    1.     10
      1.      11
      2.      12
      3.      13
    2.     14
    3.     15
  5.   16
    1.     17
      1.      18
      2.      19
        1.       20
        2.       21
        3.       22
      3.      23
    2.     24
      1.      25
      2.      26
  6.   27
    1.     28
      1.      29
      2.      30
      3.      31
      4.      32
      5.      33
    2.     34
      1.      35
      2.      36
      3.      37
    3.     38
    4.     39
      1.      40
      2.      41
      3.      42
      4.      43
      5.      44
    5.     45
    6.     46
      1.      47
      2.      48
      3.      49
      4.      50
      5.      51
  7.   52
    1.     53
    2.     54
    3.     55
    4.     56
    5.     57
  8.   58
  9.   59

Capacitive Touch Status and Parameter Reading and Processing

As described in Section 5.1.3, the Sensor structure is an abstraction of the actual sensor module. The Cycle structure is under the Sensor structure, and the Element structure is under the Cycle structure. Users can directly access the structure declared in captivate_config->CAPT_UserConfig.c to know the status of each module, and can also modify the parameters in the structure in real time according to their needs. The most 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 Commonly Used Variables in the Sensor Structure
NumberVariableTypeComment
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 process the state change of the Sensor during scanning, and it is 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 Commonly Used Variables in the Element Structure
Number Variable Type Comment
1 . bProx Bool Indicates if the Element has detected a proximity sensor.
2 . bTouch Bool Indicates if 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, refer to Register a callback function. For examples of custom projects, refer to the CCS/IAR routines corresponding to EVM430-CAPMINI: EVM430-CAPMINI-Demo