MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
adc12_b

Functions

bool ADC12_B_init (uint16_t baseAddress, ADC12_B_initParam *param)
 Initializes the ADC12B Module. More...
 
void ADC12_B_enable (uint16_t baseAddress)
 Enables the ADC12B block. More...
 
void ADC12_B_disable (uint16_t baseAddress)
 Disables the ADC12B block. More...
 
void ADC12_B_setupSamplingTimer (uint16_t baseAddress, uint16_t clockCycleHoldCountLowMem, uint16_t clockCycleHoldCountHighMem, uint16_t multipleSamplesEnabled)
 Sets up and enables the Sampling Timer Pulse Mode. More...
 
void ADC12_B_disableSamplingTimer (uint16_t baseAddress)
 Disables Sampling Timer Pulse Mode. More...
 
void ADC12_B_configureMemory (uint16_t baseAddress, ADC12_B_configureMemoryParam *param)
 Configures the controls of the selected memory buffer. More...
 
void ADC12_B_setWindowCompAdvanced (uint16_t baseAddress, uint16_t highThreshold, uint16_t lowThreshold)
 Sets the high and low threshold for the window comparator feature. More...
 
void ADC12_B_enableInterrupt (uint16_t baseAddress, uint16_t interruptMask0, uint16_t interruptMask1, uint16_t interruptMask2)
 Enables selected ADC12B interrupt sources. More...
 
void ADC12_B_disableInterrupt (uint16_t baseAddress, uint16_t interruptMask0, uint16_t interruptMask1, uint16_t interruptMask2)
 Disables selected ADC12B interrupt sources. More...
 
void ADC12_B_clearInterrupt (uint16_t baseAddress, uint8_t interruptRegisterChoice, uint16_t memoryInterruptFlagMask)
 Clears ADC12B selected interrupt flags. More...
 
uint16_t ADC12_B_getInterruptStatus (uint16_t baseAddress, uint8_t interruptRegisterChoice, uint16_t memoryInterruptFlagMask)
 Returns the status of the selected memory interrupt flags. More...
 
void ADC12_B_startConversion (uint16_t baseAddress, uint16_t startingMemoryBufferIndex, uint8_t conversionSequenceModeSelect)
 Enables/Starts an Analog-to-Digital Conversion. More...
 
void ADC12_B_disableConversions (uint16_t baseAddress, bool preempt)
 Disables the ADC from converting any more signals. More...
 
uint16_t ADC12_B_getResults (uint16_t baseAddress, uint8_t memoryBufferIndex)
 Returns the raw contents of the specified memory buffer. More...
 
void ADC12_B_setResolution (uint16_t baseAddress, uint8_t resolutionSelect)
 Use to change the resolution of the converted data. More...
 
void ADC12_B_setSampleHoldSignalInversion (uint16_t baseAddress, uint16_t invertedSignal)
 Use to invert or un-invert the sample/hold signal. More...
 
void ADC12_B_setDataReadBackFormat (uint16_t baseAddress, uint8_t readBackFormat)
 Use to set the read-back format of the converted data. More...
 
void ADC12_B_setAdcPowerMode (uint16_t baseAddress, uint8_t powerMode)
 Use to set the ADC's power conservation mode if the sampling rate is at 50-ksps or less. More...
 
uint32_t ADC12_B_getMemoryAddressForDMA (uint16_t baseAddress, uint8_t memoryIndex)
 Returns the address of the specified memory buffer for the DMA module. More...
 
uint8_t ADC12_B_isBusy (uint16_t baseAddress)
 Returns the busy status of the ADC12B core. More...
 

Detailed Description

Function Documentation

void ADC12_B_clearInterrupt ( uint16_t  baseAddress,
uint8_t  interruptRegisterChoice,
uint16_t  memoryInterruptFlagMask 
)

Clears ADC12B selected interrupt flags.

Modified registers are ADC12IFG .

Parameters
baseAddressis the base address of the ADC12B module.
interruptRegisterChoiceis either 0, 1, or 2, to choose the correct interrupt register to update
memoryInterruptFlagMaskis the bit mask of the memory buffer and overflow interrupt flags to be cleared. Valid values are:
  • ADC12_B_IFG0 - interruptRegisterChoice = 0
  • ADC12_B_IFG1
  • ADC12_B_IFG2
  • ADC12_B_IFG3
  • ADC12_B_IFG4
  • ADC12_B_IFG5
  • ADC12_B_IFG6
  • ADC12_B_IFG7
  • ADC12_B_IFG8
  • ADC12_B_IFG9
  • ADC12_B_IFG10
  • ADC12_B_IFG11
  • ADC12_B_IFG12
  • ADC12_B_IFG13
  • ADC12_B_IFG14
  • ADC12_B_IFG15
  • ADC12_B_IFG16 - interruptRegisterChoice = 1
  • ADC12_B_IFG17
  • ADC12_B_IFG18
  • ADC12_B_IFG19
  • ADC12_B_IFG20
  • ADC12_B_IFG21
  • ADC12_B_IFG22
  • ADC12_B_IFG23
  • ADC12_B_IFG24
  • ADC12_B_IFG25
  • ADC12_B_IFG26
  • ADC12_B_IFG27
  • ADC12_B_IFG28
  • ADC12_B_IFG29
  • ADC12_B_IFG30
  • ADC12_B_IFG31
  • ADC12_B_INIFG - interruptRegisterChoice = 2
  • ADC12_B_LOIFG
  • ADC12_B_HIIFG
  • ADC12_B_OVIFG
  • ADC12_B_TOVIFG
  • ADC12_B_RDYIFG - The selected ADC12B interrupt flags are cleared, so that it no longer asserts. The memory buffer interrupt flags are only cleared when the memory buffer is accessed. Note that the overflow interrupts do not have an interrupt flag to clear; they must be accessed directly from the interrupt vector.
Returns
None
void ADC12_B_configureMemory ( uint16_t  baseAddress,
ADC12_B_configureMemoryParam param 
)

Configures the controls of the selected memory buffer.

Maps an input signal conversion into the selected memory buffer, as well as the positive and negative reference voltages for each conversion being stored into this memory buffer. If the internal reference is used for the positive reference voltage, the internal REF module must be used to control the voltage level. Note that if a conversion has been started with the startConversion() function, then a call to disableConversions() is required before this function may be called.

Parameters
baseAddressis the base address of the ADC12B module.
paramis the pointer to struct for ADC12B memory configuration.
Returns
None

References ADC12_B_configureMemoryParam::differentialModeSelect, ADC12_B_configureMemoryParam::endOfSequence, ADC12_B_configureMemoryParam::inputSourceSelect, ADC12_B_configureMemoryParam::memoryBufferControlIndex, ADC12_B_configureMemoryParam::refVoltageSourceSelect, and ADC12_B_configureMemoryParam::windowComparatorSelect.

void ADC12_B_disable ( uint16_t  baseAddress)

Disables the ADC12B block.

This will disable operation of the ADC12B block.

Parameters
baseAddressis the base address of the ADC12B module.

Modified bits are ADC12ON of ADC12CTL0 register.

Returns
None
void ADC12_B_disableConversions ( uint16_t  baseAddress,
bool  preempt 
)

Disables the ADC from converting any more signals.

Disables the ADC from converting any more signals. If there is a conversion in progress, this function can stop it immediately if the preempt parameter is set as ADC12_B_PREEMPTCONVERSION, by changing the conversion mode to single-channel, single-conversion and disabling conversions. If the conversion mode is set as single-channel, single-conversion and this function is called without preemption, then the ADC core conversion status is polled until the conversion is complete before disabling conversions to prevent unpredictable data. If the ADC12_B_startConversion() has been called, then this function has to be called to re-initialize the ADC, reconfigure a memory buffer control, enable/disable the sampling pulse mode, or change the internal reference voltage.

Parameters
baseAddressis the base address of the ADC12B module.
preemptspecifies if the current conversion should be preemptively stopped before the end of the conversion. Valid values are:
  • ADC12_B_COMPLETECONVERSION - Allows the ADC12B to end the current conversion before disabling conversions.
  • ADC12_B_PREEMPTCONVERSION - Stops the ADC12B immediately, with unpredictable results of the current conversion.

Modified bits of ADC12CTL1 register and bits of ADC12CTL0 register.

Returns
None

References ADC12_B_isBusy().

void ADC12_B_disableInterrupt ( uint16_t  baseAddress,
uint16_t  interruptMask0,
uint16_t  interruptMask1,
uint16_t  interruptMask2 
)

Disables selected ADC12B interrupt sources.

Disables the indicated ADC12B interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

Parameters
baseAddressis the base address of the ADC12B module.
interruptMask0is the bit mask of the memory buffer and overflow interrupt sources to be disabled. If the desired interrupt is not available in the selection for interruptMask0, then simply pass in a '0' for this value. Valid values are:
  • ADC12_B_IE0
  • ADC12_B_IE1
  • ADC12_B_IE2
  • ADC12_B_IE3
  • ADC12_B_IE4
  • ADC12_B_IE5
  • ADC12_B_IE6
  • ADC12_B_IE7
  • ADC12_B_IE8
  • ADC12_B_IE9
  • ADC12_B_IE10
  • ADC12_B_IE11
  • ADC12_B_IE12
  • ADC12_B_IE13
  • ADC12_B_IE14
  • ADC12_B_IE15
interruptMask1is the bit mask of the memory buffer and overflow interrupt sources to be disabled. If the desired interrupt is not available in the selection for interruptMask1, then simply pass in a '0' for this value. Valid values are:
  • ADC12_B_IE16
  • ADC12_B_IE17
  • ADC12_B_IE18
  • ADC12_B_IE19
  • ADC12_B_IE20
  • ADC12_B_IE21
  • ADC12_B_IE22
  • ADC12_B_IE23
  • ADC12_B_IE24
  • ADC12_B_IE25
  • ADC12_B_IE26
  • ADC12_B_IE27
  • ADC12_B_IE28
  • ADC12_B_IE29
  • ADC12_B_IE30
  • ADC12_B_IE31
interruptMask2is the bit mask of the memory buffer and overflow interrupt sources to be disabled. If the desired interrupt is not available in the selection for interruptMask2, then simply pass in a '0' for this value. Valid values are:
  • ADC12_B_INIE - Interrupt enable for a conversion in the result register is either greater than the ADC12LO or lower than the ADC12HI threshold. GIE bit must be set to enable the interrupt.
  • ADC12_B_LOIE - Interrupt enable for the falling short of the lower limit interrupt of the window comparator for the result register. GIE bit must be set to enable the interrupt.
  • ADC12_B_HIIE - Interrupt enable for the exceeding the upper limit of the window comparator for the result register. GIE bit must be set to enable the interrupt.
  • ADC12_B_OVIE - Interrupt enable for a conversion that is about to save to a memory buffer that has not been read out yet. GIE bit must be set to enable the interrupt.
  • ADC12_B_TOVIE - enable for a conversion that is about to start before the previous conversion has been completed. GIE bit must be set to enable the interrupt.
  • ADC12_B_RDYIE - enable for the local buffered reference ready signal. GIE bit must be set to enable the interrupt.

Modified bits of ADC12IERx register.

Returns
None
void ADC12_B_disableSamplingTimer ( uint16_t  baseAddress)

Disables Sampling Timer Pulse Mode.

Disables the Sampling Timer Pulse Mode. Note that if a conversion has been started with the startConversion() function, then a call to disableConversions() is required before this function may be called.

Parameters
baseAddressis the base address of the ADC12B module.
Returns
None
void ADC12_B_enable ( uint16_t  baseAddress)

Enables the ADC12B block.

This will enable operation of the ADC12B block.

Parameters
baseAddressis the base address of the ADC12B module.

Modified bits are ADC12ON of ADC12CTL0 register.

Returns
None
void ADC12_B_enableInterrupt ( uint16_t  baseAddress,
uint16_t  interruptMask0,
uint16_t  interruptMask1,
uint16_t  interruptMask2 
)

Enables selected ADC12B interrupt sources.

Enables the indicated ADC12B interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.

Parameters
baseAddressis the base address of the ADC12B module.
interruptMask0is the bit mask of the memory buffer and overflow interrupt sources to be enabled. If the desired interrupt is not available in the selection for interruptMask0, then simply pass in a '0' for this value. Valid values are:
  • ADC12_B_IE0
  • ADC12_B_IE1
  • ADC12_B_IE2
  • ADC12_B_IE3
  • ADC12_B_IE4
  • ADC12_B_IE5
  • ADC12_B_IE6
  • ADC12_B_IE7
  • ADC12_B_IE8
  • ADC12_B_IE9
  • ADC12_B_IE10
  • ADC12_B_IE11
  • ADC12_B_IE12
  • ADC12_B_IE13
  • ADC12_B_IE14
  • ADC12_B_IE15
interruptMask1is the bit mask of the memory buffer and overflow interrupt sources to be enabled. If the desired interrupt is not available in the selection for interruptMask1, then simply pass in a '0' for this value. Valid values are:
  • ADC12_B_IE16
  • ADC12_B_IE17
  • ADC12_B_IE18
  • ADC12_B_IE19
  • ADC12_B_IE20
  • ADC12_B_IE21
  • ADC12_B_IE22
  • ADC12_B_IE23
  • ADC12_B_IE24
  • ADC12_B_IE25
  • ADC12_B_IE26
  • ADC12_B_IE27
  • ADC12_B_IE28
  • ADC12_B_IE29
  • ADC12_B_IE30
  • ADC12_B_IE31
interruptMask2is the bit mask of the memory buffer and overflow interrupt sources to be enabled. If the desired interrupt is not available in the selection for interruptMask2, then simply pass in a '0' for this value. Valid values are:
  • ADC12_B_INIE - Interrupt enable for a conversion in the result register is either greater than the ADC12LO or lower than the ADC12HI threshold. GIE bit must be set to enable the interrupt.
  • ADC12_B_LOIE - Interrupt enable for the falling short of the lower limit interrupt of the window comparator for the result register. GIE bit must be set to enable the interrupt.
  • ADC12_B_HIIE - Interrupt enable for the exceeding the upper limit of the window comparator for the result register. GIE bit must be set to enable the interrupt.
  • ADC12_B_OVIE - Interrupt enable for a conversion that is about to save to a memory buffer that has not been read out yet. GIE bit must be set to enable the interrupt.
  • ADC12_B_TOVIE - enable for a conversion that is about to start before the previous conversion has been completed. GIE bit must be set to enable the interrupt.
  • ADC12_B_RDYIE - enable for the local buffered reference ready signal. GIE bit must be set to enable the interrupt.

Modified bits of ADC12IERx register.

Returns
None

uint16_t ADC12_B_getInterruptStatus ( uint16_t  baseAddress,
uint8_t  interruptRegisterChoice,
uint16_t  memoryInterruptFlagMask 
)

Returns the status of the selected memory interrupt flags.

Returns the status of the selected memory interrupt flags. Note that the overflow interrupts do not have an interrupt flag to clear; they must be accessed directly from the interrupt vector.

Parameters
baseAddressis the base address of the ADC12B module.
interruptRegisterChoiceis either 0, 1, or 2, to choose the correct interrupt register to update
memoryInterruptFlagMaskis the bit mask of the memory buffer and overflow interrupt flags to be cleared. Valid values are:
  • ADC12_B_IFG0 - interruptRegisterChoice = 0
  • ADC12_B_IFG1
  • ADC12_B_IFG2
  • ADC12_B_IFG3
  • ADC12_B_IFG4
  • ADC12_B_IFG5
  • ADC12_B_IFG6
  • ADC12_B_IFG7
  • ADC12_B_IFG8
  • ADC12_B_IFG9
  • ADC12_B_IFG10
  • ADC12_B_IFG11
  • ADC12_B_IFG12
  • ADC12_B_IFG13
  • ADC12_B_IFG14
  • ADC12_B_IFG15
  • ADC12_B_IFG16 - interruptRegisterChoice = 1
  • ADC12_B_IFG17
  • ADC12_B_IFG18
  • ADC12_B_IFG19
  • ADC12_B_IFG20
  • ADC12_B_IFG21
  • ADC12_B_IFG22
  • ADC12_B_IFG23
  • ADC12_B_IFG24
  • ADC12_B_IFG25
  • ADC12_B_IFG26
  • ADC12_B_IFG27
  • ADC12_B_IFG28
  • ADC12_B_IFG29
  • ADC12_B_IFG30
  • ADC12_B_IFG31
  • ADC12_B_INIFG - interruptRegisterChoice = 2
  • ADC12_B_LOIFG
  • ADC12_B_HIIFG
  • ADC12_B_OVIFG
  • ADC12_B_TOVIFG
  • ADC12_B_RDYIFG - The selected ADC12B interrupt flags are cleared, so that it no longer asserts. The memory buffer interrupt flags are only cleared when the memory buffer is accessed. Note that the overflow interrupts do not have an interrupt flag to clear; they must be accessed directly from the interrupt vector.
Returns
The current interrupt flag status for the corresponding mask.
uint32_t ADC12_B_getMemoryAddressForDMA ( uint16_t  baseAddress,
uint8_t  memoryIndex 
)

Returns the address of the specified memory buffer for the DMA module.

Returns the address of the specified memory buffer. This can be used in conjunction with the DMA to store the converted data directly to memory.

Parameters
baseAddressis the base address of the ADC12B module.
memoryIndexis the memory buffer to return the address of. Valid values are:
  • ADC12_B_MEMORY_0
  • ADC12_B_MEMORY_1
  • ADC12_B_MEMORY_2
  • ADC12_B_MEMORY_3
  • ADC12_B_MEMORY_4
  • ADC12_B_MEMORY_5
  • ADC12_B_MEMORY_6
  • ADC12_B_MEMORY_7
  • ADC12_B_MEMORY_8
  • ADC12_B_MEMORY_9
  • ADC12_B_MEMORY_10
  • ADC12_B_MEMORY_11
  • ADC12_B_MEMORY_12
  • ADC12_B_MEMORY_13
  • ADC12_B_MEMORY_14
  • ADC12_B_MEMORY_15
  • ADC12_B_MEMORY_16
  • ADC12_B_MEMORY_17
  • ADC12_B_MEMORY_18
  • ADC12_B_MEMORY_19
  • ADC12_B_MEMORY_20
  • ADC12_B_MEMORY_21
  • ADC12_B_MEMORY_22
  • ADC12_B_MEMORY_23
  • ADC12_B_MEMORY_24
  • ADC12_B_MEMORY_25
  • ADC12_B_MEMORY_26
  • ADC12_B_MEMORY_27
  • ADC12_B_MEMORY_28
  • ADC12_B_MEMORY_29
  • ADC12_B_MEMORY_30
  • ADC12_B_MEMORY_31
Returns
address of the specified memory buffer
uint16_t ADC12_B_getResults ( uint16_t  baseAddress,
uint8_t  memoryBufferIndex 
)

Returns the raw contents of the specified memory buffer.

Returns the raw contents of the specified memory buffer. The format of the content depends on the read-back format of the data: if the data is in signed 2's complement format then the contents in the memory buffer will be left-justified with the least-significant bits as 0's, whereas if the data is in unsigned format then the contents in the memory buffer will be right- justified with the most-significant bits as 0's.

Parameters
baseAddressis the base address of the ADC12B module.
memoryBufferIndexis the specified memory buffer to read. Valid values are:
  • ADC12_B_MEMORY_0
  • ADC12_B_MEMORY_1
  • ADC12_B_MEMORY_2
  • ADC12_B_MEMORY_3
  • ADC12_B_MEMORY_4
  • ADC12_B_MEMORY_5
  • ADC12_B_MEMORY_6
  • ADC12_B_MEMORY_7
  • ADC12_B_MEMORY_8
  • ADC12_B_MEMORY_9
  • ADC12_B_MEMORY_10
  • ADC12_B_MEMORY_11
  • ADC12_B_MEMORY_12
  • ADC12_B_MEMORY_13
  • ADC12_B_MEMORY_14
  • ADC12_B_MEMORY_15
  • ADC12_B_MEMORY_16
  • ADC12_B_MEMORY_17
  • ADC12_B_MEMORY_18
  • ADC12_B_MEMORY_19
  • ADC12_B_MEMORY_20
  • ADC12_B_MEMORY_21
  • ADC12_B_MEMORY_22
  • ADC12_B_MEMORY_23
  • ADC12_B_MEMORY_24
  • ADC12_B_MEMORY_25
  • ADC12_B_MEMORY_26
  • ADC12_B_MEMORY_27
  • ADC12_B_MEMORY_28
  • ADC12_B_MEMORY_29
  • ADC12_B_MEMORY_30
  • ADC12_B_MEMORY_31
Returns
A signed integer of the contents of the specified memory buffer.
bool ADC12_B_init ( uint16_t  baseAddress,
ADC12_B_initParam param 
)

Initializes the ADC12B Module.

This function initializes the ADC module to allow for analog-to-digital conversions. Specifically this function sets up the sample-and-hold signal and clock sources for the ADC core to use for conversions. Upon successful completion of the initialization all of the ADC control registers will be reset, excluding the memory controls and reference module bits, the given parameters will be set, and the ADC core will be turned on (Note, that the ADC core only draws power during conversions and remains off when not converting).Note that sample/hold signal sources are device dependent. Note that if re-initializing the ADC after starting a conversion with the startConversion() function, the disableConversion() must be called BEFORE this function can be called.

Parameters
baseAddressis the base address of the ADC12B module.
paramis the pointer to struct for initialization.
Returns
STATUS_SUCCESS or STATUS_FAILURE of the initialization process.

References ADC12_B_initParam::clockSourceDivider, ADC12_B_initParam::clockSourcePredivider, ADC12_B_initParam::clockSourceSelect, ADC12_B_initParam::internalChannelMap, and ADC12_B_initParam::sampleHoldSignalSourceSelect.

uint8_t ADC12_B_isBusy ( uint16_t  baseAddress)

Returns the busy status of the ADC12B core.

Returns the status of the ADC core if there is a conversion currently taking place.

Parameters
baseAddressis the base address of the ADC12B module.
Returns
ADC12_B_BUSY or ADC12_B_NOTBUSY dependent if there is a conversion currently taking place. Return one of the following:
  • ADC12_B_NOTBUSY
  • ADC12_B_BUSY
    indicating if a conversion is taking place

Referenced by ADC12_B_disableConversions().

void ADC12_B_setAdcPowerMode ( uint16_t  baseAddress,
uint8_t  powerMode 
)

Use to set the ADC's power conservation mode if the sampling rate is at 50-ksps or less.

Sets ADC's power mode. If the user has a sampling rate greater than 50-ksps, then he/she can only enable ADC12_B_REGULARPOWERMODE. If the sampling rate is 50-ksps or less, the user can enable ADC12_B_LOWPOWERMODE granting additional power savings.

Parameters
baseAddressis the base address of the ADC12B module.
powerModeis the specified maximum sampling rate. Valid values are:
  • ADC12_B_REGULARPOWERMODE [Default] - If sampling rate is greater than 50-ksps, there is no power saving feature available.
  • ADC12_B_LOWPOWERMODE - If sampling rate is less than or equal to 50-ksps, select this value to save power
    Modified bits are ADC12SR of ADC12CTL2 register.
Returns
None
void ADC12_B_setDataReadBackFormat ( uint16_t  baseAddress,
uint8_t  readBackFormat 
)

Use to set the read-back format of the converted data.

Sets the format of the converted data: how it will be stored into the memory buffer, and how it should be read back. The format can be set as right-justified (default), which indicates that the number will be unsigned, or left-justified, which indicates that the number will be signed in 2's complement format. This change affects all memory buffers for subsequent conversions.

Parameters
baseAddressis the base address of the ADC12B module.
readBackFormatis the specified format to store the conversions in the memory buffer. Valid values are:
  • ADC12_B_UNSIGNED_BINARY [Default]
  • ADC12_B_SIGNED_2SCOMPLEMENT
    Modified bits are ADC12DF of ADC12CTL2 register.
Returns
None
void ADC12_B_setResolution ( uint16_t  baseAddress,
uint8_t  resolutionSelect 
)

Use to change the resolution of the converted data.

This function can be used to change the resolution of the converted data from the default of 12-bits.

Parameters
baseAddressis the base address of the ADC12B module.
resolutionSelectdetermines the resolution of the converted data. Valid values are:
  • ADC12_B_RESOLUTION_8BIT
  • ADC12_B_RESOLUTION_10BIT
  • ADC12_B_RESOLUTION_12BIT [Default]
    Modified bits are ADC12RESx of ADC12CTL2 register.
Returns
None
void ADC12_B_setSampleHoldSignalInversion ( uint16_t  baseAddress,
uint16_t  invertedSignal 
)

Use to invert or un-invert the sample/hold signal.

This function can be used to invert or un-invert the sample/hold signal. Note that if a conversion has been started with the startConversion() function, then a call to disableConversions() is required before this function may be called.

Parameters
baseAddressis the base address of the ADC12B module.
invertedSignalset if the sample/hold signal should be inverted Valid values are:
  • ADC12_B_NONINVERTEDSIGNAL [Default] - a sample-and-hold of an input signal for conversion will be started on a rising edge of the sample/hold signal.
  • ADC12_B_INVERTEDSIGNAL - a sample-and-hold of an input signal for conversion will be started on a falling edge of the sample/hold signal.
    Modified bits are ADC12ISSH of ADC12CTL1 register.
Returns
None
void ADC12_B_setupSamplingTimer ( uint16_t  baseAddress,
uint16_t  clockCycleHoldCountLowMem,
uint16_t  clockCycleHoldCountHighMem,
uint16_t  multipleSamplesEnabled 
)

Sets up and enables the Sampling Timer Pulse Mode.

This function sets up the sampling timer pulse mode which allows the sample/hold signal to trigger a sampling timer to sample-and-hold an input signal for a specified number of clock cycles without having to hold the sample/hold signal for the entire period of sampling. Note that if a conversion has been started with the startConversion() function, then a call to disableConversions() is required before this function may be called.

Parameters
baseAddressis the base address of the ADC12B module.
clockCycleHoldCountLowMemsets the amount of clock cycles to sample- and-hold for the higher memory buffers 0-7. Valid values are:
  • ADC12_B_CYCLEHOLD_4_CYCLES [Default]
  • ADC12_B_CYCLEHOLD_8_CYCLES
  • ADC12_B_CYCLEHOLD_16_CYCLES
  • ADC12_B_CYCLEHOLD_32_CYCLES
  • ADC12_B_CYCLEHOLD_64_CYCLES
  • ADC12_B_CYCLEHOLD_96_CYCLES
  • ADC12_B_CYCLEHOLD_128_CYCLES
  • ADC12_B_CYCLEHOLD_192_CYCLES
  • ADC12_B_CYCLEHOLD_256_CYCLES
  • ADC12_B_CYCLEHOLD_384_CYCLES
  • ADC12_B_CYCLEHOLD_512_CYCLES
  • ADC12_B_CYCLEHOLD_768_CYCLES
  • ADC12_B_CYCLEHOLD_1024_CYCLES
    Modified bits are ADC12SHT0x of ADC12CTL0 register.
clockCycleHoldCountHighMemsets the amount of clock cycles to sample-and-hold for the higher memory buffers 8-15. Valid values are:
  • ADC12_B_CYCLEHOLD_4_CYCLES [Default]
  • ADC12_B_CYCLEHOLD_8_CYCLES
  • ADC12_B_CYCLEHOLD_16_CYCLES
  • ADC12_B_CYCLEHOLD_32_CYCLES
  • ADC12_B_CYCLEHOLD_64_CYCLES
  • ADC12_B_CYCLEHOLD_96_CYCLES
  • ADC12_B_CYCLEHOLD_128_CYCLES
  • ADC12_B_CYCLEHOLD_192_CYCLES
  • ADC12_B_CYCLEHOLD_256_CYCLES
  • ADC12_B_CYCLEHOLD_384_CYCLES
  • ADC12_B_CYCLEHOLD_512_CYCLES
  • ADC12_B_CYCLEHOLD_768_CYCLES
  • ADC12_B_CYCLEHOLD_1024_CYCLES
    Modified bits are ADC12SHT1x of ADC12CTL0 register.
multipleSamplesEnabledallows multiple conversions to start without a trigger signal from the sample/hold signal Valid values are:
  • ADC12_B_MULTIPLESAMPLESDISABLE [Default] - a timer trigger will be needed to start every ADC conversion.
  • ADC12_B_MULTIPLESAMPLESENABLE - during a sequenced and/or repeated conversion mode, after the first conversion, no sample/hold signal is necessary to start subsequent sample/hold and convert processes.
    Modified bits are ADC12MSC of ADC12CTL0 register.
Returns
None
void ADC12_B_setWindowCompAdvanced ( uint16_t  baseAddress,
uint16_t  highThreshold,
uint16_t  lowThreshold 
)

Sets the high and low threshold for the window comparator feature.

Sets the high and low threshold for the window comparator feature. Use the ADC12HIIE, ADC12INIE, ADC12LOIE interrupts to utilize this feature.

Parameters
baseAddressis the base address of the ADC12B module.
highThresholdis the upper bound that could trip an interrupt for the window comparator.
lowThresholdis the lower bound that could trip on interrupt for the window comparator.
Returns
None
void ADC12_B_startConversion ( uint16_t  baseAddress,
uint16_t  startingMemoryBufferIndex,
uint8_t  conversionSequenceModeSelect 
)

Enables/Starts an Analog-to-Digital Conversion.

Enables/starts the conversion process of the ADC. If the sample/hold signal source chosen during initialization was ADC12OSC, then the conversion is started immediately, otherwise the chosen sample/hold signal source starts the conversion by a rising edge of the signal. Keep in mind when selecting conversion modes, that for sequenced and/or repeated modes, to keep the sample/hold-and-convert process continuing without a trigger from the sample/hold signal source, the multiple samples must be enabled using the ADC12_B_setupSamplingTimer() function. Note that after this function is called, the ADC12_B_stopConversions() has to be called to re-initialize the ADC, reconfigure a memory buffer control, enable/disable the sampling timer, or to change the internal reference voltage.

Parameters
baseAddressis the base address of the ADC12B module.
startingMemoryBufferIndexis the memory buffer that will hold the first or only conversion. Valid values are:
  • ADC12_B_START_AT_ADC12MEM0 [Default]
  • ADC12_B_START_AT_ADC12MEM1
  • ADC12_B_START_AT_ADC12MEM2
  • ADC12_B_START_AT_ADC12MEM3
  • ADC12_B_START_AT_ADC12MEM4
  • ADC12_B_START_AT_ADC12MEM5
  • ADC12_B_START_AT_ADC12MEM6
  • ADC12_B_START_AT_ADC12MEM7
  • ADC12_B_START_AT_ADC12MEM8
  • ADC12_B_START_AT_ADC12MEM9
  • ADC12_B_START_AT_ADC12MEM10
  • ADC12_B_START_AT_ADC12MEM11
  • ADC12_B_START_AT_ADC12MEM12
  • ADC12_B_START_AT_ADC12MEM13
  • ADC12_B_START_AT_ADC12MEM14
  • ADC12_B_START_AT_ADC12MEM15
  • ADC12_B_START_AT_ADC12MEM16
  • ADC12_B_START_AT_ADC12MEM17
  • ADC12_B_START_AT_ADC12MEM18
  • ADC12_B_START_AT_ADC12MEM19
  • ADC12_B_START_AT_ADC12MEM20
  • ADC12_B_START_AT_ADC12MEM21
  • ADC12_B_START_AT_ADC12MEM22
  • ADC12_B_START_AT_ADC12MEM23
  • ADC12_B_START_AT_ADC12MEM24
  • ADC12_B_START_AT_ADC12MEM25
  • ADC12_B_START_AT_ADC12MEM26
  • ADC12_B_START_AT_ADC12MEM27
  • ADC12_B_START_AT_ADC12MEM28
  • ADC12_B_START_AT_ADC12MEM29
  • ADC12_B_START_AT_ADC12MEM30
  • ADC12_B_START_AT_ADC12MEM31
    Modified bits are ADC12CSTARTADDx of ADC12CTL1 register.
conversionSequenceModeSelectdetermines the ADC operating mode. Valid values are:
  • ADC12_B_SINGLECHANNEL [Default] - one-time conversion of a single channel into a single memory buffer.
  • ADC12_B_SEQOFCHANNELS - one time conversion of multiple channels into the specified starting memory buffer and each subsequent memory buffer up until the conversion is stored in a memory buffer dedicated as the end-of-sequence by the memory's control register.
  • ADC12_B_REPEATED_SINGLECHANNEL - repeated conversions of one channel into a single memory buffer.
  • ADC12_B_REPEATED_SEQOFCHANNELS - repeated conversions of multiple channels into the specified starting memory buffer and each subsequent memory buffer up until the conversion is stored in a memory buffer dedicated as the end-of-sequence by the memory's control register.
    Modified bits are ADC12CONSEQx of ADC12CTL1 register.

Modified bits of ADC12CTL1 register and bits of ADC12CTL0 register.

Returns
None

Copyright 2015, Texas Instruments Incorporated