Infineon MOTIX™ MCU TLE987x Device Family SDK
Typedefs | Enumerations | Functions
sdadc.h File Reference

Go to the source code of this file.

Detailed Description

Sigma Delta ADC low level access library.

Version
V0.1.6
Date
18. Oct 2022

Include Graph

Include dependency graph for sdadc.h:

Typedefs

typedef enum SDADC_OSR TSDADC_OSR
 
typedef enum SDADC_DITHVAL TSDADC_DITHVAL
 
typedef enum SDADC_EOC_CNT TSDADC_EOC_CNT
 

Enumerations

enum  SDADC_OSR {
  SDADC_OSR_128 = 7 , SDADC_OSR_256 = 8 , SDADC_OSR_512 = 9 , SDADC_OSR_1024 = 10 ,
  SDADC_OSR_2048 = 11
}
 
enum  SDADC_DITHVAL {
  SDADC_DITH_0_mV = 0 , SDADC_DITH_12_5_mV = 1 , SDADC_DITH_25_0_mV = 2 , SDADC_DITH_37_5_mV = 3 ,
  SDADC_DITH_50_0_mV = 4 , SDADC_DITH_62_5_mV = 5 , SDADC_DITH_75_0_mV = 6 , SDADC_DITH_87_5_mV = 7 ,
  SDADC_DITH_100_0_mV = 8 , SDADC_DITH_112_5_mV = 9 , SDADC_DITH_125_0_mV = 10 , SDADC_DITH_137_5_mV = 11 ,
  SDADC_DITH_150_0_mV = 12 , SDADC_DITH_162_5_mV = 13 , SDADC_DITH_175_0_mV = 14 , SDADC_DITH_187_5_mV = 15
}
 
enum  SDADC_EOC_CNT { SDADC_IRQ_AFTER_EVERY_EOC = 0 , SDADC_IRQ_AFTER_8TH_EOC = 1 , SDADC_IRQ_AFTER_16TH_EOC = 2 , SDADC_IRQ_AFTER_32ND_EOC = 3 }
 

Functions

INLINE void SDADC_Ch0_Power_On (void)
 enables ADC3 analog frontend. More...
 
INLINE void SDADC_Ch0_Power_Off (void)
 disables ADC3 analog frontend and ADC3 conversion. More...
 
INLINE void SDADC_Ch1_Power_On (void)
 enables ADC4 analog frontend. More...
 
INLINE void SDADC_Ch1_Power_Off (void)
 disables ADC4 analog frontend and ADC4 conversion. More...
 
INLINE sint16 SDADC_Ch0_Result_Get (void)
 gets ADC3 Result value More...
 
INLINE sint16 SDADC_Ch1_Result_Get (void)
 gets ADC4 Result value More...
 
INLINE void SDADC_Ch0_OverSamplingRatio_Sel (uint32 osr)
 selects ADC3 Oversampling Ratio More...
 
INLINE void SDADC_Ch1_OverSamplingRatio_Sel (uint32 osr)
 selects ADC4 Oversampling Ratio More...
 
INLINE void SDADC_Dithering_En (void)
 enables ADC34 Dithering More...
 
INLINE void SDADC_Dithering_Dis (void)
 disables ADC34 Dithering More...
 
INLINE void SDADC_Dithering_Sel (uint32 dith)
 selects ADC34 Dithering value More...
 
INLINE void SDADC_IRQ_Rate_Sel (uint32 rate)
 selects ADC34 EoC counter (IRQ rate of ADC34) More...
 
INLINE void SDADC_Ch0_SOC_Set (void)
 enables ADC3 conversion More...
 
INLINE void SDADC_Ch0_SOC_Rst (void)
 disables ADC3 conversion More...
 
INLINE void SDADC_Ch1_SOC_Set (void)
 enables ADC4 conversion More...
 
INLINE void SDADC_Ch1_SOC_Rst (void)
 disables ADC4 conversion More...
 
INLINE void SDADC_SOC_Set (void)
 enables ADC3 and ADC4 conversions More...
 
INLINE void SDADC_SOC_Rst (void)
 disables ADC3 and ADC4 conversions More...
 
INLINE uint8 SDADC_Ch0_EOC_Sts (void)
 reads ADC3 End of Conversion Status More...
 
INLINE uint8 SDADC_Ch1_EOC_Sts (void)
 reads ADC4 End of Conversion Status More...
 
INLINE void SDADC_VAREF_Set (void)
 sets ADC34 reference voltage to VAREF More...
 
INLINE void SDADC_VDDEXT_Set (void)
 sets ADC34 reference voltage to VDDEXT More...
 
INLINE void SDADC_Ch0_Offset_Meas_En (void)
 enables ADC3 Offset Measurement More...
 
INLINE void SDADC_Ch0_Offset_Meas_Dis (void)
 disables ADC3 Offset Measurement More...
 
INLINE void SDADC_Ch1_Offset_Meas_En (void)
 enables ADC4 Offset Measurement More...
 
INLINE void SDADC_Ch1_Offset_Meas_Dis (void)
 disables ADC4 Offset Measurement More...
 
INLINE void SDADC_Ch0_Int_Clr (void)
 clears ADC3 EOC Interrupt flag. More...
 
INLINE void SDADC_Ch1_Int_Clr (void)
 clears ADC4 EOC Interrupt flag. More...
 
INLINE void SDADC_Ch0_Int_En (void)
 enables ADC3 EOC Interrupt. More...
 
INLINE void SDADC_Ch0_Int_Dis (void)
 disables ADC3 EOC Interrupt. More...
 
INLINE void SDADC_Ch1_Int_En (void)
 enables ADC4 EOC Interrupt. More...
 
INLINE void SDADC_Ch1_Int_Dis (void)
 disables ADC4 EOC Interrupt. More...
 
void SDADC_Init (void)
 Initializes the SDADC module (ADC3 and ADC4) based on the Config Wizard for MOTIX MCU configuration. More...
 

Typedef Documentation

◆ TSDADC_DITHVAL

◆ TSDADC_EOC_CNT

◆ TSDADC_OSR

typedef enum SDADC_OSR TSDADC_OSR

Enumeration Type Documentation

◆ SDADC_DITHVAL

Enumerator
SDADC_DITH_0_mV 

ADC34 Dither Value - 0 mV

SDADC_DITH_12_5_mV 

ADC34 Dither Value - 12.5 mV

SDADC_DITH_25_0_mV 

ADC34 Dither Value - 25 mV

SDADC_DITH_37_5_mV 

ADC34 Dither Value - 37.5 mV

SDADC_DITH_50_0_mV 

ADC34 Dither Value - 50 mV

SDADC_DITH_62_5_mV 

ADC34 Dither Value - 62.5 mV

SDADC_DITH_75_0_mV 

ADC34 Dither Value - 75 mV

SDADC_DITH_87_5_mV 

ADC34 Dither Value - 87.5 mV

SDADC_DITH_100_0_mV 

ADC34 Dither Value - 100 mV

SDADC_DITH_112_5_mV 

ADC34 Dither Value - 112.5 mV

SDADC_DITH_125_0_mV 

ADC34 Dither Value - 125 mV

SDADC_DITH_137_5_mV 

ADC34 Dither Value - 137.5 mV

SDADC_DITH_150_0_mV 

ADC34 Dither Value - 150 mV

SDADC_DITH_162_5_mV 

ADC34 Dither Value - 162.5 mV

SDADC_DITH_175_0_mV 

ADC34 Dither Value - 175 mV

SDADC_DITH_187_5_mV 

ADC34 Dither Value - 187.5 mV

◆ SDADC_EOC_CNT

Enumerator
SDADC_IRQ_AFTER_EVERY_EOC 

ADC34 EoC counter - Every

SDADC_IRQ_AFTER_8TH_EOC 

ADC34 EoC counter - 8TH

SDADC_IRQ_AFTER_16TH_EOC 

ADC34 EoC counter - 16TH

SDADC_IRQ_AFTER_32ND_EOC 

ADC34 EoC counter - 32ND

◆ SDADC_OSR

enum SDADC_OSR
Enumerator
SDADC_OSR_128 

SDADC Oversampling Ratio - 128

SDADC_OSR_256 

SDADC Oversampling Ratio - 256

SDADC_OSR_512 

SDADC Oversampling Ratio - 512

SDADC_OSR_1024 

SDADC Oversampling Ratio - 1024

SDADC_OSR_2048 

SDADC Oversampling Ratio - 2048

Function Documentation

◆ SDADC_Ch0_EOC_Sts()

INLINE uint8 SDADC_Ch0_EOC_Sts ( void  )

reads ADC3 End of Conversion Status

Return values
1ADC3 conversion terminated
0ADC3 conversion still in progress

Example

This example waits until the End of ADC3 Conversion.

void Example_Function(void)
{
while(SDADC_Ch0_EOC_Sts() == 0)
{
}
}
INLINE uint8 SDADC_Ch0_EOC_Sts(void)
reads ADC3 End of Conversion Status
Definition: sdadc.h:485
INLINE void SDADC_Ch0_Power_On(void)
enables ADC3 analog frontend.
Definition: sdadc.h:142

◆ SDADC_Ch0_Int_Clr()

INLINE void SDADC_Ch0_Int_Clr ( void  )

clears ADC3 EOC Interrupt flag.

Example

This example treats the ADC3 EOC Interrupt.

void Example_Function(void)
{
if (SCUPM->SYS_IS.bit.ADC3_EOC_IS == 1u)
{
ADC34_ADC3_CALLBACK();
}
}
#define SCUPM
Definition: tle987x.h:6098
INLINE void SDADC_Ch0_Int_En(void)
enables ADC3 EOC Interrupt.
Definition: sdadc.h:680
INLINE void SDADC_Ch0_Int_Clr(void)
clears ADC3 EOC Interrupt flag.
Definition: sdadc.h:636

◆ SDADC_Ch0_Int_Dis()

INLINE void SDADC_Ch0_Int_Dis ( void  )

disables ADC3 EOC Interrupt.

Example

This example treats the ADC3 EOC Interrupt.

void Example_Function(void)
{
if (SCUPM->SYS_IS.bit.ADC3_EOC_IS == 1u)
{
ADC34_ADC3_CALLBACK();
}
}
INLINE void SDADC_Ch0_Int_Dis(void)
disables ADC3 EOC Interrupt.
Definition: sdadc.h:703

◆ SDADC_Ch0_Int_En()

INLINE void SDADC_Ch0_Int_En ( void  )

enables ADC3 EOC Interrupt.

Example

This example treats the ADC3 EOC Interrupt.

void Example_Function(void)
{
if (SCUPM->SYS_IS.bit.ADC3_EOC_IS == 1u)
{
ADC34_ADC3_CALLBACK();
}
}

◆ SDADC_Ch0_Offset_Meas_Dis()

INLINE void SDADC_Ch0_Offset_Meas_Dis ( void  )

disables ADC3 Offset Measurement

Example

This example disables ADC3 Offset Measurement.

void Example_Function(void)
{
}
INLINE void SDADC_Ch0_Offset_Meas_Dis(void)
disables ADC3 Offset Measurement
Definition: sdadc.h:578

◆ SDADC_Ch0_Offset_Meas_En()

INLINE void SDADC_Ch0_Offset_Meas_En ( void  )

enables ADC3 Offset Measurement

Example

This example enables ADC3 Offset Measurement.

void Example_Function(void)
{
}
INLINE void SDADC_Ch0_Offset_Meas_En(void)
enables ADC3 Offset Measurement
Definition: sdadc.h:560

◆ SDADC_Ch0_OverSamplingRatio_Sel()

INLINE void SDADC_Ch0_OverSamplingRatio_Sel ( uint32  osr)

selects ADC3 Oversampling Ratio

Parameters
osrADC3 Oversampling Ratio

Example

This example configures ADC3 Oversampling Ratio to 256.

void Example_Function(void)
{
}
INLINE void SDADC_Ch0_OverSamplingRatio_Sel(uint32 osr)
selects ADC3 Oversampling Ratio
Definition: sdadc.h:259

◆ SDADC_Ch0_Power_Off()

INLINE void SDADC_Ch0_Power_Off ( void  )

disables ADC3 analog frontend and ADC3 conversion.

Example

This example disables ADC3 analog frontend.

void Example_Function(void)
{
}
INLINE void SDADC_Ch0_Power_Off(void)
disables ADC3 analog frontend and ADC3 conversion.
Definition: sdadc.h:159

◆ SDADC_Ch0_Power_On()

INLINE void SDADC_Ch0_Power_On ( void  )

enables ADC3 analog frontend.

Example

This example enables ADC3 analog frontend.

void Example_Function(void)
{
}

◆ SDADC_Ch0_Result_Get()

INLINE sint16 SDADC_Ch0_Result_Get ( void  )

gets ADC3 Result value

Returns
ADC3 Result

Example

This example reads ADC3 Result value.

void Example_Function(void)
{
sint16 sts;
}
INLINE sint16 SDADC_Ch0_Result_Get(void)
gets ADC3 Result value
Definition: sdadc.h:217
int16_t sint16
16 bit signed value
Definition: types.h:159

◆ SDADC_Ch0_SOC_Rst()

INLINE void SDADC_Ch0_SOC_Rst ( void  )

disables ADC3 conversion

Example

This example disables ADC3 conversion.

void Example_Function(void)
{
}
INLINE void SDADC_Ch0_SOC_Rst(void)
disables ADC3 conversion
Definition: sdadc.h:387

◆ SDADC_Ch0_SOC_Set()

INLINE void SDADC_Ch0_SOC_Set ( void  )

enables ADC3 conversion

Example

This example enables ADC3 conversion.

void Example_Function(void)
{
}
INLINE void SDADC_Ch0_SOC_Set(void)
enables ADC3 conversion
Definition: sdadc.h:369

◆ SDADC_Ch1_EOC_Sts()

INLINE uint8 SDADC_Ch1_EOC_Sts ( void  )

reads ADC4 End of Conversion Status

Return values
1ADC4 conversion terminated
0ADC4 conversion still in progress

Example

This example waits until the End of ADC4 Conversion.

void Example_Function(void)
{
while(SDADC_Ch1_EOC_Sts() == 0)
{
}
}
INLINE void SDADC_Ch1_Power_On(void)
enables ADC4 analog frontend.
Definition: sdadc.h:177
INLINE uint8 SDADC_Ch1_EOC_Sts(void)
reads ADC4 End of Conversion Status
Definition: sdadc.h:508

◆ SDADC_Ch1_Int_Clr()

INLINE void SDADC_Ch1_Int_Clr ( void  )

clears ADC4 EOC Interrupt flag.

Example

This example treats the ADC4 EOC Interrupt.

void Example_Function(void)
{
if (SCUPM->SYS_IS.bit.ADC4_EOC_IS == 1u)
{
ADC34_ADC4_CALLBACK();
}
}
INLINE void SDADC_Ch1_Int_Clr(void)
clears ADC4 EOC Interrupt flag.
Definition: sdadc.h:658
INLINE void SDADC_Ch1_Int_En(void)
enables ADC4 EOC Interrupt.
Definition: sdadc.h:725

◆ SDADC_Ch1_Int_Dis()

INLINE void SDADC_Ch1_Int_Dis ( void  )

disables ADC4 EOC Interrupt.

Example

This example treats the ADC4 EOC Interrupt.

void Example_Function(void)
{
if (SCUPM->SYS_IS.bit.ADC4_EOC_IS == 1u)
{
ADC34_ADC4_CALLBACK();
}
}
INLINE void SDADC_Ch1_Int_Dis(void)
disables ADC4 EOC Interrupt.
Definition: sdadc.h:748

◆ SDADC_Ch1_Int_En()

INLINE void SDADC_Ch1_Int_En ( void  )

enables ADC4 EOC Interrupt.

Example

This example treats the ADC4 EOC Interrupt.

void Example_Function(void)
{
if (SCUPM->SYS_IS.bit.ADC4_EOC_IS == 1u)
{
ADC34_ADC4_CALLBACK();
}
}

◆ SDADC_Ch1_Offset_Meas_Dis()

INLINE void SDADC_Ch1_Offset_Meas_Dis ( void  )

disables ADC4 Offset Measurement

Example

This example disables ADC4 Offset Measurement.

void Example_Function(void)
{
}
INLINE void SDADC_Ch1_Offset_Meas_Dis(void)
disables ADC4 Offset Measurement
Definition: sdadc.h:614

◆ SDADC_Ch1_Offset_Meas_En()

INLINE void SDADC_Ch1_Offset_Meas_En ( void  )

enables ADC4 Offset Measurement

Example

This example enables ADC4 Offset Measurement.

void Example_Function(void)
{
}
INLINE void SDADC_Ch1_Offset_Meas_En(void)
enables ADC4 Offset Measurement
Definition: sdadc.h:596

◆ SDADC_Ch1_OverSamplingRatio_Sel()

INLINE void SDADC_Ch1_OverSamplingRatio_Sel ( uint32  osr)

selects ADC4 Oversampling Ratio

Parameters
osrADC4 Oversampling Ratio

Example

This example configures ADC4 Oversampling Ratio to 1024.

void Example_Function(void)
{
}
INLINE void SDADC_Ch1_OverSamplingRatio_Sel(uint32 osr)
selects ADC4 Oversampling Ratio
Definition: sdadc.h:279

◆ SDADC_Ch1_Power_Off()

INLINE void SDADC_Ch1_Power_Off ( void  )

disables ADC4 analog frontend and ADC4 conversion.

Example

This example disables ADC4 analog frontend.

void Example_Function(void)
{
}
INLINE void SDADC_Ch1_Power_Off(void)
disables ADC4 analog frontend and ADC4 conversion.
Definition: sdadc.h:194

◆ SDADC_Ch1_Power_On()

INLINE void SDADC_Ch1_Power_On ( void  )

enables ADC4 analog frontend.

Example

This example enables ADC4 analog frontend.

void Example_Function(void)
{
}

◆ SDADC_Ch1_Result_Get()

INLINE sint16 SDADC_Ch1_Result_Get ( void  )

gets ADC4 Result value

Returns
ADC4 Result

Example

This example reads ADC4 Result value.

void Example_Function(void)
{
sint16 sts;
}
INLINE sint16 SDADC_Ch1_Result_Get(void)
gets ADC4 Result value
Definition: sdadc.h:239

◆ SDADC_Ch1_SOC_Rst()

INLINE void SDADC_Ch1_SOC_Rst ( void  )

disables ADC4 conversion

Example

This example disables ADC4 conversion.

void Example_Function(void)
{
INLINE void SDADC_Ch1_SOC_Rst(void)
disables ADC4 conversion
Definition: sdadc.h:423

◆ SDADC_Ch1_SOC_Set()

INLINE void SDADC_Ch1_SOC_Set ( void  )

enables ADC4 conversion

Example

This example enables ADC4 conversion.

void Example_Function(void)
{
}
INLINE void SDADC_Ch1_SOC_Set(void)
enables ADC4 conversion
Definition: sdadc.h:405

◆ SDADC_Dithering_Dis()

INLINE void SDADC_Dithering_Dis ( void  )

disables ADC34 Dithering

Example

This example disables ADC34 Dithering.

void Example_Function(void)
{
}
INLINE void SDADC_Dithering_Dis(void)
disables ADC34 Dithering
Definition: sdadc.h:313

◆ SDADC_Dithering_En()

INLINE void SDADC_Dithering_En ( void  )

enables ADC34 Dithering

Example

This example enables ADC34 Dithering.

void Example_Function(void)
{
}
INLINE void SDADC_Dithering_En(void)
enables ADC34 Dithering
Definition: sdadc.h:296

◆ SDADC_Dithering_Sel()

INLINE void SDADC_Dithering_Sel ( uint32  dith)

selects ADC34 Dithering value

Parameters
dithADC34 Dithering value

Example

This example sets ADC34 Dithering value to 1.

void Example_Function(void)
{
}
INLINE void SDADC_Dithering_Sel(uint32 dith)
selects ADC34 Dithering value
Definition: sdadc.h:332

◆ SDADC_Init()

void SDADC_Init ( void  )

Initializes the SDADC module (ADC3 and ADC4) based on the Config Wizard for MOTIX MCU configuration.

◆ SDADC_IRQ_Rate_Sel()

INLINE void SDADC_IRQ_Rate_Sel ( uint32  rate)

selects ADC34 EoC counter (IRQ rate of ADC34)

Parameters
rateEoC counter

Example

This example sets ADC34 EoC counter to IRQ with every EoC.

void Example_Function(void)
{
}
INLINE void SDADC_IRQ_Rate_Sel(uint32 rate)
selects ADC34 EoC counter (IRQ rate of ADC34)
Definition: sdadc.h:351

◆ SDADC_SOC_Rst()

INLINE void SDADC_SOC_Rst ( void  )

disables ADC3 and ADC4 conversions

Example

This example disables ADC3 and ADC4 conversions.

void Example_Function(void)
{
}
INLINE void SDADC_SOC_Rst(void)
disables ADC3 and ADC4 conversions
Definition: sdadc.h:461

◆ SDADC_SOC_Set()

INLINE void SDADC_SOC_Set ( void  )

enables ADC3 and ADC4 conversions

Example

This example enables ADC3 and ADC4 conversions.

void Example_Function(void)
{
}
INLINE void SDADC_SOC_Set(void)
enables ADC3 and ADC4 conversions
Definition: sdadc.h:442

◆ SDADC_VAREF_Set()

INLINE void SDADC_VAREF_Set ( void  )

sets ADC34 reference voltage to VAREF

Example

This example sets ADC34 reference voltage to VAREF.

void Example_Function(void)
{
}
INLINE void SDADC_VAREF_Set(void)
sets ADC34 reference voltage to VAREF
Definition: sdadc.h:525

◆ SDADC_VDDEXT_Set()

INLINE void SDADC_VDDEXT_Set ( void  )

sets ADC34 reference voltage to VDDEXT

Example

This example sets ADC34 reference voltage to VDDEXT.

void Example_Function(void)
{
}
INLINE void SDADC_VDDEXT_Set(void)
sets ADC34 reference voltage to VDDEXT
Definition: sdadc.h:542