CC13xx Driver Library
aux_adc.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_event.h"
#include "../inc/hw_adi.h"
#include "../inc/hw_adi_4_aux.h"
#include "../inc/hw_aux_anaif.h"
#include "rom.h"

Macros

#define AUXADC_REF_FIXED   (0 << ADI_4_AUX_ADCREF0_SRC_S)
 
#define AUXADC_REF_VDDS_REL   (1 << ADI_4_AUX_ADCREF0_SRC_S)
 
#define AUXADC_FIFO_EMPTY_M   (AUX_ANAIF_ADCFIFOSTAT_EMPTY_M)
 
#define AUXADC_FIFO_ALMOST_FULL_M   (AUX_ANAIF_ADCFIFOSTAT_ALMOST_FULL_M)
 
#define AUXADC_FIFO_FULL_M   (AUX_ANAIF_ADCFIFOSTAT_FULL_M)
 
#define AUXADC_FIFO_UNDERFLOW_M   (AUX_ANAIF_ADCFIFOSTAT_UNDERFLOW_M)
 
#define AUXADC_FIFO_OVERFLOW_M   (AUX_ANAIF_ADCFIFOSTAT_OVERFLOW_M)
 
#define AUXADC_TRIGGER_MANUAL   (EVENT_AUXSEL0_EV_NONE)
 
#define AUXADC_TRIGGER_GPT0A   (EVENT_AUXSEL0_EV_GPT0A)
 
#define AUXADC_TRIGGER_GPT0B   (EVENT_AUXSEL0_EV_GPT0B)
 
#define AUXADC_TRIGGER_GPT1A   (EVENT_AUXSEL0_EV_GPT1A)
 
#define AUXADC_TRIGGER_GPT1B   (EVENT_AUXSEL0_EV_GPT1B)
 
#define AUXADC_TRIGGER_GPT2A   (EVENT_AUXSEL0_EV_GPT2A)
 
#define AUXADC_TRIGGER_GPT2B   (EVENT_AUXSEL0_EV_GPT2B)
 
#define AUXADC_TRIGGER_GPT3A   (EVENT_AUXSEL0_EV_GPT3A)
 
#define AUXADC_TRIGGER_GPT3B   (EVENT_AUXSEL0_EV_GPT3B)
 
#define AUXADC_SAMPLE_TIME_2P7_US   3
 
#define AUXADC_SAMPLE_TIME_5P3_US   4
 
#define AUXADC_SAMPLE_TIME_10P6_US   5
 
#define AUXADC_SAMPLE_TIME_21P3_US   6
 
#define AUXADC_SAMPLE_TIME_42P6_US   7
 
#define AUXADC_SAMPLE_TIME_85P3_US   8
 
#define AUXADC_SAMPLE_TIME_170_US   9
 
#define AUXADC_SAMPLE_TIME_341_US   10
 
#define AUXADC_SAMPLE_TIME_682_US   11
 
#define AUXADC_SAMPLE_TIME_1P37_MS   12
 
#define AUXADC_SAMPLE_TIME_2P73_MS   13
 
#define AUXADC_SAMPLE_TIME_5P46_MS   14
 
#define AUXADC_SAMPLE_TIME_10P9_MS   15
 
#define AUXADC_FIXED_REF_VOLTAGE_NORMAL   4300000
 
#define AUXADC_FIXED_REF_VOLTAGE_UNSCALED   1478500
 

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 AUXADCDisableInputScaling (void)
 Disables scaling of the ADC input. More...
 
void AUXADCFlushFifo (void)
 Flushes the ADC FIFO. More...
 
static void AUXADCGenManualTrigger (void)
 Generates a single manual ADC trigger. More...
 
static 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...
 
uint32_t AUXADCPopFifo (void)
 Returns the first sample in the ADC FIFO, without waiting. More...
 
static void AUXADCSelectInput (uint32_t input)
 Selects internal or external input for the ADC. More...
 
int32_t AUXADCGetAdjustmentGain (uint32_t refSource)
 Returns the gain value used when adjusting for ADC gain/offset. More...
 
int32_t AUXADCGetAdjustmentOffset (uint32_t refSource)
 Returns the offset value used when adjusting for ADC gain/offset. More...
 
int32_t AUXADCValueToMicrovolts (int32_t fixedRefVoltage, int32_t adcValue)
 Converts an "adjusted" ADC value to microvolts. More...
 
int32_t AUXADCMicrovoltsToValue (int32_t fixedRefVoltage, int32_t microvolts)
 Converts a number of microvolts to corresponding "adjusted" ADC value. More...
 
int32_t AUXADCAdjustValueForGainAndOffset (int32_t adcValue, int32_t gain, int32_t offset)
 Performs ADC value gain and offset adjustment. More...
 
int32_t AUXADCUnadjustValueForGainAndOffset (int32_t adcValue, int32_t gain, int32_t offset)
 Performs the inverse of the ADC value gain and offset adjustment. More...