CC26xx Driver Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
[auxadc] AUX Analog to Digital Converter

Functions

void AUXADCDisable (void)
 Disables the ADC. More...
 
void AUXADCEnableAsync (uint32_t refSource, uint32_t trigger)
 Enables the ADC for asynchronous operation. More...
 
void AUXADCEnableSync (uint32_t refSource, uint32_t sampleTime, uint32_t trigger)
 Enables the ADC for synchronous operation. More...
 
void AUXADCFlushFifo (void)
 Flushes the ADC FIFO. More...
 
__STATIC_INLINE void AUXADCGenManualTrigger (void)
 Generates a single manual ADC trigger. More...
 
__STATIC_INLINE uint32_t AUXADCGetFifoStatus (void)
 Returns flags indicating the status of the ADC FIFO. More...
 
uint32_t AUXADCReadFifo (void)
 Waits for and returns the first sample in the ADC FIFO. More...
 
__STATIC_INLINE void AUXADCSelectInput (uint32_t input)
 Selects internal or external input for the ADC. More...
 

Detailed Description

Function Documentation

void AUXADCDisable ( void  )

Disables the ADC.

Definition at line 51 of file aux_adc.c.

void AUXADCEnableAsync ( uint32_t  refSource,
uint32_t  trigger 
)

Enables the ADC for asynchronous operation.

In asynchronous operation, the ADC samples continuously between conversions.

The ADC trigger starts the conversion. Note that the first conversion may be invalid if the sampling period is too short.

Parameters
refSourceADC reference source:
triggerADC conversion trigger:

Definition at line 72 of file aux_adc.c.

void AUXADCEnableSync ( uint32_t  refSource,
uint32_t  sampleTime,
uint32_t  trigger 
)

Enables the ADC for synchronous operation.

In synchronous operation, the ADC is idle between a conversion and subsequent samplings.

The ADC trigger starts sampling with specified duration, followed by the conversion. Note that the first conversion may be invalid if the sampling period is too short.

Parameters
refSourceADC reference source:
sampleTimeADC sampling time:
triggerADC conversion trigger:

Definition at line 103 of file aux_adc.c.

void AUXADCFlushFifo ( void  )

Flushes the ADC FIFO.

This empties the FIFO and clears the underflow/overflow flags.

Note: This function must only be called while the ADC is enabled.

Definition at line 138 of file aux_adc.c.

__STATIC_INLINE void AUXADCGenManualTrigger ( void  )

Generates a single manual ADC trigger.

For synchronous mode, the trigger starts sampling followed by conversion. For asynchronous mode, the trigger starts conversion.

Definition at line 237 of file aux_adc.h.

__STATIC_INLINE uint32_t AUXADCGetFifoStatus ( void  )

Returns flags indicating the status of the ADC FIFO.

The flags indicate FIFO empty, full and almost full, and whether overflow/underflow has occurred.

Returns
- AUXADC_FIFO_EMPTY_M

Definition at line 259 of file aux_adc.h.

uint32_t AUXADCReadFifo ( void  )

Waits for and returns the first sample in the ADC FIFO.

This function waits until there is at least one sample in the ADC FIFO. It then pops and returns the first sample from the FIFO.

Note that this procedure will deadlock if called without setting up ADC trigger generation in advance. The trigger can either be manual or periodical (using a GPT).

Returns
The first (12-bit) sample from the ADC FIFO

Definition at line 150 of file aux_adc.c.

__STATIC_INLINE void AUXADCSelectInput ( uint32_t  input)

Selects internal or external input for the ADC.

Note that calling this function also selects the same input for AUX_COMPB.

Parameters
inputInternal/external input selection:

Definition at line 303 of file aux_adc.h.

Macro Definition Documentation

#define AUXADC_FIFO_ALMOST_FULL_M   AUX_ANAIF_ADCFIFOSTAT_ALMOST_FULL_M

Definition at line 85 of file aux_adc.h.

#define AUXADC_FIFO_EMPTY_M   AUX_ANAIF_ADCFIFOSTAT_EMPTY_M

Definition at line 84 of file aux_adc.h.

#define AUXADC_FIFO_FULL_M   AUX_ANAIF_ADCFIFOSTAT_FULL_M

Definition at line 86 of file aux_adc.h.

#define AUXADC_FIFO_OVERFLOW_M   AUX_ANAIF_ADCFIFOSTAT_OVERFLOW_M

Definition at line 88 of file aux_adc.h.

#define AUXADC_FIFO_UNDERFLOW_M   AUX_ANAIF_ADCFIFOSTAT_UNDERFLOW_M

Definition at line 87 of file aux_adc.h.

#define AUXADC_REF_FIXED   (0 << ADI_4_AUX_ADCREF0_SRC_S)

Definition at line 76 of file aux_adc.h.

#define AUXADC_REF_VDDA_REL   (1 << ADI_4_AUX_ADCREF0_SRC_S)

Definition at line 77 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_10P6_US   (5 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 112 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_10P9_MS   (15 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 122 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_170_US   (9 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 116 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_1P37_MS   (12 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 119 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_21P3_US   (6 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 113 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_2P73_MS   (13 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 120 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_2P7_US   (3 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 110 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_341_US   (10 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 117 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_42P6_US   (7 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 114 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_5P3_US   (4 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 111 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_5P46_MS   (14 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 121 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_682_US   (11 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 118 of file aux_adc.h.

#define AUXADC_SAMPLE_TIME_85P3_US   (8 << ADI_4_AUX_ADC0_SMPL_CYCLE_EXP_S)

Definition at line 115 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT0A   EVENT_AUXSEL0_EV_GPT0A

Definition at line 96 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT0B   EVENT_AUXSEL0_EV_GPT0B

Definition at line 97 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT1A   EVENT_AUXSEL0_EV_GPT1A

Definition at line 98 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT1B   EVENT_AUXSEL0_EV_GPT1B

Definition at line 99 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT2A   EVENT_AUXSEL0_EV_GPT2A

Definition at line 100 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT2B   EVENT_AUXSEL0_EV_GPT2B

Definition at line 101 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT3A   EVENT_AUXSEL0_EV_GPT3A

Definition at line 102 of file aux_adc.h.

#define AUXADC_TRIGGER_GPT3B   EVENT_AUXSEL0_EV_GPT3B

Definition at line 103 of file aux_adc.h.

#define AUXADC_TRIGGER_MANUAL   EVENT_AUXSEL0_EV_NONE

Definition at line 95 of file aux_adc.h.

Referenced by AUXADCEnableAsync(), and AUXADCEnableSync().