Go to the documentation of this file.00001 #ifndef __MSP430WARE_COMPD_H__
00002 #define __MSP430WARE_COMPD_H__
00003
00004 #define __MSP430_HAS_COMPD__
00005
00006
00007
00008
00009
00010
00011
00012
00013 #define COMPD_INPUT0 (CDIPSEL_0)
00014 #define COMPD_INPUT1 (CDIPSEL_1)
00015 #define COMPD_INPUT2 (CDIPSEL_2)
00016 #define COMPD_INPUT3 (CDIPSEL_3)
00017 #define COMPD_INPUT4 (CDIPSEL_4)
00018 #define COMPD_INPUT5 (CDIPSEL_5)
00019 #define COMPD_INPUT6 (CDIPSEL_6)
00020 #define COMPD_INPUT7 (CDIPSEL_7)
00021 #define COMPD_INPUT8 (CDIPSEL_8)
00022 #define COMPD_INPUT9 (CDIPSEL_9)
00023 #define COMPD_INPUT10 (CDIPSEL_10)
00024 #define COMPD_INPUT11 (CDIPSEL_11)
00025 #define COMPD_INPUT12 (CDIPSEL_12)
00026 #define COMPD_INPUT13 (CDIPSEL_13)
00027 #define COMPD_INPUT14 (CDIPSEL_14)
00028 #define COMPD_INPUT15 (CDIPSEL_15)
00029 #define COMPD_VREF (0x10)
00030
00031
00032
00033
00034
00035
00036
00037 #define COMPD_FILTEROUTPUT_OFF 0x00
00038 #define COMPD_FILTEROUTPUT_DLYLVL1 (CDF + CDFDLY_0)
00039 #define COMPD_FILTEROUTPUT_DLYLVL2 (CDF + CDFDLY_1)
00040 #define COMPD_FILTEROUTPUT_DLYLVL3 (CDF + CDFDLY_2)
00041 #define COMPD_FILTEROUTPUT_DLYLVL4 (CDF + CDFDLY_3)
00042
00043
00044
00045
00046
00047
00048
00049 #define COMPD_NORMALOUTPUTPOLARITY ( !(CDOUTPOL) )
00050 #define COMPD_INVERTEDOUTPUTPOLARITY (CDOUTPOL)
00051
00052
00053
00054
00055
00056
00057
00058 #define COMPD_REFERENCE_AMPLIFIER_DISABLED (CDREFL_0)
00059 #define COMPD_VREFBASE1_5V (CDREFL_1)
00060 #define COMPD_VREFBASE2_0V (CDREFL_2)
00061 #define COMPD_VREFBASE2_5V (CDREFL_3)
00062
00063 #define COMPD_VREFBASE_VCC (CDREFL_0)
00064
00065
00066
00067
00068
00069
00070
00071 #define COMPD_FALLINGEDGE ( !(CDIES) )
00072 #define COMPD_RISINGEDGE (CDIES)
00073
00074
00075
00076
00077
00078
00079 #define COMPD_LOW (0x0)
00080 #define COMPD_HIGH (0x1)
00081
00082
00083
00084
00085
00086
00087
00088 #define COMPD_INTERRUPT_ENABLE CDIE
00089 #define COMPD_INTERRUPT_ENABLE_INVERTED_POLARITY CDIIE
00090
00091
00092
00093
00094
00095
00096
00097 #define COMPD_INTERRUPT_FLAG CDIFG
00098 #define COMPD_INTERRUPT_FLAG_INVERTED_POLARITY CDIIFG
00099
00100
00101
00102
00103
00104 extern unsigned short COMPD_init(unsigned int baseAddress,
00105 unsigned char positiveTerminalInput,
00106 unsigned char negativeTerminalInput,
00107 unsigned char outputFilterEnableAndDelayLevel,
00108 unsigned short invertedOutputPolarity);
00109
00110 extern void COMPD_setReferenceVoltage(unsigned int baseAddress,
00111 unsigned int supplyVoltageReferenceBase,
00112 unsigned int lowerLimitSupplyVoltageFractionOf32,
00113 unsigned int upperLimitSupplyVoltageFractionOf32);
00114
00115 extern void COMPD_enableInterrupt(unsigned int baseAddress, unsigned int mask);
00116
00117 extern void COMPD_disableInterrupt(unsigned int baseAddress, unsigned int mask);
00118
00119 extern void COMPD_clearInterrupt(unsigned int baseAddress, unsigned int mask);
00120
00121 extern unsigned char COMPD_getInterruptStatus(unsigned int baseAddress,
00122 unsigned int mask);
00123
00124 extern void COMPD_interruptSetEdgeDirection(unsigned int baseAddress,
00125 unsigned short edgeDirection);
00126
00127 extern void COMPD_interruptToggleEdgeDirection(unsigned int baseAddress);
00128
00129 extern void COMPD_enable(unsigned int baseAddress);
00130
00131 extern void COMPD_disable(unsigned int baseAddress);
00132
00133 extern void COMPD_shortInputs (unsigned int baseAddress);
00134
00135 extern void COMPD_unshortInputs (unsigned int baseAddress);
00136
00137 extern void COMPD_disableInputBuffer(unsigned int baseAddress,
00138 unsigned char inputPort);
00139
00140 extern void COMPD_enableInputBuffer(unsigned int baseAddress,
00141 unsigned char inputPort);
00142
00143 extern void COMPD_IOSwap(unsigned int baseAddress);
00144
00145 extern unsigned short COMPD_outputValue(unsigned int baseAddress);
00146
00147 #endif
00148