Treehopper C++ API
HardwarePwm Class Reference

Built-in hardware PWM channels. More...

#include <HardwarePwm.h>

Inheritance diagram for HardwarePwm:
Pwm

Public Member Functions

 HardwarePwm (TreehopperUsb &board, int pinNumber)
 
 ~HardwarePwm () override
 
bool enabled () override
 Gets whether this hardware PWM pin is enabled. More...
 
void enabled (bool value) override
 Sets whether this hardware PWM pin is enabled. More...
 
virtual double dutyCycle ()
 Gets the duty cycle. More...
 
virtual void dutyCycle (double value)
 Sets the duty cycle. More...
 
virtual double pulseWidth ()
 Gets the pulse width. More...
 
virtual void pulseWidth (double value)
 Sets the pulse width. More...
 

Friends

class HardwarePwmManager
 

Detailed Description

Note
Treehopper has two types of PWM support — Hardware and Software PWM. For information on software PWM functionality, visit Treehopper.Pin.

Treehopper has three 16-bit hardware PWM channels labeled PWM1, PWM2, and PWM3. Like all peripherals, these are accessible from the TreehopperUsb instance.

Constructor & Destructor Documentation

◆ HardwarePwm()

HardwarePwm ( TreehopperUsb board,
int  pinNumber 
)

◆ ~HardwarePwm()

~HardwarePwm ( )
override

Member Function Documentation

◆ dutyCycle() [1/2]

virtual double dutyCycle ( )
inlinevirtualinherited

◆ dutyCycle() [2/2]

virtual void dutyCycle ( double  value)
inlinevirtualinherited

◆ enabled() [1/2]

bool enabled ( )
overridevirtual

Implements Pwm.

◆ enabled() [2/2]

void enabled ( bool  value)
overridevirtual

Implements Pwm.

◆ pulseWidth() [1/2]

virtual double pulseWidth ( )
inlinevirtualinherited

◆ pulseWidth() [2/2]

virtual void pulseWidth ( double  value)
inlinevirtualinherited

Friends And Related Function Documentation

◆ HardwarePwmManager

friend class HardwarePwmManager
friend

The documentation for this class was generated from the following file: