Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.
Joseph Ryan edited this page Aug 19, 2017 · 3 revisions

Go to the source code for pwm.h

Includes

  • #include "gpio.h"

Functions

Function Documention


InitializePWM

Initializes a PWM signal for a pin

tPWM *InitializePWM(tPin pin, float freq);

Parameters:

  • pin Pin that will output a PWM signal
  • freq Frequency of the signal, must be specified in hertz

Returns:

  • Pointer to an initialized tPWM, can be used by the SetPWM function

Notes:

  • If the number of frequencies passes the number of available modules, which is currently 12, then a null pointer is returned

SetPWM

Sets a PWM duty cycle and phase

void SetPWM(tPWM *pwm, float duty, float phase);

Parameters:

  • pwm Initialized tPWM, returned by InitializePWM
  • duty Duty cycle of signal, specified as a percentage
  • phase Phase of signal, specified as a percentage

Clone this wiki locally