Boboter
Loading...
Searching...
No Matches
HAL::LEDC::Controller Class Reference

The LEDC hardware abstraction layer's control class. More...

#include <ledc.h>

Public Member Functions

 Controller (const Controller &)=delete
Controller & operator= (const Controller &)=delete
void shutdown ()
 Resets all channels and shuts down the controller.
void add_timer (const timer_config_t &config)
 Configures a new LEDC timer using the given config.
void add_channel (const channel_config_t &config)
 Configures a new LEDC channel using the given config.
void set_frequency (ledc_timer_t ledc_timer, uint32_t frequency) const
 Sets the frequency of a specific LEDC timer.
void set_duty (ledc_channel_t ledc_channel, uint32_t duty) const
 Sets the duty cycle of a specific LEDC channel.

Static Public Member Functions

static Controller & get_instance ()
 Gets the controller instance.

Detailed Description

The LEDC hardware abstraction layer's control class.

Constructor & Destructor Documentation

◆ Controller()

HAL::LEDC::Controller::Controller ( const Controller & )
delete

Member Function Documentation

◆ add_channel()

void HAL::LEDC::Controller::add_channel ( const channel_config_t & config)

Configures a new LEDC channel using the given config.

Parameters
configThe channel config to use

◆ add_timer()

void HAL::LEDC::Controller::add_timer ( const timer_config_t & config)

Configures a new LEDC timer using the given config.

Parameters
configThe timer config to use

◆ get_instance()

Controller & HAL::LEDC::Controller::get_instance ( )
inlinestatic

Gets the controller instance.

Note
The instance will be created on the first call of this function
Returns
Reference to the controller object

◆ operator=()

Controller & HAL::LEDC::Controller::operator= ( const Controller & )
delete

◆ set_duty()

void HAL::LEDC::Controller::set_duty ( ledc_channel_t ledc_channel,
uint32_t duty ) const

Sets the duty cycle of a specific LEDC channel.

Parameters
ledc_channelThe channel of which to set the duty cycle
dutyThe target duty cycle

◆ set_frequency()

void HAL::LEDC::Controller::set_frequency ( ledc_timer_t ledc_timer,
uint32_t frequency ) const

Sets the frequency of a specific LEDC timer.

Parameters
ledc_timerThe timer of which to set the frequency
frequencyThe target frequency

◆ shutdown()

void HAL::LEDC::Controller::shutdown ( )

Resets all channels and shuts down the controller.


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