Skip to content
Ryan Summers edited this page Oct 23, 2015 · 5 revisions

PWM Functions

This page describes the functions available within the PWM peripheral library of SUBLIBinal. Please select a function from the list below to read the appropriate documentation about it.

Functions


initialize_PWM

Definition

void initialize_PWM(PWM_Config config);

Description
The initialize PWM function is used for the initialization of a PWM on a pin. The function will configure the specified pin and set it as an output. Please note, if an invalid pin is entered, a valid pin will be defaulted to. This can cause unexpected results if an invalid pin is entered.

Parameters

  • config: the config parameter should be a completely filled in configuration structure for the PWM module.

top


enable_PWM

Definition

void enable_PWM(PWM_Channel channel);

Description
The enable PWM function will simply enable a PWM waveform on the specified PWM channel. No other configuration occurs within this function.

Parameters

  • channel: this function accepts a single configuration parameter. The only value that must be present within the structure is a PWM_Channel so that the proper channel is enabled.

top


disable_PWM

Definition

void disable_PWM(PWM_Channel channel);

Description
This function will disable a PWM waveform on the specified PWM channel. No other configuration occurs within this function.

Parameters

  • channel: This function accepts a single parameter. The channel specified will be used in determining which channel to disable.

top


update_PWM

Definition

void update_PWM(PWM_Config config, float dutyCycle);

Description
This function will change the duty cycle of the specified PWM channel in the configuration structure. This function does not interrupt PWM operation and will update the PWM duty cycle on the next available cycle.

Parameters

  • config: This parameter is a configuration structure for the PWM module. The only parameter that must be present is the channel of the PWM so that the proper channel is updated.
  • dutyCycle: This parameter should be the new duty cycle desired on the associated PWM channel.

top

Clone this wiki locally