MCAL_DRIVER
Functions | Variables
ivec_mcal_adc_dma.c File Reference
#include <Core\Include\ivec_mcal_adc_dma.h>

Functions

IVEC_McalStatus_e xMCAL_AdcInit (ADC12_Regs *const adc_inst)
 Initlization ADC with DMA. More...
 
IVEC_McalStatus_e xMCAL_AdcDeInit (ADC12_Regs *const adc_inst)
 De-Initialize the ADC peripheral to their default reset values. More...
 
IVEC_McalStatus_e xMCAL_AdcStart (ADC12_Regs *const adc_inst)
 Enable ADC, start conversion of regular group. More...
 
IVEC_McalStatus_e xMCAL_AdcStop (ADC12_Regs *const adc_inst)
 Stop ADC conversion of regular group. More...
 
IVEC_McalStatus_e xMCAL_DmaInit (void)
 Initlization of DMA for ADC. More...
 
IVEC_McalStatus_e xMCAL_DmaDeInit (void)
 De-Initialize the DMA to their default reset values. More...
 
IVEC_McalStatus_e xMCAL_DmaStart (const uint8_t u8channel, uint16_t *p_u16adcDma)
 Enable DMA, start transfer from ADC to DMA of regular group. More...
 
IVEC_McalStatus_e xMCAL_DmaStop (void)
 Function use to set the DMA channel. More...
 
void _prv_adccallback ()
 ADC call back function. More...
 
void ADC1_IRQHandler ()
 ADC IRQ handler. More...
 

Variables

static volatile bool g_u32AdcInitFlag = 0
 
static volatile bool g_u32AdcStartFlag =0
 
static volatile bool g_u32DmaFlag =0
 
static volatile bool g_u32DmaStart =0
 
static const DL_ADC12_ClockConfig gADC12_1ClockConfig
 Configuration for ADC12_0 clock. More...
 
static const DL_DMA_Config gDMA_CH0Config
 Configuration for DMA. More...
 

Function Documentation

◆ _prv_adccallback()

void _prv_adccallback ( )

ADC call back function.

Note
Interruptions enabled in this function

◆ ADC1_IRQHandler()

void ADC1_IRQHandler ( )

ADC IRQ handler.

◆ xMCAL_AdcDeInit()

IVEC_McalStatus_e xMCAL_AdcDeInit ( ADC12_Regs *const  adc_inst)

De-Initialize the ADC peripheral to their default reset values.

Parameters
adc_instADC handle
Return values
IVECMCAL status

◆ xMCAL_AdcInit()

IVEC_McalStatus_e xMCAL_AdcInit ( ADC12_Regs *const  adc_inst)

Initlization ADC with DMA.

Note
Interruptions enabled in this function
Parameters
adc_instADC handle
Return values
IVECMCAL status

◆ xMCAL_AdcStart()

IVEC_McalStatus_e xMCAL_AdcStart ( ADC12_Regs *const  adc_inst)

Enable ADC, start conversion of regular group.

Note
Interruptions enabled in this function: None.
Parameters
adc_instADC handle
Return values
IVECMCAL status

◆ xMCAL_AdcStop()

IVEC_McalStatus_e xMCAL_AdcStop ( ADC12_Regs *const  adc_inst)

Stop ADC conversion of regular group.

Parameters
adc_instADC handle
Return values
IVECMCAL status

◆ xMCAL_DmaDeInit()

IVEC_McalStatus_e xMCAL_DmaDeInit ( void  )

De-Initialize the DMA to their default reset values.

Parameters
adc_instADC handle
Return values
IVECMCAL status

◆ xMCAL_DmaInit()

IVEC_McalStatus_e xMCAL_DmaInit ( void  )

Initlization of DMA for ADC.

Note
Interruptions enabled in this function
Parameters
adc_instADC handle
Return values
IVECMCAL status

◆ xMCAL_DmaStart()

IVEC_McalStatus_e xMCAL_DmaStart ( const uint8_t  u8channel,
uint16_t *  p_u16adcDma 
)

Enable DMA, start transfer from ADC to DMA of regular group.

Note
Interruptions enabled in this function: None.
Parameters
u8Channeluse to pass the DMA channel
p_u16adcDmause to get the ADC raw
Return values
IVECMCAL status

◆ xMCAL_DmaStop()

IVEC_McalStatus_e xMCAL_DmaStop ( void  )

Function use to set the DMA channel.

Parameters
u8Channeluse to pass the DMA channel
Return values
IVECMCAL status

Variable Documentation

◆ g_u32AdcInitFlag

volatile bool g_u32AdcInitFlag = 0
static

ADC initialization flag

◆ g_u32AdcStartFlag

volatile bool g_u32AdcStartFlag =0
static

ADC start - stop flag

◆ g_u32DmaFlag

volatile bool g_u32DmaFlag =0
static

DMA initialization flag

◆ g_u32DmaStart

volatile bool g_u32DmaStart =0
static

DMA initialization flag

◆ gADC12_1ClockConfig

const DL_ADC12_ClockConfig gADC12_1ClockConfig
static
Initial value:
= {
.clockSel = DL_ADC12_CLOCK_SYSOSC,
.divideRatio = DL_ADC12_CLOCK_DIVIDE_1,
.freqRange = DL_ADC12_CLOCK_FREQ_RANGE_24_TO_32,
}

Configuration for ADC12_0 clock.

◆ gDMA_CH0Config

const DL_DMA_Config gDMA_CH0Config
static
Initial value:
= {
.transferMode = DL_DMA_SINGLE_TRANSFER_MODE,
.extendedMode = DL_DMA_NORMAL_MODE,
.destIncrement = DL_DMA_ADDR_UNCHANGED,
.srcIncrement = DL_DMA_ADDR_UNCHANGED,
.destWidth = DL_DMA_WIDTH_WORD,
.srcWidth = DL_DMA_WIDTH_WORD,
.trigger = ADC12_1_INST_DMA_TRIGGER,
.triggerType = DL_DMA_TRIGGER_TYPE_EXTERNAL,
}

Configuration for DMA.