Treehopper C# API
HardwarePwm Class Reference

Built-in hardware PWM channels. More...

Inheritance diagram for HardwarePwm:
Pwm

Public Member Functions

Task DisablePwmAsync ()
 Disables the PWM functionality More...
 
Task EnablePwmAsync ()
 Enable the PWM functionality More...
 
override string ToString ()
 Returns this PWM channel's data in an easy-to-read format More...
 

Properties

bool Enabled [get, set]
 Gets or sets the value determining whether the PWM functionality of the pin is enabled. More...
 
double DutyCycle [get, set]
 Get or set the duty cycle (0-1) of the pin More...
 
double PulseWidth [get, set]
 Get or set the pulse width, in microseconds, of the pin More...
 

Detailed Description

Built-in hardware PWM channels.

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.

Member Function Documentation

◆ DisablePwmAsync()

Task DisablePwmAsync ( )

Disables the PWM functionality

Returns
An awaitable task that completes when the PWM functionality is disabled

Implements Pwm.

◆ EnablePwmAsync()

Task EnablePwmAsync ( )

Enable the PWM functionality

///

Returns
An awaitable task that completes when the PWM functionality is enabled

Implements Pwm.

◆ ToString()

override string ToString ( )

Returns this PWM channel's data in an easy-to-read format

Returns
A string representation of the channel

Property Documentation

◆ Enabled

bool Enabled
getset

Gets or sets the value determining whether the PWM functionality of the pin is enabled.

◆ DutyCycle

double DutyCycle
getset

Get or set the duty cycle (0-1) of the pin

◆ PulseWidth

double PulseWidth
getset

Get or set the pulse width, in microseconds, of the pin


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