Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openmrn_arduino::Esp32Ledc::Channel Class Reference
Inheritance diagram for openmrn_arduino::Esp32Ledc::Channel:
PWM

Public Member Functions

 Channel (Esp32Ledc *parent, ledc_channel_t channel, uint8_t pin)
 
void set_period (uint32_t counts) override
 Set PWM period.
 
uint32_t get_period () override
 Get PWM period.
 
void set_duty (uint32_t counts) override
 Sets the duty cycle.
 
uint32_t get_duty () override
 Gets the duty cycle.
 
uint32_t get_period_max () override
 Get max period supported.
 
uint32_t get_period_min () override
 Get min period supported.
 
- Public Member Functions inherited from PWM
void set_duty_percent (uint8_t percent)
 Sets the duty cycle.
 
uint8_t get_duty_percent ()
 Gets the duty cycle.
 

Private Attributes

Esp32Ledcparent_
 
ledc_channel_t channel_
 

Additional Inherited Members

- Protected Member Functions inherited from PWM
constexpr PWM ()=default
 Constructor.
 
 ~PWM ()=default
 Destructor.
 

Detailed Description

Definition at line 213 of file Esp32Ledc.hxx.

Constructor & Destructor Documentation

◆ Channel()

openmrn_arduino::Esp32Ledc::Channel::Channel ( Esp32Ledc parent,
ledc_channel_t  channel,
uint8_t  pin 
)
inline

Definition at line 216 of file Esp32Ledc.hxx.

Member Function Documentation

◆ get_duty()

uint32_t openmrn_arduino::Esp32Ledc::Channel::get_duty ( )
inlineoverridevirtual

Gets the duty cycle.

Returns
counts duty cycle in counts

Implements PWM.

Definition at line 237 of file Esp32Ledc.hxx.

◆ get_period()

uint32_t openmrn_arduino::Esp32Ledc::Channel::get_period ( )
inlineoverridevirtual

Get PWM period.

Returns
PWM period in counts

Implements PWM.

Definition at line 227 of file Esp32Ledc.hxx.

◆ get_period_max()

uint32_t openmrn_arduino::Esp32Ledc::Channel::get_period_max ( )
inlineoverridevirtual

Get max period supported.

Returns
period in counts

Implements PWM.

Definition at line 242 of file Esp32Ledc.hxx.

◆ get_period_min()

uint32_t openmrn_arduino::Esp32Ledc::Channel::get_period_min ( )
inlineoverridevirtual

Get min period supported.

Returns
period in counts

Implements PWM.

Definition at line 247 of file Esp32Ledc.hxx.

◆ set_duty()

void openmrn_arduino::Esp32Ledc::Channel::set_duty ( uint32_t  counts)
inlineoverridevirtual

Sets the duty cycle.

Parameters
countsduty cycle in counts

Implements PWM.

Definition at line 232 of file Esp32Ledc.hxx.

◆ set_period()

void openmrn_arduino::Esp32Ledc::Channel::set_period ( uint32_t  counts)
inlineoverridevirtual

Set PWM period.

Parameters
PWMperiod in counts

Implements PWM.

Definition at line 222 of file Esp32Ledc.hxx.

Member Data Documentation

◆ channel_

ledc_channel_t openmrn_arduino::Esp32Ledc::Channel::channel_
private

Definition at line 253 of file Esp32Ledc.hxx.

◆ parent_

Esp32Ledc* openmrn_arduino::Esp32Ledc::Channel::parent_
private

Definition at line 252 of file Esp32Ledc.hxx.


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