AM64x MCU+ SDK  10.00.00

Introduction

This module contains APIs to program and use the ADC module.

Files

file  adc/v0/adc.h
 This file contains the prototypes of the APIs present in the device abstraction layer file of ADC. This also contains some related macros.
 

Data Structures

struct  adcRevisionId_t
 Structure for accessing Revision ID of ADC module. More...
 
struct  adcStepConfig_t
 Structure containing parameters for ADC step configuration. More...
 
struct  adcSequencerStatus_t
 Structure for reporting ADC sequencer status. More...
 

Functions

void ADCPowerUp (uint32_t baseAddr, uint32_t powerUp)
 This API will power up ADC Module. More...
 
uint32_t AdcIsPoweredUp (uint32_t baseAddr)
 This function checks if the ADC module is powered up. More...
 
int32_t ADCSetClkDivider (uint32_t baseAddr, uint32_t clkDivider)
 This API will configure clock divider for the ADC Module. More...
 
void ADCInit (uint32_t baseAddr, uint32_t errCorrection, uint32_t errOffset, uint32_t calibration)
 This API is used to initialize the ADC module. More...
 
void ADCFIFODMAAccessEnable (uint32_t baseAddr, uint32_t fifoNum, uint32_t dmaLineEnable)
 This API will enable DMA access for FIFO. More...
 
int32_t ADCSetStepParams (uint32_t baseAddr, uint32_t stepId, const adcStepConfig_t *configParams)
 This API will configure a step for analog to digital conversion. More...
 
void ADCStepEnable (uint32_t baseAddr, uint32_t stepId, uint32_t stepEnable)
 This API will enable ADC step. More...
 
void ADCClearAllSteps (uint32_t baseAddr)
 This API will clear all the ADC steps. More...
 
void ADCStart (uint32_t baseAddr, uint32_t adcEnable)
 This API will start ADC. More...
 
void ADCStepIdTagEnable (uint32_t baseAddr, uint32_t stepIdTag)
 This API is used to configure the ADC module for storing step ID along with ADC data. More...
 
uint32_t ADCGetFIFOData (uint32_t baseAddr, uint32_t fifoNum)
 This API will read and return FIFO data. More...
 
uint32_t ADCGetFIFOWordCount (uint32_t baseAddr, uint32_t fifoNum)
 This API will return number of word present in the FIFO. More...
 
int32_t ADCSetCPUFIFOThresholdLevel (uint32_t baseAddr, uint32_t fifoNum, uint32_t threshold)
 This API will configure threshold level for a FIFO. More...
 
uint32_t ADCGetCPUFIFOThresholdLevel (uint32_t baseAddr, uint32_t fifoNum)
 This API will read and return threshold level for a FIFO. More...
 
int32_t ADCSetDMAFIFOThresholdLevel (uint32_t baseAddr, uint32_t fifoNum, uint32_t threshold)
 This API will configure DMA request level for a FIFO. More...
 
uint32_t ADCGetDMAFIFOThresholdLevel (uint32_t baseAddr, uint32_t fifoNum)
 This API will read and return DMA request level for a FIFO. More...
 
void ADCEnableIntr (uint32_t baseAddr, uint32_t intrMask)
 This API is used to enable interrupts. More...
 
void ADCDisableIntr (uint32_t baseAddr, uint32_t intrMask)
 This API is used to disable interrupts. More...
 
void ADCWriteEOI (uint32_t baseAddr)
 This API is used for EOI for ADC. More...
 
uint32_t ADCGetIntrStatus (uint32_t baseAddr)
 This API is used to get the pending interrupts. More...
 
void ADCClearIntrStatus (uint32_t baseAddr, uint32_t intrMask)
 This API is used to clear the interrupt status. More...
 
uint32_t ADCGetIntrRawStatus (uint32_t baseAddr)
 This API is used to get the raw interrupt status. More...
 
int32_t ADCSetRange (uint32_t baseAddr, uint32_t highRange, uint32_t lowRange)
 This API is used to configure the range for ADC. More...
 
void ADCGetRange (uint32_t baseAddr, uint32_t *highRange, uint32_t *lowRange)
 This API is used to get the range for conversion. More...
 
void ADCGetSequencerStatus (uint32_t baseAddr, adcSequencerStatus_t *status)
 This API is used to get the Sequencer status. More...
 
void ADCSetIdleMode (uint32_t baseAddr, uint32_t idleMode)
 This API is used to configure ADC idle mode. More...
 
void ADCGetRevisionId (uint32_t baseAddr, adcRevisionId_t *revId)
 This API is used get the ADC revision ID. More...
 

Macros

#define ADC_INTR_STATUS_ALL
 Macro defines mask for all the interrupts status for ADC. More...
 
#define ADC_INTR_ENABLE_ALL
 Macro defines mask for all the interrupts to enable for ADC. More...
 
#define ADC_INTR_DISABLE_ALL
 Macro defines mask for all the interrupts to disable for ADC. More...
 
#define ADC_INTR_ALL   (ADC_INTR_STATUS_ALL)
 Macro defines mask for all the interrupts for ADC. More...
 
#define ADC_OPENDELAY_MAX   (0x3FFFFU)
 Macro defines the maximum value of open delay for a step for ADC. More...
 
#define ADC_SAMPLEDELAY_MAX   (0xFFU)
 Macro defines the maximum value of sample delay for a step for ADC. More...
 
#define ADC_RANGE_MAX   (0x3FFU)
 Macro defines the maximum allowable range for ADC. More...
 
#define ADC_RANGE_MIN   (0x0U)
 Macro defines the minimum allowable range for ADC. More...
 
#define ADC_FIFO_SIZE   (64U)
 Macro defines the maximum number of samples FIFO0 can store. More...
 
#define ADC_MAX_NUM_CHN   (uint32_t)(8U)
 Macro defines the maximum number of channels in ADC. More...
 
#define ADC_GET_RANGE(bit)   (((uint32_t) 1U) << (bit))
 Returns the ADC max range given the bit support. More...
 

ADC Fifo Num

typedef uint32_t adcChannel_t
 Enum to select the channel for input. More...
 
typedef uint32_t adcFIFONum_t
 Enum to select FIFO to store the data. More...
 
#define ADC_CHANNEL_1   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_1)
 
#define ADC_CHANNEL_2   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_2)
 
#define ADC_CHANNEL_3   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_3)
 
#define ADC_CHANNEL_4   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_4)
 
#define ADC_CHANNEL_5   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_5)
 
#define ADC_CHANNEL_6   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_6)
 
#define ADC_CHANNEL_7   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_7)
 
#define ADC_CHANNEL_8   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_8)
 
#define ADC_FIFO_NUM_0   (0x0U)
 
#define ADC_FIFO_NUM_1   (0x1U)
 

ADC Step Id

typedef uint32_t adcStepId_t
 Enum to select the step for operation. More...
 
#define ADC_STEP_1   (ADC_ADCSTAT_STEP_ID_STEP1)
 
#define ADC_STEP_2   (ADC_ADCSTAT_STEP_ID_STEP2)
 
#define ADC_STEP_3   (ADC_ADCSTAT_STEP_ID_STEP3)
 
#define ADC_STEP_4   (ADC_ADCSTAT_STEP_ID_STEP4)
 
#define ADC_STEP_5   (ADC_ADCSTAT_STEP_ID_STEP5)
 
#define ADC_STEP_6   (ADC_ADCSTAT_STEP_ID_STEP6)
 
#define ADC_STEP_7   (ADC_ADCSTAT_STEP_ID_STEP7)
 
#define ADC_STEP_8   (ADC_ADCSTAT_STEP_ID_STEP8)
 
#define ADC_STEP_9   (ADC_ADCSTAT_STEP_ID_STEP9)
 
#define ADC_STEP_10   (ADC_ADCSTAT_STEP_ID_STEP10)
 
#define ADC_STEP_11   (ADC_ADCSTAT_STEP_ID_STEP11)
 
#define ADC_STEP_12   (ADC_ADCSTAT_STEP_ID_STEP12)
 
#define ADC_STEP_13   (ADC_ADCSTAT_STEP_ID_STEP13)
 
#define ADC_STEP_14   (ADC_ADCSTAT_STEP_ID_STEP14)
 
#define ADC_STEP_15   (ADC_ADCSTAT_STEP_ID_STEP15)
 
#define ADC_STEP_16   (ADC_ADCSTAT_STEP_ID_STEP16)
 

ADC Operation Mode

typedef uint32_t adcOperationMode_t
 Enum to select the ADC Operation Mode. More...
 
#define ADC_OPERATION_MODE_SINGLE_SHOT   (ADC_STEPCONFIG_MODE_SW_EN_ONESHOT)
 
#define ADC_OPERATION_MODE_CONTINUOUS   (ADC_STEPCONFIG_MODE_SW_EN_CONTINUOUS)
 

ADC Averaging

typedef uint32_t adcAveraging_t
 Enum to number of samplings to average. More...
 
#define ADC_AVERAGING_NONE   (ADC_STEPCONFIG_AVERAGING_NOAVG)
 
#define ADC_AVERAGING_2_SAMPLES   (ADC_STEPCONFIG_AVERAGING_2_SAMPLESAVG)
 
#define ADC_AVERAGING_4_SAMPLES   (ADC_STEPCONFIG_AVERAGING_4_SAMPLESAVG)
 
#define ADC_AVERAGING_8_SAMPLES   (ADC_STEPCONFIG_AVERAGING_8_SAMPLESAVG)
 
#define ADC_AVERAGING_16_SAMPLES   (ADC_STEPCONFIG_AVERAGING_16_SAMPLESAV)
 

ADC Interrupt source

typedef uint32_t adcIntrSrc_t
 Enum for ADC interrupts. More...
 
#define ADC_INTR_SRC_END_OF_SEQUENCE   (ADC_IRQENABLE_SET_END_OF_SEQUENCE_MASK)
 
#define ADC_INTR_SRC_FIFO0_THRESHOLD   (ADC_IRQENABLE_SET_FIFO0_THR_MASK)
 
#define ADC_INTR_SRC_FIFO0_OVERRUN   (ADC_IRQENABLE_SET_FIFO0_OVERRUN_MASK)
 
#define ADC_INTR_SRC_FIFO0_UNDERFLOW   (ADC_IRQENABLE_SET_FIFO0_UNDERFLOW_MASK)
 
#define ADC_INTR_SRC_FIFO1_THRESHOLD   (ADC_IRQENABLE_SET_FIFO1_THR_MASK)
 
#define ADC_INTR_SRC_FIFO1_OVERRUN   (ADC_IRQSTATUS_FIFO1_OVERRUN_MASK)
 
#define ADC_INTR_SRC_FIFO1_UNDERFLOW   (ADC_IRQENABLE_SET_FIFO1_UNDERFLOW_MASK)
 
#define ADC_INTR_SRC_OUT_OF_RANGE   (ADC_IRQENABLE_SET_OUT_OF_RANGE_MASK)
 

ADC Idle mode

typedef uint32_t adcIdleMode_t
 Enum to configure ADC idle mode.Applicable for TDA3XX Only. More...
 
#define ADC_IDLE_MODE_FORCE_IDLE   (ADC_SYSCONFIG_IDLEMODE_FORCE)
 
#define ADC_IDLE_MODE_NO_IDLE   (ADC_SYSCONFIG_IDLEMODE_NO_IDLE)
 
#define ADC_IDLE_MODE_SMART_IDLE   (ADC_SYSCONFIG_IDLEMODE_SMART_IDLE)
 

Macro Definition Documentation

◆ ADC_INTR_STATUS_ALL

#define ADC_INTR_STATUS_ALL
Value:
(ADC_IRQSTATUS_END_OF_SEQUENCE_MASK | \
ADC_IRQSTATUS_FIFO0_THR_MASK | \
ADC_IRQSTATUS_FIFO0_OVERRUN_MASK | \
ADC_IRQSTATUS_FIFO0_UNDERFLOW_MASK | \
ADC_IRQSTATUS_FIFO1_THR_MASK | \
ADC_IRQSTATUS_FIFO1_OVERRUN_MASK | \
ADC_IRQSTATUS_FIFO1_UNDERFLOW_MASK | \
ADC_IRQSTATUS_OUT_OF_RANGE_MASK)

Macro defines mask for all the interrupts status for ADC.

◆ ADC_INTR_ENABLE_ALL

#define ADC_INTR_ENABLE_ALL
Value:
(ADC_IRQENABLE_SET_END_OF_SEQUENCE_MASK | \
ADC_IRQENABLE_SET_FIFO0_THR_MASK | \
ADC_IRQENABLE_SET_FIFO0_OVERRUN_MASK | \
ADC_IRQENABLE_SET_FIFO0_UNDERFLOW_MASK | \
ADC_IRQENABLE_SET_FIFO1_THR_MASK | \
ADC_IRQENABLE_SET_FIFO1_OVERRUN_MASK | \
ADC_IRQENABLE_SET_FIFO1_UNDERFLOW_MASK | \
ADC_IRQENABLE_SET_OUT_OF_RANGE_MASK)

Macro defines mask for all the interrupts to enable for ADC.

◆ ADC_INTR_DISABLE_ALL

#define ADC_INTR_DISABLE_ALL
Value:
(ADC_IRQENABLE_CLR_END_OF_SEQUENCE_MASK | \
ADC_IRQENABLE_CLR_FIFO0_THR_MASK | \
ADC_IRQENABLE_CLR_FIFO0_OVERRUN_MASK | \
ADC_IRQENABLE_CLR_FIFO0_UNDERFLOW_MASK | \
ADC_IRQENABLE_CLR_FIFO1_THR_MASK | \
ADC_IRQENABLE_CLR_FIFO1_OVERRUN_MASK | \
ADC_IRQENABLE_CLR_FIFO1_UNDERFLOW_MASK | \
ADC_IRQENABLE_CLR_OUT_OF_RANGE_MASK)

Macro defines mask for all the interrupts to disable for ADC.

◆ ADC_INTR_ALL

#define ADC_INTR_ALL   (ADC_INTR_STATUS_ALL)

Macro defines mask for all the interrupts for ADC.

◆ ADC_OPENDELAY_MAX

#define ADC_OPENDELAY_MAX   (0x3FFFFU)

Macro defines the maximum value of open delay for a step for ADC.

◆ ADC_SAMPLEDELAY_MAX

#define ADC_SAMPLEDELAY_MAX   (0xFFU)

Macro defines the maximum value of sample delay for a step for ADC.

◆ ADC_RANGE_MAX

#define ADC_RANGE_MAX   (0x3FFU)

Macro defines the maximum allowable range for ADC.

◆ ADC_RANGE_MIN

#define ADC_RANGE_MIN   (0x0U)

Macro defines the minimum allowable range for ADC.

◆ ADC_FIFO_SIZE

#define ADC_FIFO_SIZE   (64U)

Macro defines the maximum number of samples FIFO0 can store.

◆ ADC_MAX_NUM_CHN

#define ADC_MAX_NUM_CHN   (uint32_t)(8U)

Macro defines the maximum number of channels in ADC.

◆ ADC_GET_RANGE

#define ADC_GET_RANGE (   bit)    (((uint32_t) 1U) << (bit))

Returns the ADC max range given the bit support.

◆ ADC_CHANNEL_1

#define ADC_CHANNEL_1   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_1)

Select channel 1 for input

◆ ADC_CHANNEL_2

#define ADC_CHANNEL_2   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_2)

Select channel 2 for input

◆ ADC_CHANNEL_3

#define ADC_CHANNEL_3   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_3)

Select channel 3 for input

◆ ADC_CHANNEL_4

#define ADC_CHANNEL_4   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_4)

Select channel 4 for input

◆ ADC_CHANNEL_5

#define ADC_CHANNEL_5   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_5)

Select channel 5 for input

◆ ADC_CHANNEL_6

#define ADC_CHANNEL_6   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_6)

Select channel 6 for input

◆ ADC_CHANNEL_7

#define ADC_CHANNEL_7   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_7)

Select channel 7 for input

◆ ADC_CHANNEL_8

#define ADC_CHANNEL_8   (ADC_STEPCONFIG_SEL_INM_SWC_CHANNEL_8)

Select channel 8 for input

◆ ADC_STEP_1

#define ADC_STEP_1   (ADC_ADCSTAT_STEP_ID_STEP1)

Select step 1

◆ ADC_STEP_2

#define ADC_STEP_2   (ADC_ADCSTAT_STEP_ID_STEP2)

Select step 2

◆ ADC_STEP_3

#define ADC_STEP_3   (ADC_ADCSTAT_STEP_ID_STEP3)

Select step 3

◆ ADC_STEP_4

#define ADC_STEP_4   (ADC_ADCSTAT_STEP_ID_STEP4)

Select step 4

◆ ADC_STEP_5

#define ADC_STEP_5   (ADC_ADCSTAT_STEP_ID_STEP5)

Select step 5

◆ ADC_STEP_6

#define ADC_STEP_6   (ADC_ADCSTAT_STEP_ID_STEP6)

Select step 6

◆ ADC_STEP_7

#define ADC_STEP_7   (ADC_ADCSTAT_STEP_ID_STEP7)

Select step 7

◆ ADC_STEP_8

#define ADC_STEP_8   (ADC_ADCSTAT_STEP_ID_STEP8)

Select step 8

◆ ADC_STEP_9

#define ADC_STEP_9   (ADC_ADCSTAT_STEP_ID_STEP9)

Select step 9

◆ ADC_STEP_10

#define ADC_STEP_10   (ADC_ADCSTAT_STEP_ID_STEP10)

Select step 10

◆ ADC_STEP_11

#define ADC_STEP_11   (ADC_ADCSTAT_STEP_ID_STEP11)

Select step 11

◆ ADC_STEP_12

#define ADC_STEP_12   (ADC_ADCSTAT_STEP_ID_STEP12)

Select step 12

◆ ADC_STEP_13

#define ADC_STEP_13   (ADC_ADCSTAT_STEP_ID_STEP13)

Select step 13

◆ ADC_STEP_14

#define ADC_STEP_14   (ADC_ADCSTAT_STEP_ID_STEP14)

Select step 14

◆ ADC_STEP_15

#define ADC_STEP_15   (ADC_ADCSTAT_STEP_ID_STEP15)

Select step 15

◆ ADC_STEP_16

#define ADC_STEP_16   (ADC_ADCSTAT_STEP_ID_STEP16)

Select step 16

◆ ADC_OPERATION_MODE_SINGLE_SHOT

#define ADC_OPERATION_MODE_SINGLE_SHOT   (ADC_STEPCONFIG_MODE_SW_EN_ONESHOT)

Configure ADC operation mode to software enabled single shot

◆ ADC_OPERATION_MODE_CONTINUOUS

#define ADC_OPERATION_MODE_CONTINUOUS   (ADC_STEPCONFIG_MODE_SW_EN_CONTINUOUS)

Configure ADC operation mode to software enabled continuous

◆ ADC_AVERAGING_NONE

#define ADC_AVERAGING_NONE   (ADC_STEPCONFIG_AVERAGING_NOAVG)

Disable averaging

◆ ADC_AVERAGING_2_SAMPLES

#define ADC_AVERAGING_2_SAMPLES   (ADC_STEPCONFIG_AVERAGING_2_SAMPLESAVG)

Set number of samplings to average to 2

◆ ADC_AVERAGING_4_SAMPLES

#define ADC_AVERAGING_4_SAMPLES   (ADC_STEPCONFIG_AVERAGING_4_SAMPLESAVG)

Set number of samplings to average to 4

◆ ADC_AVERAGING_8_SAMPLES

#define ADC_AVERAGING_8_SAMPLES   (ADC_STEPCONFIG_AVERAGING_8_SAMPLESAVG)

Set number of samplings to average to 8

◆ ADC_AVERAGING_16_SAMPLES

#define ADC_AVERAGING_16_SAMPLES   (ADC_STEPCONFIG_AVERAGING_16_SAMPLESAV)

Set number of samplings to average to 16

◆ ADC_FIFO_NUM_0

#define ADC_FIFO_NUM_0   (0x0U)

Select FIFO 0 to store data

◆ ADC_FIFO_NUM_1

#define ADC_FIFO_NUM_1   (0x1U)

Select FIFO 1 to store data

◆ ADC_INTR_SRC_END_OF_SEQUENCE

#define ADC_INTR_SRC_END_OF_SEQUENCE   (ADC_IRQENABLE_SET_END_OF_SEQUENCE_MASK)

End of sequence interrupt

◆ ADC_INTR_SRC_FIFO0_THRESHOLD

#define ADC_INTR_SRC_FIFO0_THRESHOLD   (ADC_IRQENABLE_SET_FIFO0_THR_MASK)

FIFO0 threshold interrupt

◆ ADC_INTR_SRC_FIFO0_OVERRUN

#define ADC_INTR_SRC_FIFO0_OVERRUN   (ADC_IRQENABLE_SET_FIFO0_OVERRUN_MASK)

FIFO0 overrun interrupt

◆ ADC_INTR_SRC_FIFO0_UNDERFLOW

#define ADC_INTR_SRC_FIFO0_UNDERFLOW   (ADC_IRQENABLE_SET_FIFO0_UNDERFLOW_MASK)

FIFO0 underrun interrupt

◆ ADC_INTR_SRC_FIFO1_THRESHOLD

#define ADC_INTR_SRC_FIFO1_THRESHOLD   (ADC_IRQENABLE_SET_FIFO1_THR_MASK)

FIFO1 threshold interrupt

◆ ADC_INTR_SRC_FIFO1_OVERRUN

#define ADC_INTR_SRC_FIFO1_OVERRUN   (ADC_IRQSTATUS_FIFO1_OVERRUN_MASK)

FIFO1 overrun interrupt

◆ ADC_INTR_SRC_FIFO1_UNDERFLOW

#define ADC_INTR_SRC_FIFO1_UNDERFLOW   (ADC_IRQENABLE_SET_FIFO1_UNDERFLOW_MASK)

FIFO1 underrun interrupt

◆ ADC_INTR_SRC_OUT_OF_RANGE

#define ADC_INTR_SRC_OUT_OF_RANGE   (ADC_IRQENABLE_SET_OUT_OF_RANGE_MASK)

Out of interrupt

◆ ADC_IDLE_MODE_FORCE_IDLE

#define ADC_IDLE_MODE_FORCE_IDLE   (ADC_SYSCONFIG_IDLEMODE_FORCE)

Force idle mode

◆ ADC_IDLE_MODE_NO_IDLE

#define ADC_IDLE_MODE_NO_IDLE   (ADC_SYSCONFIG_IDLEMODE_NO_IDLE)

No idle mode

◆ ADC_IDLE_MODE_SMART_IDLE

#define ADC_IDLE_MODE_SMART_IDLE   (ADC_SYSCONFIG_IDLEMODE_SMART_IDLE)

Smart idle mode

Typedef Documentation

◆ adcChannel_t

typedef uint32_t adcChannel_t

Enum to select the channel for input.

    ADC have 8 channels from which it can take input.

◆ adcStepId_t

typedef uint32_t adcStepId_t

Enum to select the step for operation.

◆ adcOperationMode_t

typedef uint32_t adcOperationMode_t

Enum to select the ADC Operation Mode.

    ADC can either operate in software enabled single shot mode or
    software enabled continuous mode.

◆ adcAveraging_t

typedef uint32_t adcAveraging_t

Enum to number of samplings to average.

    ADC allows user to program the number of samplings to average.

◆ adcFIFONum_t

typedef uint32_t adcFIFONum_t

Enum to select FIFO to store the data.

◆ adcIntrSrc_t

typedef uint32_t adcIntrSrc_t

Enum for ADC interrupts.

◆ adcIdleMode_t

typedef uint32_t adcIdleMode_t

Enum to configure ADC idle mode.Applicable for TDA3XX Only.

Function Documentation

◆ ADCPowerUp()

void ADCPowerUp ( uint32_t  baseAddr,
uint32_t  powerUp 
)

This API will power up ADC Module.

Parameters
baseAddrBase Address of the ADC Registers.
powerUpADC is powered up if it is TRUE. ADC is powered down if it is FALSE.

◆ AdcIsPoweredUp()

uint32_t AdcIsPoweredUp ( uint32_t  baseAddr)

This function checks if the ADC module is powered up.

Parameters
baseAddrBase Address of the ADC Registers.
Return values
stateReturns TRUE if ADC is powered up. Else returns FALSE.

◆ ADCSetClkDivider()

int32_t ADCSetClkDivider ( uint32_t  baseAddr,
uint32_t  clkDivider 
)

This API will configure clock divider for the ADC Module.

Parameters
baseAddrBase Address of the ADC Registers.
clkDividerClock divider value.
Returns
status Configuration status.
Note
Actual value programmed is (clkDivider - 1) to get the divider value as clkDivider. This API is applicable only for TDA3XX.

◆ ADCInit()

void ADCInit ( uint32_t  baseAddr,
uint32_t  errCorrection,
uint32_t  errOffset,
uint32_t  calibration 
)

This API is used to initialize the ADC module.

Parameters
baseAddrBase Address of the ADC Registers.
errCorrectionError Correction is enabled if it is TRUE. Error Correction is disabled if it is FALSE.
errOffsetWrite 0 to use internal calibration. Write 1 to use EFUSE code.
calibrationWriting 0 does not start internal calibration. Writing 1 starts internal calibration.

◆ ADCFIFODMAAccessEnable()

void ADCFIFODMAAccessEnable ( uint32_t  baseAddr,
uint32_t  fifoNum,
uint32_t  dmaLineEnable 
)

This API will enable DMA access for FIFO.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO from which data is to be read. Refer enum adcFIFONum_t.
dmaLineEnableDMA Line is enabled if it is TRUE. DMA Line is disabled if it is FALSE.

◆ ADCSetStepParams()

int32_t ADCSetStepParams ( uint32_t  baseAddr,
uint32_t  stepId,
const adcStepConfig_t configParams 
)

This API will configure a step for analog to digital conversion.

Parameters
baseAddrBase Address of the ADC Registers.
stepIdId of step to be configured. Refer enum adcStepId_t.
configParamsConfiguration parameters for ADC step. Refer struct adcStepConfig_t.
Returns
status ADC step configure status.

◆ ADCStepEnable()

void ADCStepEnable ( uint32_t  baseAddr,
uint32_t  stepId,
uint32_t  stepEnable 
)

This API will enable ADC step.

Parameters
baseAddrBase Address of the ADC Registers.
stepIdId of step to be enabled. Refer enum adcStepId_t.
stepEnableStep is enabled if it is TRUE. Step is disabled if it is FALSE.

◆ ADCClearAllSteps()

void ADCClearAllSteps ( uint32_t  baseAddr)

This API will clear all the ADC steps.

Parameters
baseAddrBase Address of the ADC Registers.

◆ ADCStart()

void ADCStart ( uint32_t  baseAddr,
uint32_t  adcEnable 
)

This API will start ADC.

Parameters
baseAddrBase Address of the ADC Registers.
adcEnableADC is enabled/started if it is TRUE. ADC is disabled/stopped if it is FALSE.

◆ ADCStepIdTagEnable()

void ADCStepIdTagEnable ( uint32_t  baseAddr,
uint32_t  stepIdTag 
)

This API is used to configure the ADC module for storing step ID along with ADC data.

Parameters
baseAddrBase Address of the ADC Registers.
stepIdTagStep ID is stored along with ADC data in FIFO, if it is TRUE. Step ID is not stored along with ADC data in FIFO, if it is FALSE.

◆ ADCGetFIFOData()

uint32_t ADCGetFIFOData ( uint32_t  baseAddr,
uint32_t  fifoNum 
)

This API will read and return FIFO data.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO from which data is to be read. Refer enum adcFIFONum_t.
Returns
data FIFO data.

◆ ADCGetFIFOWordCount()

uint32_t ADCGetFIFOWordCount ( uint32_t  baseAddr,
uint32_t  fifoNum 
)

This API will return number of word present in the FIFO.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO for which word count is needed. Refer enum adcFIFONum_t.
Returns
FIFO level Number of words present in the FIFO.

◆ ADCSetCPUFIFOThresholdLevel()

int32_t ADCSetCPUFIFOThresholdLevel ( uint32_t  baseAddr,
uint32_t  fifoNum,
uint32_t  threshold 
)

This API will configure threshold level for a FIFO.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO for which threshold level is to be set. Refer enum adcFIFONum_t.
thresholdNumber of words in FIFO after which interrupt to CPU will be generated. It can take value from 1 to ADC_FIFO_SIZE.
Returns
status Configuration status.
Note
Actual value programmed is (threshold - 1) to get the threshold level as threshold.

◆ ADCGetCPUFIFOThresholdLevel()

uint32_t ADCGetCPUFIFOThresholdLevel ( uint32_t  baseAddr,
uint32_t  fifoNum 
)

This API will read and return threshold level for a FIFO.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO number. Refer enum adcFIFONum_t.
Returns
threshold Number of words in FIFO after which interrupt to CPU will be generated.

◆ ADCSetDMAFIFOThresholdLevel()

int32_t ADCSetDMAFIFOThresholdLevel ( uint32_t  baseAddr,
uint32_t  fifoNum,
uint32_t  threshold 
)

This API will configure DMA request level for a FIFO.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO for which DMA request level is to be set. Refer enum adcFIFONum_t.
thresholdNumber of words in FIFO after which DMA request will be generated. It can take value from 1 to ADC_FIFO_SIZE.
Returns
status Configuration status.
Note
Actual value programmed is (threshold - 1) to get the threshold level as threshold.

◆ ADCGetDMAFIFOThresholdLevel()

uint32_t ADCGetDMAFIFOThresholdLevel ( uint32_t  baseAddr,
uint32_t  fifoNum 
)

This API will read and return DMA request level for a FIFO.

Parameters
baseAddrBase Address of the ADC Registers.
fifoNumFIFO number. Refer enum adcFIFONum_t.
Returns
threshold Number of words in FIFO after which DMA request will be generated.

◆ ADCEnableIntr()

void ADCEnableIntr ( uint32_t  baseAddr,
uint32_t  intrMask 
)

This API is used to enable interrupts.

Parameters
baseAddrBase Address of the ADC Registers.
intrMaskInterrupts to enable. Refer enum adcIntrSrc_t.

◆ ADCDisableIntr()

void ADCDisableIntr ( uint32_t  baseAddr,
uint32_t  intrMask 
)

This API is used to disable interrupts.

Parameters
baseAddrBase Address of the ADC Registers.
intrMaskInterrupts to disable.

◆ ADCWriteEOI()

void ADCWriteEOI ( uint32_t  baseAddr)

This API is used for EOI for ADC.

Parameters
baseAddrBase Address of the ADC Registers.

◆ ADCGetIntrStatus()

uint32_t ADCGetIntrStatus ( uint32_t  baseAddr)

This API is used to get the pending interrupts.

Parameters
baseAddrBase Address of the ADC Registers.
Returns
status Pending interrupt status/occurred.

◆ ADCClearIntrStatus()

void ADCClearIntrStatus ( uint32_t  baseAddr,
uint32_t  intrMask 
)

This API is used to clear the interrupt status.

Parameters
baseAddrBase Address of the ADC Registers.
intrMaskInterrupts to clear status.

◆ ADCGetIntrRawStatus()

uint32_t ADCGetIntrRawStatus ( uint32_t  baseAddr)

This API is used to get the raw interrupt status.

Parameters
baseAddrBase Address of the ADC Registers.
Returns
status Pending interrupt status/occurred.

◆ ADCSetRange()

int32_t ADCSetRange ( uint32_t  baseAddr,
uint32_t  highRange,
uint32_t  lowRange 
)

This API is used to configure the range for ADC.

Parameters
baseAddrBase Address of the ADC Registers.
highRangeAllowable upper range of data.
lowRangeAllowable lower range of data.
Returns
status configuration status.

◆ ADCGetRange()

void ADCGetRange ( uint32_t  baseAddr,
uint32_t *  highRange,
uint32_t *  lowRange 
)

This API is used to get the range for conversion.

Parameters
baseAddrBase Address of the ADC Registers.
highRangeAllowable upper range of data.
lowRangeAllowable lower range of data.

◆ ADCGetSequencerStatus()

void ADCGetSequencerStatus ( uint32_t  baseAddr,
adcSequencerStatus_t status 
)

This API is used to get the Sequencer status.

Parameters
baseAddrBase Address of the ADC Registers.
statusCurrent status of the sequencer. Refer struct adcSequencerStatus_t.

◆ ADCSetIdleMode()

void ADCSetIdleMode ( uint32_t  baseAddr,
uint32_t  idleMode 
)

This API is used to configure ADC idle mode.

Parameters
baseAddrBase Address of the ADC Registers.
idleModeIdle mode to be configured for ADC module. Refer enum adcIdleMode_t.
Note
This API is applicable only for TDA3XX.

◆ ADCGetRevisionId()

void ADCGetRevisionId ( uint32_t  baseAddr,
adcRevisionId_t revId 
)

This API is used get the ADC revision ID.

Parameters
baseAddrBase Address of the ADC Registers.
revIdContains Revision ID of ADC module.. Refer struct adcRevisionId_t.