MSP430™CapTIvateSoftwareLibraryAPIGuide  1_83_00_05
CAPT_Touch.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // CAPT_Touch.h
3 //
5 //
10 //
13 //
14 //*****************************************************************************
15 //*****************************************************************************
18 //*****************************************************************************
19 #ifndef __CAPT_TOUCH__
20 #define __CAPT_TOUCH__
21 
22 #include "CAPT_HAL.h"
23 
24 //*****************************************************************************
25 //
29 //
32 //
35 //
36 //*****************************************************************************
37 extern void CAPT_blockOnFlag(volatile bool *pFlag, uint8_t ui8LPM);
38 
39 
40 //*****************************************************************************
41 //
46 //
51 //
54 //
55 //*****************************************************************************
56 extern void CAPT_loadCycle(tSensor *pSensor, uint8_t ui8Cycle,
57  uint8_t ui8Freq, bool bFSM);
58 
59 
60 //*****************************************************************************
61 //
66 //
72 //
75 //
76 //*****************************************************************************
77 extern void CAPT_unloadCycle(tSensor *pSensor, uint8_t ui8Cycle,
78  uint8_t ui8Index, bool bFSM);
79 
80 
81 //*****************************************************************************
82 //
86 //
88 //
91 //
92 //*****************************************************************************
93 extern void CAPT_startConversion(volatile bool *pbEndOfConversionFlag);
94 
95 
96 //*****************************************************************************
97 //
100 //
102 //
105 //
106 //*****************************************************************************
107 extern void CAPT_cleanupAfterConversion(void);
108 
109 
110 //*****************************************************************************
111 //
115 //
117 //
120 //
121 //*****************************************************************************
123  volatile bool *pbEndOfConversionFlag, uint8_t ui8LPM);
124 
125 
126 //*****************************************************************************
127 //
136 //
137 //*****************************************************************************
138 extern void CAPT_initSensor(tSensor *pSensor);
139 
140 
141 //*****************************************************************************
142 //
155 //
156 //*****************************************************************************
157 extern void CAPT_updateSensor(tSensor *pSensor, uint8_t ui8LPM);
158 
159 
160 //*****************************************************************************
161 //
184 //
185 //*****************************************************************************
186 extern void CAPT_updateSensorRawCount(tSensor* pSensor,
187  tRawConversionStyle conversion, tOversamplingStyle oversampling,
188  uint8_t ui8LPM);
189 
190 
191 //*****************************************************************************
192 //
203 //
218 //
221 //
222 //*****************************************************************************
223 extern void CAPT_startWakeOnProxMode(tSensor* pSensor, uint8_t ui8Cycle,
224  uint16_t ui16WakeupInterval);
225 
226 
227 //*****************************************************************************
228 //
255 //
258 //
259 //*****************************************************************************
260 extern void CAPT_startWakeOnProxModeWithEMCAuto(tSensor* pSensor,
261  uint8_t ui8Cycle, uint16_t ui16WakeupInterval);
262 
263 
264 //*****************************************************************************
265 //
270 //
273 //
276 //
277 //*****************************************************************************
278 extern void CAPT_stopWakeOnProxMode(tSensor* pSensor, uint8_t ui8Cycle);
279 
280 
281 //*****************************************************************************
282 //
288 //
291 //
294 //
295 //*****************************************************************************
296 extern void CAPT_stopWakeOnProxModeWithEMCAuto(tSensor* pSensor,
297  uint8_t ui8Cycle);
298 
299 
300 //*****************************************************************************
301 //
314 //
315 //*****************************************************************************
316 extern void CAPT_processFSMCycle(tSensor *pSensor, tCycle *pCycle);
317 
318 
319 //*****************************************************************************
320 //
329 //
330 //*****************************************************************************
331 extern void CAPT_processSensor(tSensor *pSensor);
332 
333 
334 //*****************************************************************************
335 //
348 //
349 //*****************************************************************************
350 extern bool CAPT_testForRecalibration(tSensor *pSensor);
351 
352 //*****************************************************************************
353 //
364 //
365 //*****************************************************************************
366 extern bool CAPT_testForMaxCountRecalibration(tSensor *pSensor);
367 
368 //*****************************************************************************
369 //
380 //
381 //*****************************************************************************
382 extern bool CAPT_testForNegativeTouchRecalibration(tSensor *pSensor);
383 
384 //*****************************************************************************
385 //
395 //
396 //*****************************************************************************
397 extern void CAPT_flagAllElementsForReseed(tSensor* pSensor);
398 
399 
400 //*****************************************************************************
401 //
411 //
412 //*****************************************************************************
413 extern void CAPT_updateSensorTimeout(tSensor *pSensor);
414 
415 
416 //*****************************************************************************
417 //
427 //
428 //*****************************************************************************
429 extern void CAPT_updateSensorNoise(tSensor *pSensor);
430 
431 
432 //*****************************************************************************
433 //
438 //
441 //
444 //
445 //*****************************************************************************
446 extern uint8_t CAPT_convertAbsToRel(uint16_t ui16Ref, uint16_t ui16Abs);
447 
448 
449 //*****************************************************************************
450 //
454 //
457 //
460 //
461 //*****************************************************************************
462 extern uint16_t CAPT_convertRelToAbs(uint16_t ui16Ref, uint8_t ui8Rel);
463 
464 
465 //*****************************************************************************
466 //
468 //
479 //
492 //
493 //*****************************************************************************
494 extern uint64_t CAPT_getElementStateBitField(tSensor *pSensor,
495  tElementStatusType status);
496 
497 
498 //*****************************************************************************
499 //
514 //
515 //*****************************************************************************
516 extern void CAPT_registerCallback(tSensor *pSensor,
517  void (* user_callback)(tSensor *pSensor));
518 
519 
520 //*****************************************************************************
521 //
532 //
533 //*****************************************************************************
534 extern void CAPT_registerTrackPadSensorProcessing(tSensor *pSensor, void (* user_function)(tSensor*));
535 
536 
537 //*****************************************************************************
538 //
546 //
547 //*****************************************************************************
548 extern void CAPT_registerTrackPadGestureProcessing(tSensor *pSensor, void (* user_function)(tSensor*));
549 
550 
551 //*****************************************************************************
552 //
561 //
562 //*****************************************************************************
563 extern void CAPT_clearSensorProxTouch(tSensor *pSensor);
564 
565 
566 //*****************************************************************************
567 //
582 //
583 //*****************************************************************************
584 extern IQ16_t CAPT_computeIIRFilter(IQ16_t *pRaw, IQ16_t *pFiltered,
585  uint8_t ui8Beta);
586 
587 extern uint32_t CAPT_computeIIRFilter32(IQ16_t *pRaw, IQ16_t *pFiltered,
588  uint8_t ui8Beta);
589 
590 
591 //*****************************************************************************
592 //
607 //
608 //*****************************************************************************
609 extern IQ16_t CAPT_computeIIRFilterFast(IQ16_t *pRaw, IQ16_t *pFiltered,
610  uint8_t ui8Beta);
611 
612 extern uint32_t CAPT_computeIIRFilterFast32(IQ16_t *pRaw, IQ16_t *pFiltered,
613  uint8_t ui8Beta);
614 
615 //*****************************************************************************
616 //
628 //
629 //*****************************************************************************
630 extern void CAPT_reseedFilterAll(tSensor *pSensor, tFilterOption WhatToFilter);
631 
632 
633 //*****************************************************************************
634 //
646 //
647 //*****************************************************************************
648 extern void CAPT_reseedFilter(IQ16_t *pFilter, uint16_t ui16ReseedValue);
649 
650 
651 //*****************************************************************************
652 //
666 //
667 //*****************************************************************************
668 extern bool CAPT_updateProx(tSensor *pSensor, tElement *pElement);
669 
670 
671 //*****************************************************************************
672 //
685 //
686 //*****************************************************************************
687 extern bool CAPT_updateTouch(tSensor *pSensor, tElement *pElement);
688 
689 
690 //*****************************************************************************
691 //
703 //
704 //*****************************************************************************
705 extern void CAPT_updateLTA(tSensor *pSensor, tElement *pElement);
706 
707 
708 //*****************************************************************************
709 //
720 //
721 //*****************************************************************************
722 extern void CAPT_updateFSMProx(tSensor *pSensor, tElement *pElement);
723 
724 
725 //*****************************************************************************
726 //
739 //
740 //*****************************************************************************
741 extern void CAPT_updateFSMTouch(tSensor *pSensor, tElement *pElement);
742 
743 
744 //*****************************************************************************
745 //
756 //
757 //*****************************************************************************
758 extern void CAPT_updateSensorProxTouch(tSensor *pSensor);
759 
760 
761 //*****************************************************************************
762 //
763 //
764 //
765 // THE FOLLOWING FUNCTIONS ARE SPECIFIC TO SENSORS WITH NOISE IMMUNUITY
766 // (EMC) ENABLED.
767 //
768 //
769 //
770 //*****************************************************************************
771 
772 
773 //*****************************************************************************
774 //
782 //
783 //*****************************************************************************
784 extern void CAPT_updateSensorWithEMC(tSensor *pSensor, uint8_t ui8LPM);
785 
786 //*****************************************************************************
787 //
796 //
797 //*****************************************************************************
798 extern void CAPT_updateSensorWithEMCAuto(tSensor *pSensor, uint8_t ui8LPM);
799 
800 //*****************************************************************************
801 //
813 //
814 //*****************************************************************************
815 extern void CAPT_processCycleWithEMC(tSensor *pSensor, const tCycle *pCycle);
816 
817 
818 //*****************************************************************************
819 //
829 //
830 //*****************************************************************************
832  tElement *pElement);
833 
834 
835 //*****************************************************************************
836 //
846 //
847 //*****************************************************************************
849  tElement *pElement);
850 
851 
852 //*****************************************************************************
853 //
863 //
864 //*****************************************************************************
866  tElement *pElement);
867 
868 #endif
869 //*****************************************************************************
872 //*****************************************************************************
bool CAPT_testForRecalibration(tSensor *pSensor)
void CAPT_registerCallback(tSensor *pSensor, void(*user_callback)(tSensor *pSensor))
uint32_t CAPT_computeIIRFilterFast32(IQ16_t *pRaw, IQ16_t *pFiltered, uint8_t ui8Beta)
void CAPT_registerTrackPadSensorProcessing(tSensor *pSensor, void(*user_function)(tSensor *))
void CAPT_updateFSMTouch(tSensor *pSensor, tElement *pElement)
void CAPT_blockOnFlag(volatile bool *pFlag, uint8_t ui8LPM)
typedef IQ16_t
Definition: CAPT_Type.h:428
bool CAPT_updateTouch(tSensor *pSensor, tElement *pElement)
void CAPT_reseedFilterAll(tSensor *pSensor, tFilterOption WhatToFilter)
void CAPT_updateLTA(tSensor *pSensor, tElement *pElement)
uint32_t CAPT_computeIIRFilter32(IQ16_t *pRaw, IQ16_t *pFiltered, uint8_t ui8Beta)
uint8_t tOversamplingStyle
Definition: CAPT_Type.h:260
void CAPT_updateSensorWithEMCAuto(tSensor *pSensor, uint8_t ui8LPM)
void CAPT_updateSensorWithEMC(tSensor *pSensor, uint8_t ui8LPM)
void CAPT_updateElementFilteredValuesWithEMC(tSensor *pSensor, tElement *pElement)
void CAPT_reseedFilter(IQ16_t *pFilter, uint16_t ui16ReseedValue)
void CAPT_startConversionAndWaitUntilDone(volatile bool *pbEndOfConversionFlag, uint8_t ui8LPM)
For large code model devices, a function pointer should be 32-bits.
Definition: CAPT_Type.h:748
void CAPT_updateSensor(tSensor *pSensor, uint8_t ui8LPM)
bool CAPT_updateProjElementProxTouchWithEMC(tSensor *pSensor, tElement *pElement)
bool CAPT_testForMaxCountRecalibration(tSensor *pSensor)
uint8_t tFilterOption
Definition: CAPT_Type.h:163
void CAPT_cleanupAfterConversion(void)
typedef tElement
Definition: CAPT_Type.h:529
void CAPT_initSensor(tSensor *pSensor)
bool CAPT_updateProx(tSensor *pSensor, tElement *pElement)
uint64_t CAPT_getElementStateBitField(tSensor *pSensor, tElementStatusType status)
Get a bit field of the requested state of all elements in the sensor.
void CAPT_startWakeOnProxModeWithEMCAuto(tSensor *pSensor, uint8_t ui8Cycle, uint16_t ui16WakeupInterval)
void CAPT_stopWakeOnProxModeWithEMCAuto(tSensor *pSensor, uint8_t ui8Cycle)
void CAPT_updateSensorNoise(tSensor *pSensor)
void CAPT_updateFSMProx(tSensor *pSensor, tElement *pElement)
void CAPT_flagAllElementsForReseed(tSensor *pSensor)
uint8_t CAPT_convertAbsToRel(uint16_t ui16Ref, uint16_t ui16Abs)
void CAPT_processFSMCycle(tSensor *pSensor, tCycle *pCycle)
void CAPT_processSensor(tSensor *pSensor)
void CAPT_unloadCycle(tSensor *pSensor, uint8_t ui8Cycle, uint8_t ui8Index, bool bFSM)
bool CAPT_updateSelfElementProxTouchWithEMC(tSensor *pSensor, tElement *pElement)
IQ16_t CAPT_computeIIRFilterFast(IQ16_t *pRaw, IQ16_t *pFiltered, uint8_t ui8Beta)
void CAPT_startConversion(volatile bool *pbEndOfConversionFlag)
void CAPT_processCycleWithEMC(tSensor *pSensor, const tCycle *pCycle)
Definition: CAPT_Type.h:690
void CAPT_updateSensorRawCount(tSensor *pSensor, tRawConversionStyle conversion, tOversamplingStyle oversampling, uint8_t ui8LPM)
void CAPT_clearSensorProxTouch(tSensor *pSensor)
uint8_t tRawConversionStyle
Definition: CAPT_Type.h:213
void CAPT_startWakeOnProxMode(tSensor *pSensor, uint8_t ui8Cycle, uint16_t ui16WakeupInterval)
void CAPT_updateSensorProxTouch(tSensor *pSensor)
uint8_t tElementStatusType
Definition: CAPT_Type.h:352
void CAPT_loadCycle(tSensor *pSensor, uint8_t ui8Cycle, uint8_t ui8Freq, bool bFSM)
void CAPT_stopWakeOnProxMode(tSensor *pSensor, uint8_t ui8Cycle)
void CAPT_updateSensorTimeout(tSensor *pSensor)
uint16_t CAPT_convertRelToAbs(uint16_t ui16Ref, uint8_t ui8Rel)
void CAPT_registerTrackPadGestureProcessing(tSensor *pSensor, void(*user_function)(tSensor *))
IQ16_t CAPT_computeIIRFilter(IQ16_t *pRaw, IQ16_t *pFiltered, uint8_t ui8Beta)
bool CAPT_testForNegativeTouchRecalibration(tSensor *pSensor)
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale