1.25.13.6 PWMx_ChannelDutySet Function

C

/* x = PWM instance number */

void PWMx_ChannelDutySet(PWM_CHANNEL_NUM channel, uint32_t duty);

void PWMx_ChannelDutySet(PWM_CHANNEL_NUM channel, uint16_t duty);

Summary

Writes the duty cycle value of given PWM channel

Description

This function writes the duty cycle value in double buffer register. Update to the actual duty cycle register happens at the next period border.

Precondition

PWMx_Initialize() function must have been called first for the associated instance. And associated channel must be running.

Parameters

Param Description
channel PWM channel number
duty duty cycle value which determines ON time of waveform. Refer the generated header for the exact data type

Returns

channel - PWM channel number

duty - duty cycle value

Example

PWM0_Initialize();
PWM0_ChannelsStart(PWM_CHANNEL_0_MASK);
PWM0_ChannelDutySet(PWM_CHANNEL_0, 0x200);

Remarks

Refer the generated header file for the exact function signature