7 #ifndef __MSP430WARE_ADC12_A_H__ 8 #define __MSP430WARE_ADC12_A_H__ 10 #include "inc/hw_memmap.h" 12 #ifdef __MSP430_HAS_ADC12_PLUS__ 25 #include "inc/hw_memmap.h" 103 #define ADC12_A_CLOCKSOURCE_ADC12OSC (ADC12SSEL_0) 104 #define ADC12_A_CLOCKSOURCE_ACLK (ADC12SSEL_1) 105 #define ADC12_A_CLOCKSOURCE_MCLK (ADC12SSEL_2) 106 #define ADC12_A_CLOCKSOURCE_SMCLK (ADC12SSEL_3) 114 #define ADC12_A_CLOCKDIVIDER_1 (ADC12DIV_0) 115 #define ADC12_A_CLOCKDIVIDER_2 (ADC12DIV_1) 116 #define ADC12_A_CLOCKDIVIDER_3 (ADC12DIV_2) 117 #define ADC12_A_CLOCKDIVIDER_4 (ADC12DIV_3) 118 #define ADC12_A_CLOCKDIVIDER_5 (ADC12DIV_4) 119 #define ADC12_A_CLOCKDIVIDER_6 (ADC12DIV_5) 120 #define ADC12_A_CLOCKDIVIDER_7 (ADC12DIV_6) 121 #define ADC12_A_CLOCKDIVIDER_8 (ADC12DIV_7) 122 #define ADC12_A_CLOCKDIVIDER_12 (ADC12DIV_2 + ADC12PDIV) 123 #define ADC12_A_CLOCKDIVIDER_16 (ADC12DIV_3 + ADC12PDIV) 124 #define ADC12_A_CLOCKDIVIDER_20 (ADC12DIV_4 + ADC12PDIV) 125 #define ADC12_A_CLOCKDIVIDER_24 (ADC12DIV_5 + ADC12PDIV) 126 #define ADC12_A_CLOCKDIVIDER_28 (ADC12DIV_6 + ADC12PDIV) 127 #define ADC12_A_CLOCKDIVIDER_32 (ADC12DIV_7 + ADC12PDIV) 135 #define ADC12_A_SAMPLEHOLDSOURCE_SC (ADC12SHS_0) 136 #define ADC12_A_SAMPLEHOLDSOURCE_1 (ADC12SHS_1) 137 #define ADC12_A_SAMPLEHOLDSOURCE_2 (ADC12SHS_2) 138 #define ADC12_A_SAMPLEHOLDSOURCE_3 (ADC12SHS_3) 148 #define ADC12_A_CYCLEHOLD_4_CYCLES (ADC12SHT0_0) 149 #define ADC12_A_CYCLEHOLD_8_CYCLES (ADC12SHT0_1) 150 #define ADC12_A_CYCLEHOLD_16_CYCLES (ADC12SHT0_2) 151 #define ADC12_A_CYCLEHOLD_32_CYCLES (ADC12SHT0_3) 152 #define ADC12_A_CYCLEHOLD_64_CYCLES (ADC12SHT0_4) 153 #define ADC12_A_CYCLEHOLD_96_CYCLES (ADC12SHT0_5) 154 #define ADC12_A_CYCLEHOLD_128_CYCLES (ADC12SHT0_6) 155 #define ADC12_A_CYCLEHOLD_192_CYCLES (ADC12SHT0_7) 156 #define ADC12_A_CYCLEHOLD_256_CYCLES (ADC12SHT0_8) 157 #define ADC12_A_CYCLEHOLD_384_CYCLES (ADC12SHT0_9) 158 #define ADC12_A_CYCLEHOLD_512_CYCLES (ADC12SHT0_10) 159 #define ADC12_A_CYCLEHOLD_768_CYCLES (ADC12SHT0_11) 160 #define ADC12_A_CYCLEHOLD_1024_CYCLES (ADC12SHT0_12) 168 #define ADC12_A_MULTIPLESAMPLESDISABLE (!(ADC12MSC)) 169 #define ADC12_A_MULTIPLESAMPLESENABLE (ADC12MSC) 177 #define ADC12_A_VREFPOS_AVCC (!(ADC12SREF0 + ADC12SREF1)) 178 #define ADC12_A_VREFPOS_EXT (ADC12SREF1) 179 #define ADC12_A_VREFPOS_INT (ADC12SREF0) 187 #define ADC12_A_VREFNEG_AVSS (!(ADC12SREF2)) 188 #define ADC12_A_VREFNEG_EXT (ADC12SREF2) 196 #define ADC12_A_NOTENDOFSEQUENCE (!(ADC12EOS)) 197 #define ADC12_A_ENDOFSEQUENCE (ADC12EOS) 205 #define ADC12_A_INPUT_A0 (ADC12INCH_0) 206 #define ADC12_A_INPUT_A1 (ADC12INCH_1) 207 #define ADC12_A_INPUT_A2 (ADC12INCH_2) 208 #define ADC12_A_INPUT_A3 (ADC12INCH_3) 209 #define ADC12_A_INPUT_A4 (ADC12INCH_4) 210 #define ADC12_A_INPUT_A5 (ADC12INCH_5) 211 #define ADC12_A_INPUT_A6 (ADC12INCH_6) 212 #define ADC12_A_INPUT_A7 (ADC12INCH_7) 213 #define ADC12_A_INPUT_A8 (ADC12INCH_8) 214 #define ADC12_A_INPUT_A9 (ADC12INCH_9) 215 #define ADC12_A_INPUT_TEMPSENSOR (ADC12INCH_10) 216 #define ADC12_A_INPUT_BATTERYMONITOR (ADC12INCH_11) 217 #define ADC12_A_INPUT_A12 (ADC12INCH_12) 218 #define ADC12_A_INPUT_A13 (ADC12INCH_13) 219 #define ADC12_A_INPUT_A14 (ADC12INCH_14) 220 #define ADC12_A_INPUT_A15 (ADC12INCH_15) 231 #define ADC12_A_MEMORY_0 (0x0) 232 #define ADC12_A_MEMORY_1 (0x1) 233 #define ADC12_A_MEMORY_2 (0x2) 234 #define ADC12_A_MEMORY_3 (0x3) 235 #define ADC12_A_MEMORY_4 (0x4) 236 #define ADC12_A_MEMORY_5 (0x5) 237 #define ADC12_A_MEMORY_6 (0x6) 238 #define ADC12_A_MEMORY_7 (0x7) 239 #define ADC12_A_MEMORY_8 (0x8) 240 #define ADC12_A_MEMORY_9 (0x9) 241 #define ADC12_A_MEMORY_10 (0xA) 242 #define ADC12_A_MEMORY_11 (0xB) 243 #define ADC12_A_MEMORY_12 (0xC) 244 #define ADC12_A_MEMORY_13 (0xD) 245 #define ADC12_A_MEMORY_14 (0xE) 246 #define ADC12_A_MEMORY_15 (0xF) 255 #define ADC12_A_IFG0 (ADC12IFG0) 256 #define ADC12_A_IFG1 (ADC12IFG1) 257 #define ADC12_A_IFG2 (ADC12IFG2) 258 #define ADC12_A_IFG3 (ADC12IFG3) 259 #define ADC12_A_IFG4 (ADC12IFG4) 260 #define ADC12_A_IFG5 (ADC12IFG5) 261 #define ADC12_A_IFG6 (ADC12IFG6) 262 #define ADC12_A_IFG7 (ADC12IFG7) 263 #define ADC12_A_IFG8 (ADC12IFG8) 264 #define ADC12_A_IFG9 (ADC12IFG9) 265 #define ADC12_A_IFG10 (ADC12IFG10) 266 #define ADC12_A_IFG11 (ADC12IFG11) 267 #define ADC12_A_IFG12 (ADC12IFG12) 268 #define ADC12_A_IFG13 (ADC12IFG13) 269 #define ADC12_A_IFG14 (ADC12IFG14) 270 #define ADC12_A_IFG15 (ADC12IFG15) 279 #define ADC12_A_SINGLECHANNEL (ADC12CONSEQ_0) 280 #define ADC12_A_SEQOFCHANNELS (ADC12CONSEQ_1) 281 #define ADC12_A_REPEATED_SINGLECHANNEL (ADC12CONSEQ_2) 282 #define ADC12_A_REPEATED_SEQOFCHANNELS (ADC12CONSEQ_3) 290 #define ADC12_A_COMPLETECONVERSION false 291 #define ADC12_A_PREEMPTCONVERSION true 299 #define ADC12_A_RESOLUTION_8BIT (ADC12RES_0) 300 #define ADC12_A_RESOLUTION_10BIT (ADC12RES_1) 301 #define ADC12_A_RESOLUTION_12BIT (ADC12RES_2) 309 #define ADC12_A_NONINVERTEDSIGNAL (!(ADC12ISSH)) 310 #define ADC12_A_INVERTEDSIGNAL (ADC12ISSH) 318 #define ADC12_A_UNSIGNED_BINARY (!(ADC12DF)) 319 #define ADC12_A_SIGNED_2SCOMPLEMENT (ADC12DF) 327 #define ADC12_A_MAXSAMPLINGRATE_200KSPS (!(ADC12SR)) 328 #define ADC12_A_MAXSAMPLINGRATE_50KSPS (ADC12SR) 336 #define ADC12_A_NOTBUSY 0x00 337 #define ADC12_A_BUSY ADC12BUSY 345 #define ADC12_A_IE0 (ADC12IE0) 346 #define ADC12_A_IE1 (ADC12IE1) 347 #define ADC12_A_IE2 (ADC12IE2) 348 #define ADC12_A_IE3 (ADC12IE3) 349 #define ADC12_A_IE4 (ADC12IE4) 350 #define ADC12_A_IE5 (ADC12IE5) 351 #define ADC12_A_IE6 (ADC12IE6) 352 #define ADC12_A_IE7 (ADC12IE7) 353 #define ADC12_A_IE8 (ADC12IE8) 354 #define ADC12_A_IE9 (ADC12IE9) 355 #define ADC12_A_IE10 (ADC12IE10) 356 #define ADC12_A_IE11 (ADC12IE11) 357 #define ADC12_A_IE12 (ADC12IE12) 358 #define ADC12_A_IE13 (ADC12IE13) 359 #define ADC12_A_IE14 (ADC12IE14) 360 #define ADC12_A_IE15 (ADC12IE15) 361 #define ADC12_A_OVERFLOW_IE ((uint32_t)ADC12OVIE << 16) 362 #define ADC12_A_CONVERSION_TIME_OVERFLOW_IE ((uint32_t)ADC12TOVIE << 16) 431 uint16_t sampleHoldSignalSourceSelect,
432 uint8_t clockSourceSelect,
433 uint16_t clockSourceDivider);
527 uint16_t clockCycleHoldCountLowMem,
528 uint16_t clockCycleHoldCountHighMem,
529 uint16_t multipleSamplesEnabled);
606 uint32_t interruptMask);
644 uint32_t interruptMask);
683 uint16_t memoryInterruptFlagMask);
718 uint16_t memoryInterruptFlagMask);
782 uint16_t startingMemoryBufferIndex,
783 uint8_t conversionSequenceModeSelect);
853 uint8_t memoryBufferIndex);
874 uint8_t resolutionSelect);
900 uint16_t invertedSignal);
925 uint8_t readBackFormat);
975 uint8_t samplingRateSelect);
1009 uint8_t memoryIndex);
1038 #endif // __MSP430WARE_ADC12_A_H__ uint32_t ADC12_A_getMemoryAddressForDMA(uint16_t baseAddress, uint8_t memoryIndex)
Returns the address of the specified memory buffer for the DMA module.
Definition: adc12_a.c:223
void ADC12_A_disableSamplingTimer(uint16_t baseAddress)
Disables Sampling Timer Pulse Mode.
Definition: adc12_a.c:81
void ADC12_A_enableReferenceBurst(uint16_t baseAddress)
Enables the reference buffer's burst ability.
Definition: adc12_a.c:206
void ADC12_A_setResolution(uint16_t baseAddress, uint8_t resolutionSelect)
Use to change the resolution of the converted data.
Definition: adc12_a.c:185
void ADC12_A_enableInterrupt(uint16_t baseAddress, uint32_t interruptMask)
Enables selected ADC12_A interrupt sources.
Definition: adc12_a.c:107
void ADC12_A_startConversion(uint16_t baseAddress, uint16_t startingMemoryBufferIndex, uint8_t conversionSequenceModeSelect)
Enables/Starts an Analog-to-Digital Conversion.
Definition: adc12_a.c:149
void ADC12_A_enable(uint16_t baseAddress)
Enables the ADC12_A block.
Definition: adc12_a.c:51
void ADC12_A_setSampleHoldSignalInversion(uint16_t baseAddress, uint16_t invertedSignal)
Use to invert or un-invert the sample/hold signal.
Definition: adc12_a.c:192
bool ADC12_A_init(uint16_t baseAddress, uint16_t sampleHoldSignalSourceSelect, uint8_t clockSourceSelect, uint16_t clockSourceDivider)
Initializes the ADC12_A Module.
Definition: adc12_a.c:21
void ADC12_A_clearInterrupt(uint16_t baseAddress, uint16_t memoryInterruptFlagMask)
Clears ADC12_A selected interrupt flags.
Definition: adc12_a.c:137
void ADC12_A_configureMemory(uint16_t baseAddress, ADC12_A_configureMemoryParam *param)
Configures the controls of the selected memory buffer.
Definition: adc12_a.c:87
void ADC12_A_setDataReadBackFormat(uint16_t baseAddress, uint8_t readBackFormat)
Use to set the read-back format of the converted data.
Definition: adc12_a.c:199
void ADC12_A_disableConversions(uint16_t baseAddress, bool preempt)
Disables the ADC from converting any more signals.
Definition: adc12_a.c:164
uint16_t ADC12_A_isBusy(uint16_t baseAddress)
Returns the busy status of the ADC12_A core.
Definition: adc12_a.c:229
uint16_t ADC12_A_getResults(uint16_t baseAddress, uint8_t memoryBufferIndex)
A Signed Integer of the contents of the specified memory buffer.
Definition: adc12_a.c:179
void ADC12_A_disableInterrupt(uint16_t baseAddress, uint32_t interruptMask)
Disables selected ADC12_A interrupt sources.
Definition: adc12_a.c:122
void ADC12_A_disable(uint16_t baseAddress)
Disables the ADC12_A block.
Definition: adc12_a.c:57
void ADC12_A_setReferenceBufferSamplingRate(uint16_t baseAddress, uint8_t samplingRateSelect)
Use to set the reference buffer's sampling rate.
Definition: adc12_a.c:216
uint16_t ADC12_A_getInterruptStatus(uint16_t baseAddress, uint16_t memoryInterruptFlagMask)
Returns the status of the selected memory interrupt flags.
Definition: adc12_a.c:143
void ADC12_A_disableReferenceBurst(uint16_t baseAddress)
Disables the reference buffer's burst ability.
Definition: adc12_a.c:211
void ADC12_A_setupSamplingTimer(uint16_t baseAddress, uint16_t clockCycleHoldCountLowMem, uint16_t clockCycleHoldCountHighMem, uint16_t multipleSamplesEnabled)
Sets up and enables the Sampling Timer Pulse Mode.
Definition: adc12_a.c:63