How to use vSetPwm() function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use vSetPwm() function

635 Views
yuboli
Contributor II

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.

0 Kudos
3 Replies

547 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Daniel, I hope you're doing well!

 

The function takes as parameters the following values:

psPwmTimer corresponds to the base address for the timer used for PWM, Rise and Fall correspond to the previous PWM value and period accordingly, and control corresponds to the different configuration flags for the PWM.

 

Ad for vSetDualPwm, this function calls the previous function twice, once for white and the other for amber lights.

 

Unfortunately, the available documentation is limited to the comments in the source file.

 

Best regards,

Sebastian

547 Views
yuboli
Contributor II

Thanks

0 Kudos

547 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Daniel,

Please let me know if you need any more information!

Best regards,

Sebastian

0 Kudos