AnsweredAssumed Answered

How to use vSetPwm() function

Question asked by Daniel li on Jan 29, 2020
Latest reply on Mar 6, 2020 by Sebastián Del Río

Hi, 

I use jn1189 project. In the Driverbulb_Dr1221_Mic. C file, how does vsetpwm() function understand?                  

The code is as follows:

 

 

PRIVATE void vSetDualPwm(uint32 u32ResetMask)
{
vSetPwm((tsTimer*)LEVEL_TIMER_BASE,sBulb.u32PwmLastValue[0],sBulb.u32PwmPeriod,PWM_START_TIMER_PWM_POLARITY | u32ResetMask);
#ifdef DUAL_PWM
vSetPwm((tsTimer *)TEMP_TIMER_BASE, sBulb.u32PwmLastValue[1],sBulb.u32PwmPeriod(TIMER_START_REPEAT | REG_TMR_CTRL_INVOUT_MASK | u32ResetMask));
#endif
}

 

PRIVATE void vSetPwm(tsTimer * const psPwmTimer, uint32 u32Rise, uint32 u32Fall, uint32 u32Control)
{
psPwmTimer->u32Rise = sBulb.bIsOn ? u32Rise : 0UL;
psPwmTimer->u32Fall = u32Fall;
psPwmTimer->u32Control = u32Control;
}

How to understand the above codes?

 Thank you very much.

Outcomes