-
Notifications
You must be signed in to change notification settings - Fork 0
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.
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
configparameter should be a completely filled in configuration structure for the PWM module.
Definition
void enable_PWM(PWM_Config config);
Description
The enable PWM function will simply enable a PWM waveform on the specified PWM channel. No other configuration occurs within this function.
Parameters
- config: 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.
Definition
void disable_PWM(PWM_Config config);
Description
This function will disable a PWM waveform on the specified PWM channel. No other configuration occurs within this function.
Parameters
- config: This function accepts a single configuration structure. The only parameter within the structure that must be configured is the PWM channel parameter. This parameter is then used to disable the correct PWM channel.
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.
SUBLIBinal was created by the Palouse Robosub Club.