![]() |
![]() |
CC23x0R5DriverLibrary
|
![]() |
Macros | |
#define | ADC_CLOCK_DIVIDER_1 ADC_CTL0_SCLKDIV_DIV_BY_1 |
Set ADC clock to system clock divided by 1. More... | |
#define | ADC_CLOCK_DIVIDER_2 ADC_CTL0_SCLKDIV_DIV_BY_2 |
Set ADC clock to system clock divided by 2. More... | |
#define | ADC_CLOCK_DIVIDER_4 ADC_CTL0_SCLKDIV_DIV_BY_4 |
Set ADC clock to system clock divided by 4. More... | |
#define | ADC_CLOCK_DIVIDER_8 ADC_CTL0_SCLKDIV_DIV_BY_8 |
Set ADC clock to system clock divided by 8. More... | |
#define | ADC_CLOCK_DIVIDER_16 ADC_CTL0_SCLKDIV_DIV_BY_16 |
Set ADC clock to system clock divided by 16. More... | |
#define | ADC_CLOCK_DIVIDER_24 ADC_CTL0_SCLKDIV_DIV_BY_24 |
Set ADC clock to system clock divided by 24. More... | |
#define | ADC_CLOCK_DIVIDER_32 ADC_CTL0_SCLKDIV_DIV_BY_32 |
Set ADC clock to system clock divided by 32. More... | |
#define | ADC_CLOCK_DIVIDER_48 ADC_CTL0_SCLKDIV_DIV_BY_48 |
Set ADC clock to system clock divided by 48. More... | |
#define | ADC_RESOLUTION_12_BIT ADC_CTL2_RES_BIT_12 |
Set resolution of ADC conversion to 12 bit (unsigned) More... | |
#define | ADC_RESOLUTION_10_BIT ADC_CTL2_RES_BIT_10 |
Set resolution of ADC conversion to 10 bit (unsigned) More... | |
#define | ADC_RESOLUTION_8_BIT ADC_CTL2_RES_BIT_8 |
Set resolution of ADC conversion to 8 bit (unsigned) More... | |
#define | ADC_FIXED_REFERENCE_1V4 0 |
Set ADC reference to internal fixed 1.4V. More... | |
#define | ADC_FIXED_REFERENCE_2V5 1 |
Set ADC reference to internal fixed 2.5V. More... | |
#define | ADC_EXTERNAL_REFERENCE 2 |
Set ADC reference to external analog pin A1. More... | |
#define | ADC_VDDS_REFERENCE 3 |
Set ADC reference to VDDS. More... | |
#define | ADC_POWER_DOWN_POLICY_AUTO ADC_CTL0_PWRDN_AUTO |
ADC is powered down on completion of a conversion if there is no pending trigger. To be used with ADCSetPowerDownPolicy() More... | |
#define | ADC_POWER_DOWN_POLICY_MANUAL ADC_CTL0_PWRDN_MANUAL |
ADC remains powered on as long as the power mode it set to manual. To be used with ADCSetPowerDownPolicy() More... | |
#define | ADC_SEQUENCE_REPEATSEQUENCE ADC_CTL1_CONSEQ_REPEATSEQUENCE |
Set ADC conversion sequence to repeat control registers defined by start and stop address, as set by ADCSetMemctlRange. More... | |
#define | ADC_SEQUENCE_REPEATSINGLE ADC_CTL1_CONSEQ_REPEATSINGLE |
Set ADC conversion sequence to repeat control register defined by start as set by ADCSetMemctlRange. More... | |
#define | ADC_SEQUENCE_SEQUENCE ADC_CTL1_CONSEQ_SEQUENCE |
Set ADC conversion sequence to a single pass of control registers defined by start and stop address, as set by ADCSetMemctlRange. More... | |
#define | ADC_SEQUENCE_SINGLE ADC_CTL1_CONSEQ_SINGLE |
Set ADC conversion sequence to do a single conversion of control register defined by start, as set by ADCSetMemctlRange. More... | |
#define | ADC_SAMPLE_MODE_AUTO ADC_CTL1_SAMPMODE_AUTO |
Sample duration is controlled by values set using ADCSetSampleDuration() More... | |
#define | ADC_SAMPLE_MODE_MANUAL ADC_CTL1_SAMPMODE_MANUAL |
Sample phase is manually started using ADCStartConversion() and manually stopped using ADCStopConversion() More... | |
#define | ADC_TRIGGER_SOURCE_EVENT ADC_CTL1_TRIGSRC_EVENT |
The ADC trigger source is a hardware event. More... | |
#define | ADC_TRIGGER_SOURCE_SOFTWARE ADC_CTL1_TRIGSRC_SOFTWARE |
The ADC trigger source is software. More... | |
#define | ADC_TRIGGER_POLICY_AUTO_NEXT ADC_MEMCTL0_TRG_AUTO_NEXT |
The next conversion is automatically started after the completion of the previous conversion. More... | |
#define | ADC_TRIGGER_POLICY_TRIGGER_NEXT ADC_MEMCTL0_TRG_TRIGGER_NEXT |
The next conversion requires a trigger. More... | |
#define | ADC_INT_MEMRES_23 ADC_IMASK0_MEMRESIFG23 |
Result ready in memory result register 23. More... | |
#define | ADC_INT_MEMRES_22 ADC_IMASK0_MEMRESIFG22 |
Result ready in memory result register 22. More... | |
#define | ADC_INT_MEMRES_21 ADC_IMASK0_MEMRESIFG21 |
Result ready in memory result register 21. More... | |
#define | ADC_INT_MEMRES_20 ADC_IMASK0_MEMRESIFG20 |
Result ready in memory result register 20. More... | |
#define | ADC_INT_MEMRES_19 ADC_IMASK0_MEMRESIFG19 |
Result ready in memory result register 19. More... | |
#define | ADC_INT_MEMRES_18 ADC_IMASK0_MEMRESIFG18 |
Result ready in memory result register 18. More... | |
#define | ADC_INT_MEMRES_17 ADC_IMASK0_MEMRESIFG17 |
Result ready in memory result register 17. More... | |
#define | ADC_INT_MEMRES_16 ADC_IMASK0_MEMRESIFG16 |
Result ready in memory result register 16. More... | |
#define | ADC_INT_MEMRES_15 ADC_IMASK0_MEMRESIFG15 |
Result ready in memory result register 15. More... | |
#define | ADC_INT_MEMRES_14 ADC_IMASK0_MEMRESIFG14 |
Result ready in memory result register 14. More... | |
#define | ADC_INT_MEMRES_13 ADC_IMASK0_MEMRESIFG13 |
Result ready in memory result register 13. More... | |
#define | ADC_INT_MEMRES_12 ADC_IMASK0_MEMRESIFG12 |
Result ready in memory result register 12. More... | |
#define | ADC_INT_MEMRES_11 ADC_IMASK0_MEMRESIFG11 |
Result ready in memory result register 11. More... | |
#define | ADC_INT_MEMRES_10 ADC_IMASK0_MEMRESIFG10 |
Result ready in memory result register 10. More... | |
#define | ADC_INT_MEMRES_09 ADC_IMASK0_MEMRESIFG9 |
Result ready in memory result register 9. More... | |
#define | ADC_INT_MEMRES_08 ADC_IMASK0_MEMRESIFG8 |
Result ready in memory result register 8. More... | |
#define | ADC_INT_MEMRES_07 ADC_IMASK0_MEMRESIFG7 |
Result ready in memory result register 7. More... | |
#define | ADC_INT_MEMRES_06 ADC_IMASK0_MEMRESIFG6 |
Result ready in memory result register 6. More... | |
#define | ADC_INT_MEMRES_05 ADC_IMASK0_MEMRESIFG5 |
Result ready in memory result register 5. More... | |
#define | ADC_INT_MEMRES_04 ADC_IMASK0_MEMRESIFG4 |
Result ready in memory result register 4. More... | |
#define | ADC_INT_MEMRES_03 ADC_IMASK0_MEMRESIFG3 |
Result ready in memory result register 3. More... | |
#define | ADC_INT_MEMRES_02 ADC_IMASK0_MEMRESIFG2 |
Result ready in memory result register 2. More... | |
#define | ADC_INT_MEMRES_01 ADC_IMASK0_MEMRESIFG1 |
Result ready in memory result register 1. More... | |
#define | ADC_INT_MEMRES_00 ADC_IMASK0_MEMRESIFG0 |
Result ready in memory result register 0. More... | |
#define | ADC_INT_ASCDONE ADC_IMASK0_ASCDONE |
Ad-Hoc single conversion done. More... | |
#define | ADC_INT_UVIFG ADC_IMASK0_UVIFG |
Conversion underflow. More... | |
#define | ADC_INT_DMADONE ADC_IMASK0_DMADONE |
DMA transaction done. More... | |
#define | ADC_INT_INIFG ADC_IMASK0_INIFG |
ADC result is inside window comparator range. More... | |
#define | ADC_INT_LOWIFG ADC_IMASK0_LOWIFG |
ADC result is below window comparator range. More... | |
#define | ADC_INT_HIGHIFG ADC_IMASK0_HIGHIFG |
ADC result is above window comparator range. More... | |
#define | ADC_INT_TOVIFG ADC_IMASK0_TOVIFG |
Sequence conversion timeout overflow. More... | |
#define | ADC_INT_OVIFG ADC_IMASK0_OVIFG |
Conversion overflow. More... | |
Functions | |
void | ADCSetSampleDuration (uint32_t clkDiv, uint16_t clkCycles) |
Sets the clock-divider value, and sample duration. More... | |
void | ADCSetResolution (uint32_t resolution) |
Sets the ADC bit resolution. More... | |
void | ADCSetInput (uint32_t reference, uint8_t channel, uint32_t index) |
Sets the ADC reference source and input channel. More... | |
void | ADCSetMemctlRange (uint32_t start, uint32_t stop) |
Set start and stop control registers. More... | |
void | ADCSetPowerDownPolicy (uint32_t powerDownPolicy) |
Set power down policy. More... | |
void | ADCSetSequence (uint32_t sequence) |
Set conversion sequence. More... | |
void | ADCSetSamplingMode (uint32_t samplingMode) |
Set ADC sampling mode. More... | |
void | ADCSetTriggerSource (uint32_t triggerSource) |
Set ADC trigger source. More... | |
void | ADCSetTriggerPolicy (uint32_t triggerPolicy, uint32_t index) |
Set ADC trigger policy. More... | |
__STATIC_INLINE void | ADCStartConversion (void) |
Start conversion. More... | |
__STATIC_INLINE void | ADCStopConversion (void) |
Stop sample phase of a conversion. More... | |
__STATIC_INLINE void | ADCEnableConversion (void) |
Enable conversion. More... | |
__STATIC_INLINE void | ADCDisableConversion (void) |
Disable conversion. More... | |
__STATIC_INLINE void | ADCEnableDmaTrigger (void) |
Enable DMA trigger for data transfer. More... | |
__STATIC_INLINE void | ADCDisableDmaTrigger (void) |
Disable DMA trigger for data transfer. More... | |
__STATIC_INLINE uint32_t | ADCReadResult (uint32_t index) |
Read conversion result from ADC. More... | |
__STATIC_INLINE bool | ADCIsBusy (void) |
Check if ADC is busy. More... | |
__STATIC_INLINE uint32_t | ADCReadResultNonBlocking (uint32_t index) |
Read conversion result from ADC. More... | |
uint32_t | ADCValueToMicrovolts (uint32_t adcCode, uint32_t bitResolution, uint32_t referenceVoltageMicroVolt) |
Convert ADC code to microvolts. More... | |
__STATIC_INLINE void | ADCEnableInterrupt (uint32_t intFlags) |
Enables individual ADC interrupt sources. More... | |
__STATIC_INLINE void | ADCDisableInterrupt (uint32_t intFlags) |
Disables individual ADC interrupt sources. More... | |
__STATIC_INLINE uint32_t | ADCRawInterruptStatus (void) |
Gets the current raw interrupt status. More... | |
__STATIC_INLINE uint32_t | ADCMaskedInterruptStatus (void) |
Gets the current masked interrupt status. More... | |
__STATIC_INLINE void | ADCClearInterrupt (uint32_t intFlags) |
Clears ADC interrupt sources. More... | |
uint16_t | ADCGetAdjustmentGain (uint32_t reference) |
Returns ADC gain value for given reference. More... | |
void | ADCSetAdjustmentOffset (uint32_t reference) |
Write correct offset value to ADC-peripheral trim register. More... | |
uint32_t | ADCAdjustValueForGain (uint32_t adcValue, uint32_t bitResolution, uint16_t gain) |
Performs ADC value gain adjustment. More... | |
#define ADC_CLOCK_DIVIDER_1 ADC_CTL0_SCLKDIV_DIV_BY_1 |
Set ADC clock to system clock divided by 1.
#define ADC_CLOCK_DIVIDER_2 ADC_CTL0_SCLKDIV_DIV_BY_2 |
Set ADC clock to system clock divided by 2.
#define ADC_CLOCK_DIVIDER_4 ADC_CTL0_SCLKDIV_DIV_BY_4 |
Set ADC clock to system clock divided by 4.
#define ADC_CLOCK_DIVIDER_8 ADC_CTL0_SCLKDIV_DIV_BY_8 |
Set ADC clock to system clock divided by 8.
#define ADC_CLOCK_DIVIDER_16 ADC_CTL0_SCLKDIV_DIV_BY_16 |
Set ADC clock to system clock divided by 16.
#define ADC_CLOCK_DIVIDER_24 ADC_CTL0_SCLKDIV_DIV_BY_24 |
Set ADC clock to system clock divided by 24.
#define ADC_CLOCK_DIVIDER_32 ADC_CTL0_SCLKDIV_DIV_BY_32 |
Set ADC clock to system clock divided by 32.
#define ADC_CLOCK_DIVIDER_48 ADC_CTL0_SCLKDIV_DIV_BY_48 |
Set ADC clock to system clock divided by 48.
Referenced by enableADC().
#define ADC_RESOLUTION_12_BIT ADC_CTL2_RES_BIT_12 |
Set resolution of ADC conversion to 12 bit (unsigned)
Referenced by ADCAdjustValueForGain(), ADCValueToMicrovolts(), enableADC(), and TempDiodeGetTemp().
#define ADC_RESOLUTION_10_BIT ADC_CTL2_RES_BIT_10 |
Set resolution of ADC conversion to 10 bit (unsigned)
Referenced by ADCAdjustValueForGain(), and ADCValueToMicrovolts().
#define ADC_RESOLUTION_8_BIT ADC_CTL2_RES_BIT_8 |
Set resolution of ADC conversion to 8 bit (unsigned)
Referenced by ADCAdjustValueForGain(), and ADCValueToMicrovolts().
#define ADC_FIXED_REFERENCE_1V4 0 |
Set ADC reference to internal fixed 1.4V.
Referenced by ADCGetAdjustmentGain(), ADCSetAdjustmentOffset(), ADCSetInput(), enableADC(), and TempDiodeGetTemp().
#define ADC_FIXED_REFERENCE_2V5 1 |
Set ADC reference to internal fixed 2.5V.
Referenced by ADCGetAdjustmentGain(), ADCSetAdjustmentOffset(), and ADCSetInput().
#define ADC_EXTERNAL_REFERENCE 2 |
Set ADC reference to external analog pin A1.
Referenced by ADCGetAdjustmentGain(), ADCSetAdjustmentOffset(), and ADCSetInput().
#define ADC_VDDS_REFERENCE 3 |
Set ADC reference to VDDS.
Referenced by ADCGetAdjustmentGain(), ADCSetAdjustmentOffset(), and ADCSetInput().
#define ADC_POWER_DOWN_POLICY_AUTO ADC_CTL0_PWRDN_AUTO |
ADC is powered down on completion of a conversion if there is no pending trigger. To be used with ADCSetPowerDownPolicy()
#define ADC_POWER_DOWN_POLICY_MANUAL ADC_CTL0_PWRDN_MANUAL |
ADC remains powered on as long as the power mode it set to manual. To be used with ADCSetPowerDownPolicy()
#define ADC_SEQUENCE_REPEATSEQUENCE ADC_CTL1_CONSEQ_REPEATSEQUENCE |
Set ADC conversion sequence to repeat control registers defined by start and stop address, as set by ADCSetMemctlRange.
#define ADC_SEQUENCE_REPEATSINGLE ADC_CTL1_CONSEQ_REPEATSINGLE |
Set ADC conversion sequence to repeat control register defined by start as set by ADCSetMemctlRange.
#define ADC_SEQUENCE_SEQUENCE ADC_CTL1_CONSEQ_SEQUENCE |
Set ADC conversion sequence to a single pass of control registers defined by start and stop address, as set by ADCSetMemctlRange.
#define ADC_SEQUENCE_SINGLE ADC_CTL1_CONSEQ_SINGLE |
Set ADC conversion sequence to do a single conversion of control register defined by start, as set by ADCSetMemctlRange.
Referenced by enableADC().
#define ADC_SAMPLE_MODE_AUTO ADC_CTL1_SAMPMODE_AUTO |
Sample duration is controlled by values set using ADCSetSampleDuration()
Referenced by enableADC().
#define ADC_SAMPLE_MODE_MANUAL ADC_CTL1_SAMPMODE_MANUAL |
Sample phase is manually started using ADCStartConversion() and manually stopped using ADCStopConversion()
This can only be used when the trigger source selected by ADCSetTriggerSource() is ADC_TRIGGER_SOURCE_SOFTWARE
#define ADC_TRIGGER_SOURCE_EVENT ADC_CTL1_TRIGSRC_EVENT |
The ADC trigger source is a hardware event.
Can only be used when the sample mode configured using ADCSetSamplingMode() is ADC_SAMPLE_MODE_AUTO
#define ADC_TRIGGER_SOURCE_SOFTWARE ADC_CTL1_TRIGSRC_SOFTWARE |
The ADC trigger source is software.
ADCStartConversion() is used to trigger the start of a conversion. If the sampling mode configured using ADCSetSamplingMode() is ADC_SAMPLE_MODE_MANUAL, then the sample phase must also be manually stopped using ADCStopConversion()
Referenced by enableADC().
#define ADC_TRIGGER_POLICY_AUTO_NEXT ADC_MEMCTL0_TRG_AUTO_NEXT |
The next conversion is automatically started after the completion of the previous conversion.
This means that no trigger is needed to start the next conversion.
#define ADC_TRIGGER_POLICY_TRIGGER_NEXT ADC_MEMCTL0_TRG_TRIGGER_NEXT |
The next conversion requires a trigger.
#define ADC_INT_MEMRES_23 ADC_IMASK0_MEMRESIFG23 |
Result ready in memory result register 23.
#define ADC_INT_MEMRES_22 ADC_IMASK0_MEMRESIFG22 |
Result ready in memory result register 22.
#define ADC_INT_MEMRES_21 ADC_IMASK0_MEMRESIFG21 |
Result ready in memory result register 21.
#define ADC_INT_MEMRES_20 ADC_IMASK0_MEMRESIFG20 |
Result ready in memory result register 20.
#define ADC_INT_MEMRES_19 ADC_IMASK0_MEMRESIFG19 |
Result ready in memory result register 19.
#define ADC_INT_MEMRES_18 ADC_IMASK0_MEMRESIFG18 |
Result ready in memory result register 18.
#define ADC_INT_MEMRES_17 ADC_IMASK0_MEMRESIFG17 |
Result ready in memory result register 17.
#define ADC_INT_MEMRES_16 ADC_IMASK0_MEMRESIFG16 |
Result ready in memory result register 16.
#define ADC_INT_MEMRES_15 ADC_IMASK0_MEMRESIFG15 |
Result ready in memory result register 15.
#define ADC_INT_MEMRES_14 ADC_IMASK0_MEMRESIFG14 |
Result ready in memory result register 14.
#define ADC_INT_MEMRES_13 ADC_IMASK0_MEMRESIFG13 |
Result ready in memory result register 13.
#define ADC_INT_MEMRES_12 ADC_IMASK0_MEMRESIFG12 |
Result ready in memory result register 12.
#define ADC_INT_MEMRES_11 ADC_IMASK0_MEMRESIFG11 |
Result ready in memory result register 11.
#define ADC_INT_MEMRES_10 ADC_IMASK0_MEMRESIFG10 |
Result ready in memory result register 10.
#define ADC_INT_MEMRES_09 ADC_IMASK0_MEMRESIFG9 |
Result ready in memory result register 9.
#define ADC_INT_MEMRES_08 ADC_IMASK0_MEMRESIFG8 |
Result ready in memory result register 8.
#define ADC_INT_MEMRES_07 ADC_IMASK0_MEMRESIFG7 |
Result ready in memory result register 7.
#define ADC_INT_MEMRES_06 ADC_IMASK0_MEMRESIFG6 |
Result ready in memory result register 6.
#define ADC_INT_MEMRES_05 ADC_IMASK0_MEMRESIFG5 |
Result ready in memory result register 5.
#define ADC_INT_MEMRES_04 ADC_IMASK0_MEMRESIFG4 |
Result ready in memory result register 4.
#define ADC_INT_MEMRES_03 ADC_IMASK0_MEMRESIFG3 |
Result ready in memory result register 3.
#define ADC_INT_MEMRES_02 ADC_IMASK0_MEMRESIFG2 |
Result ready in memory result register 2.
#define ADC_INT_MEMRES_01 ADC_IMASK0_MEMRESIFG1 |
Result ready in memory result register 1.
#define ADC_INT_MEMRES_00 ADC_IMASK0_MEMRESIFG0 |
Result ready in memory result register 0.
#define ADC_INT_ASCDONE ADC_IMASK0_ASCDONE |
Ad-Hoc single conversion done.
#define ADC_INT_UVIFG ADC_IMASK0_UVIFG |
Conversion underflow.
#define ADC_INT_DMADONE ADC_IMASK0_DMADONE |
DMA transaction done.
#define ADC_INT_INIFG ADC_IMASK0_INIFG |
ADC result is inside window comparator range.
#define ADC_INT_LOWIFG ADC_IMASK0_LOWIFG |
ADC result is below window comparator range.
#define ADC_INT_HIGHIFG ADC_IMASK0_HIGHIFG |
ADC result is above window comparator range.
#define ADC_INT_TOVIFG ADC_IMASK0_TOVIFG |
Sequence conversion timeout overflow.
#define ADC_INT_OVIFG ADC_IMASK0_OVIFG |
Conversion overflow.
void ADCSetSampleDuration | ( | uint32_t | clkDiv, |
uint16_t | clkCycles | ||
) |
Sets the clock-divider value, and sample duration.
This function sets the clock divider, which determines the ADC clock, derived from the system clock, and sets the duration of a sample in ADC-clock cycles
clkDiv | is the clock divider value |
clkCycles | is the duration of a sample, in ADC-clock cycles. Valid range of input is [0, 1023] |
References ADC_BASE, ADC_CTL0_SCLKDIV_M, ADC_O_CTL0, ADC_O_SCOMP0, ADC_SCOMP0_VAL_M, ASSERT, and HWREG.
Referenced by enableADC().
void ADCSetResolution | ( | uint32_t | resolution | ) |
Sets the ADC bit resolution.
This function sets the resolution of the ADC conversion.
resolution | Bit resolution to be used in conversion |
References ADC_BASE, ADC_CTL2_RES_M, ADC_O_CTL2, ASSERT, and HWREG.
Referenced by enableADC().
void ADCSetInput | ( | uint32_t | reference, |
uint8_t | channel, | ||
uint32_t | index | ||
) |
Sets the ADC reference source and input channel.
This function sets the ADC reference and input channel. The control register index that the settings are applied to must also be passed as a parameter
reference | Reference source used in conversion |
channel | Internal channels that can be muxed to ADC. Channels 0-11 correspond to analog pins 0-11. See device data for more information. |
index | Index of which control register to write to. See device data for valid indexes. |
References ADC_BASE, ADC_EXTERNAL_REFERENCE, ADC_FIXED_REFERENCE_1V4, ADC_FIXED_REFERENCE_2V5, ADC_MEMCTL0_CHANSEL_M, ADC_MEMCTL0_CHANSEL_S, ADC_MEMCTL0_VRSEL_EXTREF, ADC_MEMCTL0_VRSEL_INTREF, ADC_MEMCTL0_VRSEL_M, ADC_MEMCTL0_VRSEL_VDDS, ADC_O_MEMCTL0, ADC_O_REFCFG, ADC_REFCFG_IBPROG_VAL0, ADC_REFCFG_REFEN_DIS, ADC_REFCFG_REFEN_EN, ADC_REFCFG_REFVSEL_V1P4, ADC_REFCFG_REFVSEL_V2P5, ADC_VDDS_REFERENCE, ASSERT, and HWREG.
Referenced by enableADC().
void ADCSetMemctlRange | ( | uint32_t | start, |
uint32_t | stop | ||
) |
Set start and stop control registers.
This function selects which control registers should be selected for a conversion. Valid indexes are [0, 3]. For a single conversion, start and stop should be set to the same.
start | the index of first control register used in sequence |
stop | the index of last control register used in sequence |
References ADC_BASE, ADC_CTL2_ENDADD_M, ADC_CTL2_ENDADD_S, ADC_CTL2_STARTADD_M, ADC_CTL2_STARTADD_S, ADC_O_CTL2, and HWREG.
Referenced by enableADC().
void ADCSetPowerDownPolicy | ( | uint32_t | powerDownPolicy | ) |
Set power down policy.
This function sets the power down policy for the ADC.
powerDownPolicy |
References ADC_BASE, ADC_CTL0_PWRDN_M, ADC_O_CTL0, ASSERT, and HWREG.
void ADCSetSequence | ( | uint32_t | sequence | ) |
Set conversion sequence.
This function sets the sequence for ADC conversions. The actual sequence is defined by ADCSetMemctlRange. For a single conversion, start and stop should be set to the same.
sequence |
References ADC_BASE, ADC_CTL1_CONSEQ_M, ADC_O_CTL1, ASSERT, and HWREG.
Referenced by enableADC().
void ADCSetSamplingMode | ( | uint32_t | samplingMode | ) |
Set ADC sampling mode.
samplingMode |
References ADC_BASE, ADC_CTL1_SAMPMODE_M, ADC_O_CTL1, ASSERT, and HWREG.
Referenced by enableADC().
void ADCSetTriggerSource | ( | uint32_t | triggerSource | ) |
Set ADC trigger source.
triggerSource |
References ADC_BASE, ADC_CTL1_SC_M, ADC_CTL1_TRIGSRC_M, ADC_O_CTL1, ASSERT, and HWREG.
Referenced by enableADC().
void ADCSetTriggerPolicy | ( | uint32_t | triggerPolicy, |
uint32_t | index | ||
) |
Set ADC trigger policy.
This not applicable when the sequence set by ADCSetSequence() is ADC_SEQUENCE_SINGLE
triggerPolicy | |
index | Index of which control register to write to. See device data for valid indexes. |
References ADC_BASE, ADC_MEMCTL0_TRG_M, ADC_O_MEMCTL0, ASSERT, and HWREG.
__STATIC_INLINE void ADCStartConversion | ( | void | ) |
Start conversion.
Can only be used if the trigger source is set to ADC_TRIGGER_SOURCE_SOFTWARE using ADCSetTriggerSource()
References ADC_BASE, ADC_CTL1_SC_START, ADC_O_CTL1, and HWREG.
Referenced by TempDiodeGetTemp().
__STATIC_INLINE void ADCStopConversion | ( | void | ) |
Stop sample phase of a conversion.
Only applicable if the trigger source is set to ADC_TRIGGER_SOURCE_SOFTWARE using ADCSetTriggerSource() and if the sampling mode is set to ADC_SAMPLE_MODE_MANUAL using ADCSetSamplingMode().
References ADC_BASE, ADC_CTL1_SC_M, ADC_O_CTL1, and HWREG.
__STATIC_INLINE void ADCEnableConversion | ( | void | ) |
Enable conversion.
This will enable ADC conversions. The ADC sequencer will wait for the trigger configured using ADCSetTriggerSource() before the first conversion is started.
If the trigger source has been configured to ADC_TRIGGER_SOURCE_SOFTWARE, then the conversion can be started using ADCStartConversion().
References ADC_BASE, ADC_CTL0_ENC_ON, ADC_O_CTL0, and HWREG.
Referenced by enableADC(), and TempDiodeGetTemp().
__STATIC_INLINE void ADCDisableConversion | ( | void | ) |
Disable conversion.
This will disable ADC conversions. The current conversion will finish and the result can be read out using ADCReadResult() or ADCReadResultNonBlocking(). Any subsequent conversions in a sequence will be aborted.
References ADC_BASE, ADC_CTL0_ENC_M, ADC_O_CTL0, and HWREG.
Referenced by enableADC().
__STATIC_INLINE void ADCEnableDmaTrigger | ( | void | ) |
Enable DMA trigger for data transfer.
References ADC_BASE, ADC_CTL2_DMAEN_EN, ADC_O_CTL2, and HWREG.
__STATIC_INLINE void ADCDisableDmaTrigger | ( | void | ) |
Disable DMA trigger for data transfer.
References ADC_BASE, ADC_CTL2_DMAEN_M, ADC_O_CTL2, and HWREG.
__STATIC_INLINE uint32_t ADCReadResult | ( | uint32_t | index | ) |
Read conversion result from ADC.
This function blocks until a conversion is done, and returns data from the given memory register. The index corresponds to the selected control register used for the conversion
index | Index of which memory result register to read from |
References ADC_BASE, ADC_O_MEMRES0, ADC_O_STA, ADC_STA_BUSY_ACTIVE, and HWREG.
Referenced by TempDiodeGetTemp().
__STATIC_INLINE bool ADCIsBusy | ( | void | ) |
Check if ADC is busy.
This function returns whether the ADC is busy or not.
References ADC_BASE, ADC_O_STA, ADC_STA_BUSY_ACTIVE, and HWREG.
__STATIC_INLINE uint32_t ADCReadResultNonBlocking | ( | uint32_t | index | ) |
Read conversion result from ADC.
This function returns data from the given memory register without blocking. The index corresponds to the selected control register used for the conversion
index | Index of which memory result register to read from |
References ADC_BASE, ADC_O_MEMRES0, ADCValueToMicrovolts(), and HWREG.
uint32_t ADCValueToMicrovolts | ( | uint32_t | adcCode, |
uint32_t | bitResolution, | ||
uint32_t | referenceVoltageMicroVolt | ||
) |
Convert ADC code to microvolts.
This function converts an adjusted ADC code to microvolts. Function arguments also include bit resolution and reference voltage
adcCode | Raw adjusted adc code |
bitResolution | Bit resolution used in conversion |
referenceVoltageMicroVolt | Reference voltage (microvolts) |
References ADC_RESOLUTION_10_BIT, ADC_RESOLUTION_12_BIT, and ADC_RESOLUTION_8_BIT.
Referenced by ADCReadResultNonBlocking(), and TempDiodeGetTemp().
__STATIC_INLINE void ADCEnableInterrupt | ( | uint32_t | intFlags | ) |
Enables individual ADC interrupt sources.
This function enables the indicated ADC interrupt sources.
intFlags | is the bit mask of the interrupt sources to be enabled. The parameter is the bitwise OR of any of the following: |
References ADC_BASE, ADC_O_IMASK0, and HWREG.
__STATIC_INLINE void ADCDisableInterrupt | ( | uint32_t | intFlags | ) |
Disables individual ADC interrupt sources.
This function disables the indicated ADC interrupt sources.
intFlags | is the bit mask of the interrupt sources to be disabled. The parameter is the bitwise OR of any of the following: |
References ADC_BASE, ADC_O_IMASK0, and HWREG.
__STATIC_INLINE uint32_t ADCRawInterruptStatus | ( | void | ) |
Gets the current raw interrupt status.
This function returns the raw interrupt status for the ADC
References ADC_BASE, ADC_O_RIS0, and HWREG.
__STATIC_INLINE uint32_t ADCMaskedInterruptStatus | ( | void | ) |
Gets the current masked interrupt status.
This function returns the masked interrupt status for the ADC
References ADC_BASE, ADC_O_MIS0, and HWREG.
__STATIC_INLINE void ADCClearInterrupt | ( | uint32_t | intFlags | ) |
Clears ADC interrupt sources.
The specified ADC interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.
intFlags | is a bit mask of the interrupt sources to be cleared. |
References ADC_BASE, ADC_O_ICLR0, ADCAdjustValueForGain(), ADCGetAdjustmentGain(), ADCSetAdjustmentOffset(), and HWREG.
uint16_t ADCGetAdjustmentGain | ( | uint32_t | reference | ) |
Returns ADC gain value for given reference.
This returns a gain value that should be passed to ADCAdjustValueForGain. The gain is dependant on the reference source
reference | reference source used in conversion |
References ADC_EXTERNAL_REFERENCE, ADC_FIXED_REFERENCE_1V4, ADC_FIXED_REFERENCE_2V5, ADC_VDDS_REFERENCE, ASSERT, and fcfg.
Referenced by ADCClearInterrupt(), and TempDiodeGetTemp().
void ADCSetAdjustmentOffset | ( | uint32_t | reference | ) |
Write correct offset value to ADC-peripheral trim register.
The ADC peripheral relies on an offset trim value in SYS0_O_TMUTE2. This value needs to be set depending on which reference source is used in the conversion
reference | reference source used in conversion |
References ADC_EXTERNAL_REFERENCE, ADC_FIXED_REFERENCE_1V4, ADC_FIXED_REFERENCE_2V5, ADC_VDDS_REFERENCE, ASSERT, fcfg, HWREG, SYS0_BASE, SYS0_O_MUNLOCK, SYS0_O_TMUTE2, SYS0_TMUTE2_OFFSET_M, and SYS0_TMUTE2_OFFSET_S.
Referenced by ADCClearInterrupt(), and enableADC().
uint32_t ADCAdjustValueForGain | ( | uint32_t | adcValue, |
uint32_t | bitResolution, | ||
uint16_t | gain | ||
) |
Performs ADC value gain adjustment.
This function takes a measured ADC value and compensates for the internal gain in the ADC.
adcValue | ADC unadjusted value |
bitResolution | ADC bit resolution. Valid options are: |
gain | Gain adjustment value provided by ADCGetAdjustmentGain() |
References ADC_RESOLUTION_10_BIT, ADC_RESOLUTION_12_BIT, and ADC_RESOLUTION_8_BIT.
Referenced by ADCClearInterrupt(), and TempDiodeGetTemp().