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

Functions

IVEC_McalStatus_e xMCAL_TimerInit (GPTIMER_Regs *const pTimer_inst)
 Initlization Periodic timer. More...
 
IVEC_McalStatus_e xMCAL_TimerDeInit (GPTIMER_Regs *const pTimer_inst)
 De-Initialize the Timer peripheral to their default reset values. More...
 
IVEC_McalStatus_e xMCAL_TimergetCount (uint32_t *p_u32temp)
 To get the timer counts. More...
 
IVEC_McalStatus_e xMCAL_TimerstartCounter (void)
 Start the Timer counter. More...
 
IVEC_McalStatus_e xMCAL_TimerstopCounter (void)
 Stop the Timer stop. More...
 
IVEC_McalStatus_e xMCAL_TimersetLoadValue (GPTIMER_Regs *const pTimer_inst, uint32_t count, uint32_t *p_u32temp)
 Function use to set load value of timer. More...
 
void _prv_timGcallback ()
 Timer call back function. More...
 
void TIMG0_IRQHandler ()
 Timer IRQ handler. More...
 
IVEC_McalStatus_e xMCAL_PwmInit (GPTIMER_Regs *const Tim_inst)
 Initlization PWM timer. More...
 
IVEC_McalStatus_e xMCAL_PwmDeInit (GPTIMER_Regs *const Tim_inst)
 De-Initlization PWM timer. More...
 
IVEC_McalStatus_e xMCAL_PwmStart (void)
 Enable PWM Timer. More...
 
IVEC_McalStatus_e xMCAL_PwmStop (void)
 Disable PWM Timer. More...
 
IVEC_McalStatus_e xMCAL_InputCaptureInit (GPTIMER_Regs *const Tim_inst)
 Initlization Input Capture timer. More...
 
IVEC_McalStatus_e xMCAL_InputCaptureDeInit (GPTIMER_Regs *const Tim_inst)
 De-Initlization Input Capture timer. More...
 
IVEC_McalStatus_e xMCAL_InputCaptureStart (void)
 Enable IC timer. More...
 
IVEC_McalStatus_e xMCAL_InputCaptureStop (void)
 Disable IC timer. More...
 
void vMCAL_Calcfrequency (float *f_frequency)
 Calculate the frequency of input PWM signal. More...
 
void _prv_timAcallback ()
 Timer call back function. More...
 
void TIMA0_IRQHandler ()
 Timer IRQ handler. More...
 

Variables

static volatile bool g_u32TimerInitFlag = 0
 
static volatile bool g_u32TimerCounterFlag = 0
 
static volatile bool g_u32PwmInitflag = 0
 
static volatile bool g_u32Pwmstartflag = 0
 
static volatile bool g_u32InputCaputerflag =0
 
static volatile uint32_t g_u32CapturePeriod
 
static volatile uint32_t g_u32CaptureValue0
 
static volatile uint32_t g_u32CaptureValue1
 
static volatile uint32_t g_u32LoadValue
 
float f_frequency =0
 
static const DL_TimerA_ClockConfig gCAPTURE_0ClockConfig
 Configuration for Input capture timer. More...
 
static const DL_TimerA_CaptureCombinedConfig gCAPTURE_0CaptureConfig
 Configuration for Input capture mode channel. More...
 
static const DL_TimerG_ClockConfig gTIMER_0ClockConfig
 Configuration for Periodic Timer. More...
 
static const DL_TimerG_TimerConfig gTIMER_0TimerConfig
 Configuration for Periodic timer Mode and Period. More...
 
static const DL_TimerG_ClockConfig gPWM_0ClockConfig
 Configuration for PWM timer. More...
 
static const DL_TimerG_PWMConfig gPWM_0Config
 Configuration for PWM time MODE and Periode. More...
 

Function Documentation

◆ _prv_timAcallback()

void _prv_timAcallback ( )

Timer call back function.

Note
f_frequency: get the calculated frequency

◆ _prv_timGcallback()

void _prv_timGcallback ( )

Timer call back function.

Note
Interruptions enabled in this function

◆ TIMA0_IRQHandler()

void TIMA0_IRQHandler ( )

Timer IRQ handler.

◆ TIMG0_IRQHandler()

void TIMG0_IRQHandler ( )

Timer IRQ handler.

◆ vMCAL_Calcfrequency()

void vMCAL_Calcfrequency ( float *  f_frequency)

Calculate the frequency of input PWM signal.

Parameters
f_frequencyto get Calculate frequency
Return values
IVECMCAL status

◆ xMCAL_InputCaptureDeInit()

IVEC_McalStatus_e xMCAL_InputCaptureDeInit ( GPTIMER_Regs *const  Tim_inst)

De-Initlization Input Capture timer.

Parameters
Tim_instTimer handle
Return values
IVECMCAL status

◆ xMCAL_InputCaptureInit()

IVEC_McalStatus_e xMCAL_InputCaptureInit ( GPTIMER_Regs *const  Tim_inst)

Initlization Input Capture timer.

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

◆ xMCAL_InputCaptureStart()

IVEC_McalStatus_e xMCAL_InputCaptureStart ( void  )

Enable IC timer.

Return values
IVECMCAL status

◆ xMCAL_InputCaptureStop()

IVEC_McalStatus_e xMCAL_InputCaptureStop ( void  )

Disable IC timer.

Return values
IVECMCAL status

◆ xMCAL_PwmDeInit()

IVEC_McalStatus_e xMCAL_PwmDeInit ( GPTIMER_Regs *const  Tim_inst)

De-Initlization PWM timer.

Parameters
Tim_instTimer handle
Return values
IVECMCAL status

◆ xMCAL_PwmInit()

IVEC_McalStatus_e xMCAL_PwmInit ( GPTIMER_Regs *const  Tim_inst)

Initlization PWM timer.

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

◆ xMCAL_PwmStart()

IVEC_McalStatus_e xMCAL_PwmStart ( void  )

Enable PWM Timer.

Return values
IVECMCAL status

◆ xMCAL_PwmStop()

IVEC_McalStatus_e xMCAL_PwmStop ( void  )

Disable PWM Timer.

Return values
IVECMCAL status

◆ xMCAL_TimerDeInit()

IVEC_McalStatus_e xMCAL_TimerDeInit ( GPTIMER_Regs *const  pTimer_inst)

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

Parameters
pTimer_instTimer handle
Return values
IVECMCAL status

◆ xMCAL_TimergetCount()

IVEC_McalStatus_e xMCAL_TimergetCount ( uint32_t *  p_u32temp)

To get the timer counts.

Parameters
p_u32tempto get the timer counts
Return values
IVECMCAL status

◆ xMCAL_TimerInit()

IVEC_McalStatus_e xMCAL_TimerInit ( GPTIMER_Regs *const  pTimer_inst)

Initlization Periodic timer.

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

◆ xMCAL_TimersetLoadValue()

IVEC_McalStatus_e xMCAL_TimersetLoadValue ( GPTIMER_Regs *const  pTimer_inst,
uint32_t  count,
uint32_t *  p_u32temp 
)

Function use to set load value of timer.

Parameters
pTimer_instTimer handle
u8Channeluse to pass the load value
p_u32tempuse to get loaded value
Return values
IVECMCAL status

◆ xMCAL_TimerstartCounter()

IVEC_McalStatus_e xMCAL_TimerstartCounter ( void  )

Start the Timer counter.

Return values
IVECMCAL status

◆ xMCAL_TimerstopCounter()

IVEC_McalStatus_e xMCAL_TimerstopCounter ( void  )

Stop the Timer stop.

Return values
IVECMCAL status

Variable Documentation

◆ f_frequency

float f_frequency =0

To get calculated frequency

◆ g_u32CapturePeriod

volatile uint32_t g_u32CapturePeriod
static

To get the first capture period

◆ g_u32CaptureValue0

volatile uint32_t g_u32CaptureValue0
static

To get the first capture value

◆ g_u32CaptureValue1

volatile uint32_t g_u32CaptureValue1
static

To get the second capture value

◆ g_u32InputCaputerflag

volatile bool g_u32InputCaputerflag =0
static

Input Capture initialization flag

◆ g_u32LoadValue

volatile uint32_t g_u32LoadValue
static

To get timer loaded value

◆ g_u32PwmInitflag

volatile bool g_u32PwmInitflag = 0
static

PWM initialization flag

◆ g_u32Pwmstartflag

volatile bool g_u32Pwmstartflag = 0
static

PWM Start flag

◆ g_u32TimerCounterFlag

volatile bool g_u32TimerCounterFlag = 0
static

Timer Counter flag

◆ g_u32TimerInitFlag

volatile bool g_u32TimerInitFlag = 0
static

Timer initialization flag

◆ gCAPTURE_0CaptureConfig

const DL_TimerA_CaptureCombinedConfig gCAPTURE_0CaptureConfig
static
Initial value:
= {
.captureMode = DL_TIMER_CAPTURE_COMBINED_MODE_PULSE_WIDTH_AND_PERIOD,
.period = CAPTURE_0_INST_LOAD_VALUE,
.startTimer = DL_TIMER_STOP,
.inputChan = DL_TIMER_INPUT_CHAN_0,
.inputInvMode = DL_TIMER_CC_INPUT_INV_NOINVERT,
}

Configuration for Input capture mode channel.

◆ gCAPTURE_0ClockConfig

const DL_TimerA_ClockConfig gCAPTURE_0ClockConfig
static
Initial value:
= {
.clockSel = DL_TIMER_CLOCK_BUSCLK,
.divideRatio = DL_TIMER_CLOCK_DIVIDE_1,
.prescale = 32U
}

Configuration for Input capture timer.

◆ gPWM_0ClockConfig

const DL_TimerG_ClockConfig gPWM_0ClockConfig
static
Initial value:
= {
.clockSel = DL_TIMER_CLOCK_BUSCLK,
.divideRatio = DL_TIMER_CLOCK_DIVIDE_1,
.prescale = 31U
}

Configuration for PWM timer.

◆ gPWM_0Config

const DL_TimerG_PWMConfig gPWM_0Config
static
Initial value:
= {
.pwmMode = DL_TIMER_PWM_MODE_EDGE_ALIGN,
.period = 1000,
.startTimer = DL_TIMER_STOP,
}

Configuration for PWM time MODE and Periode.

◆ gTIMER_0ClockConfig

const DL_TimerG_ClockConfig gTIMER_0ClockConfig
static
Initial value:
= {
.clockSel = DL_TIMER_CLOCK_LFCLK,
.divideRatio = DL_TIMER_CLOCK_DIVIDE_1,
.prescale = 32U,
}

Configuration for Periodic Timer.

◆ gTIMER_0TimerConfig

const DL_TimerG_TimerConfig gTIMER_0TimerConfig
static
Initial value:
= {
.period = TIMER_0_INST_LOAD_VALUE,
.timerMode = DL_TIMER_TIMER_MODE_PERIODIC,
.startTimer = DL_TIMER_STOP,
}

Configuration for Periodic timer Mode and Period.