MSP430™CapTIvateSoftwareLibraryAPIGuide  1_70_00_03
CAPT_HAL.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // CAPT_HAL.h
3 //
5 //
10 //
13 //
14 //*****************************************************************************
15 //*****************************************************************************
18 //*****************************************************************************
19 
20 #ifndef CAPT_HAL_H_
21 #define CAPT_HAL_H_
22 
23 #ifndef S_SPLINT_S
24 #include <stdint.h>
25 #include <stdbool.h>
26 #endif
27 
28 #include <msp430.h>
29 
30 #include "CAPT_Type.h"
31 
32 //*****************************************************************************
33 //
34 // CapTIvate&tm; Timer Sources
35 //
36 //*****************************************************************************
37 #define CAPT_TIMER_SRC_ACLK (0x00)
38 #define CAPT_TIMER_SRC_VLOCLK (0x01)
39 
40 //*****************************************************************************
41 //
42 // CapTIvate&tm; Timer Source Dividers
43 //
44 //*****************************************************************************
45 #define CAPT_TIMER_CLKDIV__1 (0x00)
46 #define CAPT_TIMER_CLKDIV__2 (0x01)
47 #define CAPT_TIMER_CLKDIV__4 (0x02)
48 #define CAPT_TIMER_CLKDIV__8 (0x03)
49 #define CAPT_TIMER_CLKDIV__16 (0x04)
50 #define CAPT_TIMER_CLKDIV__32 (0x05)
51 #define CAPT_TIMER_CLKDIV__64 (0x06)
52 #define CAPT_TIMER_CLKDIV__128 (0x07)
53 
54 //*****************************************************************************
55 //
56 // CapTIvate&tm; Conversion Counter Interval Selections
57 //
58 //*****************************************************************************
59 #define CAPT_COUNTER__16 (0x00)
60 #define CAPT_COUNTER__32 (0x01)
61 #define CAPT_COUNTER__64 (0x02)
62 #define CAPT_COUNTER__128 (0x03)
63 #define CAPT_COUNTER__256 (0x04)
64 #define CAPT_COUNTER__512 (0x05)
65 #define CAPT_COUNTER__1024 (0x06)
66 #define CAPT_COUNTER__2048 (0x07)
67 #define CAPT_COUNTER__DISABLED (0x08)
68 
69 //*****************************************************************************
70 //
71 // CapTIvate&tm; Conversion Clock Oscillator Frequencies
72 //
73 //*****************************************************************************
74 #define CAPT_OSC_FREQ_DEFAULT (0x00)
75 #define CAPT_OSC_FREQ_16MHZ (0x00)
76 #define CAPT_OSC_FREQ_14P7MHZ (0x01)
77 #define CAPT_OSC_FREQ_13P1MHZ (0x02)
78 #define CAPT_OSC_FREQ_11P2MHZ (0x03)
79 
80 //*****************************************************************************
81 //
82 // CapTIvate&tm; Reference Capacitor Sizes
83 //
84 //*****************************************************************************
85 #define CAPT_REFERENCE_CAP__SELF_1P0PF (0x00)
86 #define CAPT_REFERENCE_CAP__SELF_1P1PF (0x04)
87 #define CAPT_REFERENCE_CAP__SELF_1P5PF (0x05)
88 #define CAPT_REFERENCE_CAP__SELF_5P0PF (0x02)
89 #define CAPT_REFERENCE_CAP__SELF_5P1PF (0x06)
90 #define CAPT_REFERENCE_CAP__SELF_5P5PF (0x07)
91 #define CAPT_REFERENCE_CAP__MUTUAL_0P1PFM_1P0PF (0x00)
92 #define CAPT_REFERENCE_CAP__MUTUAL_0P5PFM_1P0PF (0x01)
93 #define CAPT_REFERENCE_CAP__MUTUAL_0P1PFM_5P0PF (0x02)
94 #define CAPT_REFERENCE_CAP__MUTUAL_0P5PFM_5P0PF (0x03)
95 
96 //*****************************************************************************
97 //
98 // CapTIvate&tm; Coarse Gain Ratios
99 //
100 //*****************************************************************************
101 #define CAPT_COARSEGAIN_0 (0x00)
102 #define CAPT_COARSEGAIN_1 (0x01)
103 #define CAPT_COARSEGAIN_2 (0x02)
104 #define CAPT_COARSEGAIN_3 (0x03)
105 #define CAPT_COARSEGAIN_4 (0x04)
106 #define CAPT_COARSEGAIN_5 (0x05)
107 #define CAPT_COARSEGAIN_6 (0x06)
108 #define CAPT_COARSEGAIN_7 (0x07)
109 #define CAPT_COARSEGAIN_MIN (CAPT_COARSEGAIN_0)
110 #define CAPT_COARSEGAIN_MAX (CAPT_COARSEGAIN_7)
111 
112 //*****************************************************************************
113 //
114 // CapTIvate&tm; Fine Gain Ratios
115 //
116 //*****************************************************************************
117 #define CAPT_FINEGAIN_0 (0x00)
118 #define CAPT_FINEGAIN_1 (0x01)
119 #define CAPT_FINEGAIN_2 (0x02)
120 #define CAPT_FINEGAIN_3 (0x03)
121 #define CAPT_FINEGAIN_4 (0x04)
122 #define CAPT_FINEGAIN_5 (0x05)
123 #define CAPT_FINEGAIN_6 (0x06)
124 #define CAPT_FINEGAIN_7 (0x07)
125 #define CAPT_FINEGAIN_8 (0x08)
126 #define CAPT_FINEGAIN_9 (0x09)
127 #define CAPT_FINEGAIN_10 (0x0A)
128 #define CAPT_FINEGAIN_11 (0x0B)
129 #define CAPT_FINEGAIN_12 (0x0C)
130 #define CAPT_FINEGAIN_13 (0x0D)
131 #define CAPT_FINEGAIN_14 (0x0E)
132 #define CAPT_FINEGAIN_15 (0x0F)
133 #define CAPT_FINEGAIN_16 (0x10)
134 #define CAPT_FINEGAIN_17 (0x11)
135 #define CAPT_FINEGAIN_18 (0x12)
136 #define CAPT_FINEGAIN_19 (0x13)
137 #define CAPT_FINEGAIN_MIN (CAPT_FINEGAIN_0)
138 #define CAPT_FINEGAIN_MAX (CAPT_FINEGAIN_19)
139 
140 //*****************************************************************************
141 //
142 // CapTIvate&tm; Offset Tap Values
143 //
144 //*****************************************************************************
145 #define CAPT_OFFSETTAP_MIN (0x00)
146 #define CAPT_OFFSETTAP_MAX (0xFF)
147 
148 //*****************************************************************************
149 //
150 // CapTIvate&tm; Offset Scale Values
151 //
152 //*****************************************************************************
153 #define CAPT_OFFSETSCALE__VERYSMALL (0x0000)
154 #define CAPT_OFFSETSCALE__SMALL (0x0100)
155 #define CAPT_OFFSETSCALE__LARGE (0x0200)
156 #define CAPT_OFFSETSCALE__VERYLARGE (0x0300)
157 #define CAPT_OFFSETSCALE_MIN (CAPT_OFFSETSCALE__VERYSMALL)
158 #define CAPT_OFFSETSCALE_MAX (CAPT_OFFSETSCALE__VERYLARGE)
159 
160 //*****************************************************************************
161 //
162 // CapTIvate&tm; Interrupt Definitions
163 //
164 //*****************************************************************************
165 #define CAPT_END_OF_CONVERSION_INTERRUPT (0x0001)
166 #define CAPT_DETECTION_INTERRUPT (0x0002)
167 #define CAPT_TIMER_INTERRUPT (0x0004)
168 #define CAPT_CONVERSION_COUNTER_INTERRUPT (0x0008)
169 #define CAPT_MAX_COUNT_ERROR_INTERRUPT (0x0100)
170 
171 //*****************************************************************************
172 //
173 // CapTIvate&tm; Interrupt Vectors
174 //
175 //*****************************************************************************
176 #define CAPT_IV_NO_INTERRUPT (0x0000)
177 #define CAPT_IV_END_OF_CONVERSION (0x0002)
178 #define CAPT_IV_DETECTION (0x0004)
179 #define CAPT_IV_TIMER (0x0006)
180 #define CAPT_IV_CONVERSION_COUNTER (0x0008)
181 #define CAPT_IV_MAX_COUNT_ERROR (0x000A)
182 
183 //*****************************************************************************
184 //
190 //
196 //
197 //*****************************************************************************
198 extern void CAPT_init(void);
199 
200 
201 //*****************************************************************************
202 //
210 //
211 //*****************************************************************************
212 extern bool CAPT_pollResetStatus(void);
213 
214 //*****************************************************************************
215 //
224 //
225 //*****************************************************************************
226 extern bool CAPT_pollCIPF(void);
227 
228 //*****************************************************************************
229 //
236 //
237 //*****************************************************************************
238 extern void CAPT_reset(void);
239 
240 
241 //*****************************************************************************
242 //
251 //
252 //*****************************************************************************
253 extern void CAPT_setStabilization(void);
254 
255 //*****************************************************************************
256 //
266 //
267 //*****************************************************************************
268 extern void CAPT_releaseStabilization(void);
269 
270 //*****************************************************************************
271 //
290 //
291 //*****************************************************************************
292 extern void CAPT_enableRefCap(tElement* pElement, uint8_t capSize);
293 
294 
295 //*****************************************************************************
296 //
303 //
304 //*****************************************************************************
305 extern void CAPT_disableRefCap(void);
306 
307 //*****************************************************************************
308 //
317 //
318 //*****************************************************************************
319 extern void CAPT_enableSensorIO(tSensor *pSensor);
320 
321 //*****************************************************************************
322 //
328 //
329 //*****************************************************************************
330 extern void CAPT_disableSensorIO(tSensor *pSensor);
331 
332 //*****************************************************************************
333 //
341 //
342 //*****************************************************************************
343 extern void CAPT_initSensorIO(tSensor *pSensor);
344 
345 //*****************************************************************************
346 //
354 //
355 //*****************************************************************************
356 extern void CAPT_forceSensorIO(tSenseTechnology rxBarTx, tSensor *pSensor);
357 
358 //*****************************************************************************
359 //
386 //
387 //*****************************************************************************
388 extern void CAPT_applySensorParams(tSensor *pSensor);
389 
390 //*****************************************************************************
391 //
399 //
400  //*****************************************************************************
401 extern void CAPT_enableSensorSyncEvent(void);
402 
403 //*****************************************************************************
404 //
411 //
412 //*****************************************************************************
413 extern void CAPT_disableSensorSyncEvent(void);
414 
415 //*****************************************************************************
416 //
424 //
425 //*****************************************************************************
426 extern void CAPT_bypassFSM(void);
427 
428 //*****************************************************************************
429 //
439 //
440 //*****************************************************************************
441 extern void CAPT_engageFSM(void);
442 
443 //*****************************************************************************
444 //
457 //
458 //*****************************************************************************
459 extern void CAPT_applySensorFreq(uint8_t freqSelect, tSensor *pSensor);
460 
461 //*****************************************************************************
462 //
474 //
475 //*****************************************************************************
476 extern void CAPT_setCycleIO(tSensor *pSensor,tCycle *pCycle);
477 
478 //*****************************************************************************
479 //
486 //
487 //*****************************************************************************
488 extern void CAPT_clearCycleIO(tSensor *pSensor, tCycle *pCycle);
489 
490 //*****************************************************************************
491 //
499 //
500 //*****************************************************************************
501 extern void CAPT_applyCycleComp(uint8_t freqOffset,tCycle * pCycle);
502 
503 //*****************************************************************************
504 //
511 //
512 //*****************************************************************************
513 extern void CAPT_applyCycleFSM(tCycle *pCycle);
514 
515 //*****************************************************************************
516 //
527 //
528 //*****************************************************************************
529 extern void CAPT_enableISR(uint16_t interruptEnable);
530 
531 //*****************************************************************************
532 //
543 //
544 //*****************************************************************************
545 extern void CAPT_disableISR(uint16_t interruptDisable);
546 
547 //*****************************************************************************
548 //
562 //
563 //*****************************************************************************
564 extern void CAPT_setCAPSTART(void);
565 
566 //*****************************************************************************
567 //
575 //
576 //*****************************************************************************
577 extern void CAPT_clearCAPSTART(void);
578 
579 //*****************************************************************************
580 //
593 //
594 //*****************************************************************************
595 extern void CAPT_saveCycleRawResults(uint8_t indexFreq,tSensor *pSensor, tCycle *pCycle);
596 
597 //*****************************************************************************
598 //
607 //
608 //*****************************************************************************
609 extern void CAPT_saveCycleResults(tSensor *pSensor ,tCycle *pCycle);
610 
611 //*****************************************************************************
612 //
628 //
629 //*****************************************************************************
630 extern void CAPT_selectCCounterInterval(uint8_t counterSel);
631 
632 //*****************************************************************************
633 //
640 //
641 //*****************************************************************************
642 extern void CAPT_clearCCounter(void);
643 
644 //*****************************************************************************
645 //
652 //
653 //*****************************************************************************
654 extern void CAPT_startCCounter(void);
655 
656 //*****************************************************************************
657 //
664 //
665 //*****************************************************************************
666 extern void CAPT_stopCCounter(void);
667 
668 
669 //*****************************************************************************
670 //
676 //
677 //*****************************************************************************
678 extern void CAPT_selectTimerSourceDivider(uint8_t sourceDiv);
679 
680 //*****************************************************************************
681 //
687 //
688 //*****************************************************************************
689 extern void CAPT_selectTimerSource(uint8_t source);
690 
691 //*****************************************************************************
692 //
700 //
701 //*****************************************************************************
702 extern void CAPT_enableTimerTrigMeasurement(void);
703 
704 //*****************************************************************************
705 //
713 //
714 //*****************************************************************************
715 extern void CAPT_disableTimerTrigMeasurement(void);
716 
717 
718 //*****************************************************************************
719 //
726 //
727 //*****************************************************************************
728 extern void CAPT_clearTimer(void);
729 
730 //*****************************************************************************
731 //
738 //
739 //*****************************************************************************
740 extern void CAPT_startTimer(void);
741 
742 //*****************************************************************************
743 //
750 //
751 //*****************************************************************************
752 extern void CAPT_stopTimer(void);
753 
754 //*****************************************************************************
755 //
761 //
762 //*****************************************************************************
763 extern uint16_t CAPT_readTimerRegister(void);
764 
765 //*****************************************************************************
766 //
772 //
773 //*****************************************************************************
774 extern uint16_t CAPT_readTimerCompRegister(void);
775 
776 //*****************************************************************************
777 //
783 //
784 //*****************************************************************************
785 extern void CAPT_writeTimerCompRegister(uint16_t compRegister);
786 
787 //*****************************************************************************
788 //
794 //
795 //*****************************************************************************
796 extern void CAPT_powerOff(void);
797 
798 //*****************************************************************************
799 //
805 //
806 //*****************************************************************************
807 extern void CAPT_powerOn(void);
808 
809 //*****************************************************************************
810 //
819 //
820 //*****************************************************************************
821 extern void CAPT_setChannelActive(uint8_t ui8Block, uint8_t ui8Pin);
822 
823 //*****************************************************************************
824 //
831 //
832 //*****************************************************************************
833 extern void CAPT_setChannelEnable(uint8_t ui8Block, uint8_t ui8Pin);
834 
835 //*****************************************************************************
836 //
844 //
845 //*****************************************************************************
846 extern void CAPT_setChannelOffState(uint8_t ui8Block, uint8_t ui8Pin);
847 
848 //*****************************************************************************
849 //
859 //
860 //*****************************************************************************
861 extern void CAPT_setChannelOnState(uint8_t ui8Block, uint8_t ui8Pin);
862 
863 //*****************************************************************************
864 //
871 //
872 //*****************************************************************************
873 extern void CAPT_clearChannelActive(uint8_t ui8Block, uint8_t ui8Pin);
874 
875 
876 //*****************************************************************************
877 //
884 //
885 //*****************************************************************************
886 extern void CAPT_clearChannelEnable(uint8_t ui8Block, uint8_t ui8Pin);
887 
888 //*****************************************************************************
889 //
896 //
897 //*****************************************************************************
898 extern void CAPT_clearChannelOffState(uint8_t ui8Block, uint8_t ui8Pin);
899 
900 //*****************************************************************************
901 //
908 //
909 //*****************************************************************************
910 extern void CAPT_clearChannelOnState(uint8_t ui8Block, uint8_t ui8Pin);
911 
912 //*****************************************************************************
913 //
920 //
921 //*****************************************************************************
922 extern void CAPT_writeCoarseGain(uint8_t ui8Block, uint8_t ui8Value);
923 
924 //*****************************************************************************
925 //
930 //
931 //*****************************************************************************
932 extern uint8_t CAPT_readCoarseGain(uint8_t ui8Block);
933 
934 //*****************************************************************************
935 //
942 //
943 //*****************************************************************************
944 extern void CAPT_writeFineGain(uint8_t ui8Block, uint8_t ui8Value);
945 
946 //*****************************************************************************
947 //
952 //
953 //*****************************************************************************
954 extern uint8_t CAPT_readFineGain(uint8_t ui8Block);
955 
956 //*****************************************************************************
957 //
964 //
965 //*****************************************************************************
966 extern void CAPT_writeOffsetTap(uint8_t ui8Block, uint16_t ui16Value);
967 
968 //*****************************************************************************
969 //
974 //
975 //*****************************************************************************
976 extern uint16_t CAPT_readOffsetTap(uint8_t ui8Block);
977 
978 //*****************************************************************************
979 //
984 //
985 //*****************************************************************************
986 extern uint16_t CAPT_readConversion(uint8_t ui8Block);
987 
988 
989 //*****************************************************************************
990 //
997 //
998 //*****************************************************************************
999 extern void CAPT_setCAPLPMCFG(void);
1000 
1001 //*****************************************************************************
1002 //
1009 //
1010 //*****************************************************************************
1011 extern void CAPT_clearCAPLPMCFG(void);
1012 
1013 //*****************************************************************************
1014 //
1020 //
1021 //*****************************************************************************
1022 extern uint16_t CAPT_pollIFG(uint16_t ui16InterruptMask);
1023 
1024 //*****************************************************************************
1025 //
1037 //
1038 //*****************************************************************************
1039 extern void CAPT_clearIFG(uint16_t ui16InterruptMask);
1040 
1041 //*****************************************************************************
1042 //
1048 //
1049 //*****************************************************************************
1050 extern uint16_t CAPT_getInterruptVector(void);
1051 
1052 //*****************************************************************************
1053 //
1061 //
1062 //*****************************************************************************
1063 extern void CAPT_enableShieldIO(uint8_t ui8Block, uint8_t ui8Pin);
1064 
1065 //*****************************************************************************
1066 //
1074 //
1075 //*****************************************************************************
1076 extern void CAPT_disableShieldIO(uint8_t ui8Block, uint8_t ui8Pin);
1077 
1078 #endif /* CAPT_HAL_H_ */
1079 //*****************************************************************************
1082 //*****************************************************************************
void CAPT_reset(void)
uint16_t CAPT_readConversion(uint8_t ui8Block)
void CAPT_setStabilization(void)
void CAPT_clearCCounter(void)
void CAPT_setCycleIO(tSensor *pSensor, tCycle *pCycle)
uint16_t CAPT_getInterruptVector(void)
void CAPT_setChannelOnState(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_powerOff(void)
void CAPT_startCCounter(void)
void CAPT_enableRefCap(tElement *pElement, uint8_t capSize)
void CAPT_selectTimerSourceDivider(uint8_t sourceDiv)
void CAPT_disableRefCap(void)
void CAPT_setChannelOffState(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_enableISR(uint16_t interruptEnable)
void CAPT_setCAPLPMCFG(void)
uint16_t CAPT_readTimerRegister(void)
void CAPT_clearChannelOnState(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_writeOffsetTap(uint8_t ui8Block, uint16_t ui16Value)
void CAPT_enableTimerTrigMeasurement(void)
void CAPT_clearChannelActive(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_disableShieldIO(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_releaseStabilization(void)
uint8_t tSenseTechnology
Definition: CAPT_Type.h:95
uint16_t CAPT_readOffsetTap(uint8_t ui8Block)
void CAPT_clearIFG(uint16_t ui16InterruptMask)
void CAPT_applyCycleFSM(tCycle *pCycle)
void CAPT_clearCAPSTART(void)
void CAPT_applySensorParams(tSensor *pSensor)
void CAPT_disableTimerTrigMeasurement(void)
bool CAPT_pollCIPF(void)
uint16_t CAPT_readTimerCompRegister(void)
Definition: CAPT_Type.h:654
void CAPT_bypassFSM(void)
void CAPT_enableSensorIO(tSensor *pSensor)
void CAPT_enableShieldIO(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_powerOn(void)
void CAPT_setChannelActive(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_disableISR(uint16_t interruptDisable)
typedef tElement
Definition: CAPT_Type.h:453
void CAPT_forceSensorIO(tSenseTechnology rxBarTx, tSensor *pSensor)
void CAPT_clearTimer(void)
void CAPT_selectCCounterInterval(uint8_t counterSel)
void CAPT_clearCAPLPMCFG(void)
uint8_t CAPT_readCoarseGain(uint8_t ui8Block)
uint16_t CAPT_pollIFG(uint16_t ui16InterruptMask)
void CAPT_startTimer(void)
void CAPT_disableSensorIO(tSensor *pSensor)
void CAPT_clearChannelOffState(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_selectTimerSource(uint8_t source)
void CAPT_writeFineGain(uint8_t ui8Block, uint8_t ui8Value)
Definition: CAPT_Type.h:606
void CAPT_saveCycleRawResults(uint8_t indexFreq, tSensor *pSensor, tCycle *pCycle)
void CAPT_stopTimer(void)
void CAPT_clearCycleIO(tSensor *pSensor, tCycle *pCycle)
void CAPT_clearChannelEnable(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_init(void)
void CAPT_setCAPSTART(void)
void CAPT_writeCoarseGain(uint8_t ui8Block, uint8_t ui8Value)
void CAPT_engageFSM(void)
void CAPT_setChannelEnable(uint8_t ui8Block, uint8_t ui8Pin)
void CAPT_writeTimerCompRegister(uint16_t compRegister)
void CAPT_saveCycleResults(tSensor *pSensor, tCycle *pCycle)
void CAPT_stopCCounter(void)
uint8_t CAPT_readFineGain(uint8_t ui8Block)
void CAPT_applySensorFreq(uint8_t freqSelect, tSensor *pSensor)
bool CAPT_pollResetStatus(void)
void CAPT_applyCycleComp(uint8_t freqOffset, tCycle *pCycle)
void CAPT_initSensorIO(tSensor *pSensor)
void CAPT_disableSensorSyncEvent(void)
void CAPT_enableSensorSyncEvent(void)
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale