dac12.h
Go to the documentation of this file.
00001 #ifndef __MSP430WARE_DAC12_H__
00002 #define __MSP430WARE_DAC12_H__
00003 
00004 //*****************************************************************************
00005 //
00006 //The following are the defines to include the required modules for this
00007 //peripheral in msp430xgeneric.h file
00008 //
00009 //*****************************************************************************
00010 #define __MSP430_HAS_DAC12_2__
00011 
00012 //*****************************************************************************
00013 //
00014 //The following are values that can be passed to every function in the
00015 //moduleSelect parameter, serving as baseAddress offsets.
00016 //
00017 //*****************************************************************************
00018 #define DAC12_SUBMODULE_0 (0x00)
00019 #define DAC12_SUBMODULE_1 (0x10)
00020 
00021 //*****************************************************************************
00022 //
00023 //The following are values that can be passed to DAC12_init() in the
00024 //outputSelect parameter.
00025 //
00026 //*****************************************************************************
00027 #define DAC12_OUTPUT_1 ( !(DAC12OPS) )
00028 #define DAC12_OUTPUT_2 (DAC12OPS)
00029 
00030 //*****************************************************************************
00031 //
00032 //The following are values that can be passed to DAC12_init() in the
00033 //positiveReferenceVoltage parameter.
00034 //
00035 //*****************************************************************************
00036 #define DAC12_VREF_INT  (DAC12SREF_0)
00037 #define DAC12_VREF_AVCC (DAC12SREF_1)
00038 #define DAC12_VREF_EXT  (DAC12SREF_2)
00039 
00040 //*****************************************************************************
00041 //
00042 //The following are values that can be passed to DAC12_init() in the
00043 //outputVoltageMultiplier parameter.
00044 //
00045 //*****************************************************************************
00046 #define DAC12_VREFx1 (DAC12IR)
00047 #define DAC12_VREFx2 (DAC12OG)
00048 #define DAC12_VREFx3 (0x0)
00049 
00050 //*****************************************************************************
00051 //
00052 //The following are values that can be passed to DAC12_init() and
00053 //DAC12_setAmplifierSetting() in the amplifierSetting parameter.
00054 //
00055 //*****************************************************************************
00056 #define DAC12_AMP_OFF_PINOUTHIGHZ (DAC12AMP_0)
00057 #define DAC12_AMP_OFF_PINOUTLOW   (DAC12AMP_1)
00058 #define DAC12_AMP_LOWIN_LOWOUT    (DAC12AMP_2)
00059 #define DAC12_AMP_LOWIN_MEDOUT    (DAC12AMP_3)
00060 #define DAC12_AMP_LOWIN_HIGHOUT   (DAC12AMP_4)
00061 #define DAC12_AMP_MEDIN_MEDOUT    (DAC12AMP_5)
00062 #define DAC12_AMP_MEDIN_HIGHOUT   (DAC12AMP_6)
00063 #define DAC12_AMP_HIGHIN_HIGHOUT  (DAC12AMP_7)
00064 
00065 //*****************************************************************************
00066 //
00067 //The following are values that can be passed to DAC12_init() in the
00068 //conversionTriggerSelect parameter.
00069 //
00070 //*****************************************************************************
00071 #define DAC12_TRIGGER_ENCBYPASS (DAC12LSEL_0)
00072 #define DAC12_TRIGGER_ENC       (DAC12LSEL_1)
00073 #define DAC12_TRIGGER_TA        (DAC12LSEL_2)
00074 #define DAC12_TRIGGER_TB        (DAC12LSEL_3)
00075 
00076 //*****************************************************************************
00077 //
00078 //The following are values that can be passed to DAC12_setResolution() in the
00079 //resolutionSelect parameter.
00080 //
00081 //*****************************************************************************
00082 #define DAC12_RESOLUTION_12BIT ( !(DAC12RES) )
00083 #define DAC12_RESOLUTION_8BIT  (DAC12RES)
00084 
00085 //*****************************************************************************
00086 //
00087 //The following are values that can be passed to DAC12_setInputDataFormat() in
00088 //the inputJustiifcation parameter.
00089 //
00090 //*****************************************************************************
00091 #define DAC12_JUSTIFICATION_RIGHT ( !(DAC12DFJ) )
00092 #define DAC12_JUSTIFICATION_LEFT  (DAC12DFJ)
00093 
00094 //*****************************************************************************
00095 //
00096 //The following are values that can be passed to DAC12_setInputDataFormat() in
00097 //the inputDataFormat parameter.
00098 //
00099 //*****************************************************************************
00100 #define DAC12_UNSIGNED_BINARY     ( !(DAC12DF) )
00101 #define DAC12_SIGNED_2SCOMPLEMENT (DAC12DF)
00102 
00103 //*****************************************************************************
00104 //
00105 //The following are values that are returned by DAC12_getInterruptStatus().
00106 //
00107 //*****************************************************************************
00108 #define DAC12_INT_INACTIVE (0x0)
00109 #define DAC12_INT_ACTIVE   (0x1)
00110 
00111 //*****************************************************************************
00112 //
00113 //Prototypes for the APIs.
00114 //
00115 //*****************************************************************************
00116 extern unsigned short DAC12_init (unsigned int baseAddress,
00117     unsigned char submoduleSelect,
00118     unsigned short outputSelect,
00119     unsigned int positiveReferenceVoltage,
00120     unsigned int outputVoltageMultiplier,
00121     unsigned char amplifierSetting,
00122     unsigned int conversionTriggerSelect);
00123 
00124 extern void DAC12_setAmplifierSetting (unsigned int baseAddress,
00125     unsigned char submoduleSelect,
00126     unsigned char amplifierSetting);
00127 
00128 extern void DAC12_disable (unsigned int baseAddress,
00129     unsigned char submoduleSelect);
00130 
00131 extern void DAC12_enableGrouping (unsigned int baseAddress);
00132 
00133 extern void DAC12_disableGrouping (unsigned int baseAddress);
00134 
00135 extern void DAC12_enableInterrupt (unsigned int baseAddress,
00136     unsigned char submoduleSelect);
00137 
00138 extern void DAC12_disableInterrupt (unsigned int baseAddress,
00139     unsigned char submoduleSelect);
00140 
00141 extern unsigned short DAC12_getInterruptStatus (unsigned int baseAddress,
00142     unsigned char submoduleSelect);
00143 
00144 extern void DAC12_clearInterrupt (unsigned int baseAddress,
00145     unsigned char submoduleSelect);
00146 
00147 extern void DAC12_calibrateOutput (unsigned int baseAddress,
00148     unsigned char submoduleSelect);
00149 
00150 extern int DAC12_getCalibrationData (unsigned int baseAddress,
00151     unsigned char submoduleSelect);
00152 
00153 extern void DAC12_setCalibrationOffset (unsigned int baseAddress,
00154     unsigned char submoduleSelect,
00155     int calibrationOffsetValue);
00156 
00157 extern void DAC12_enableConversions (unsigned int baseAddress,
00158     unsigned char submoduleSelect);
00159 
00160 extern void DAC12_setData (unsigned int baseAddress,
00161     unsigned char submoduleSelect,
00162     unsigned int data);
00163 
00164 extern void DAC12_disableConversions (unsigned int baseAddress,
00165     unsigned char submoduleSelect);
00166 
00167 extern void DAC12_setResolution (unsigned int baseAddress,
00168     unsigned char submoduleSelect,
00169     unsigned int resolutionSelect);
00170 
00171 extern void DAC12_setInputDataFormat (unsigned int baseAddress,
00172     unsigned char submoduleSelect,
00173     unsigned char inputJustification,
00174     unsigned char inputSign);
00175 
00176 extern unsigned long DAC12_getDataBufferMemoryAddressForDMA
00177     (unsigned baseAddress,
00178     unsigned char submoduleSelect);
00179 
00180 #endif

Copyright 2012, Texas Instruments Incorporated