Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
ChannelPWM Class Reference

Pulse width modulator channel class. More...

#include <DriverPWM.h>

Public Member Functions

 ChannelPWM ()
 PWM channel. More...
 
 ChannelPWM (int DriverPWMPin)
 PWM channel. More...
 
void initialize ()
 Initialise PWM channel. More...
 
void IRAM_ATTR high ()
 Set GPIO high and reset PWM timer. More...
 
void config (int duty, uint32_t basePeriod)
 Configure PWM channel. More...
 
__inline int id ()
 Get the GPIO used by this PWM channel. More...
 
void close ()
 Close PWM channel. More...
 

Static Protected Member Functions

static void IRAM_ATTR processingStatic (void *arg)
 

Detailed Description

Pulse width modulator channel class.

Constructor & Destructor Documentation

ChannelPWM::ChannelPWM ( )

PWM channel.

ChannelPWM::ChannelPWM ( int  DriverPWMPin)

PWM channel.

Parameters
DriverPWMPinGPIO for this PWM channel

Member Function Documentation

void ChannelPWM::close ( )

Close PWM channel.

Note
Turns PWM off
void ChannelPWM::config ( int  duty,
uint32_t  basePeriod 
)

Configure PWM channel.

Parameters
dutyDuty cycle
basePeriodPeriod of PWM cycle
void IRAM_ATTR ChannelPWM::high ( )

Set GPIO high and reset PWM timer.

Note
Extends high (on) period for this cycle
__inline int ChannelPWM::id ( )
inline

Get the GPIO used by this PWM channel.

Return values
intGPIO in use
void ChannelPWM::initialize ( )

Initialise PWM channel.