Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
Hardware pulse width modulation. More...
#include <HardwarePWM.h>
Public Member Functions | |
HardwarePWM (uint8 *pins, uint8 no_of_pins) | |
Instantiate hardware PWM object. More... | |
bool | analogWrite (uint8 pin, uint32 duty) |
Set PWM duty cycle. More... | |
bool | setDuty (uint8 pin, uint32 duty) |
Set PWM duty cycle. More... | |
uint32 | getDuty (uint8 pin) |
Get PWM duty cycle. More... | |
void | setPeriod (uint32 period) |
Set PWM period. More... | |
uint32 | getPeriod (void) |
Get PWM period. More... | |
uint8 | getChannel (uint8 pin) |
Get channel number for a pin. More... | |
uint32 | getMaxDuty () |
Get the maximum duty cycle value. More... | |
Hardware pulse width modulation.
HardwarePWM::HardwarePWM | ( | uint8 * | pins, |
uint8 | no_of_pins | ||
) |
Instantiate hardware PWM object.
pins | Pointer to array of pins to control |
no_of_pins | Quantity of elements in array of pins |
bool HardwarePWM::analogWrite | ( | uint8 | pin, |
uint32 | duty | ||
) |
Set PWM duty cycle.
pin | GPIO to set |
duty | Value of duty cycle to set pin to |
bool | True on success |
uint8 HardwarePWM::getChannel | ( | uint8 | pin | ) |
Get channel number for a pin.
pin | GPIO to interrogate |
uint8 | Channel of GPIO |
uint32 HardwarePWM::getDuty | ( | uint8 | pin | ) |
Get PWM duty cycle.
pin | GPIO to get duty cycle for |
uint32 | Value of PWM duty cycle |
uint32 HardwarePWM::getMaxDuty | ( | ) |
Get the maximum duty cycle value.
uint32 | Maximum permissible duty cycle |
uint32 HardwarePWM::getPeriod | ( | void | ) |
Get PWM period.
uint32 | Value of PWM period |
bool HardwarePWM::setDuty | ( | uint8 | pin, |
uint32 | duty | ||
) |
Set PWM duty cycle.
pin | GPIO to set |
duty | Value of duty cycle to set pin to |
bool | True on success |
void HardwarePWM::setPeriod | ( | uint32 | period | ) |
Set PWM period.
period | PWM period |