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

Public Member Functions

 Channel (Stm32PWMGroup *parent, uint32_t channel)
 
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

Stm32PWMGroupparent_
 
uint32_t channel_
 
uint32_t lastDuty_ {0}
 Last set duty cycle.
 

Additional Inherited Members

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

Detailed Description

Definition at line 87 of file Stm32PWM.hxx.

Constructor & Destructor Documentation

◆ Channel()

Stm32PWMGroup::Channel::Channel ( Stm32PWMGroup parent,
uint32_t  channel 
)
inline

Definition at line 90 of file Stm32PWM.hxx.

Member Function Documentation

◆ get_duty()

uint32_t Stm32PWMGroup::Channel::get_duty ( )
inlineoverridevirtual

Gets the duty cycle.

Returns
counts duty cycle in counts

Implements PWM.

Definition at line 124 of file Stm32PWM.hxx.

◆ get_period()

uint32_t Stm32PWMGroup::Channel::get_period ( )
inlineoverridevirtual

Get PWM period.

Returns
PWM period in counts

Implements PWM.

Definition at line 100 of file Stm32PWM.hxx.

◆ get_period_max()

uint32_t Stm32PWMGroup::Channel::get_period_max ( )
inlineoverridevirtual

Get max period supported.

Returns
period in counts

Implements PWM.

Definition at line 129 of file Stm32PWM.hxx.

◆ get_period_min()

uint32_t Stm32PWMGroup::Channel::get_period_min ( )
inlineoverridevirtual

Get min period supported.

Returns
period in counts

Implements PWM.

Definition at line 133 of file Stm32PWM.hxx.

◆ set_duty()

void Stm32PWMGroup::Channel::set_duty ( uint32_t  counts)
inlineoverridevirtual

Sets the duty cycle.

Parameters
countsduty cycle in counts

Implements PWM.

Definition at line 105 of file Stm32PWM.hxx.

◆ set_period()

void Stm32PWMGroup::Channel::set_period ( uint32_t  counts)
inlineoverridevirtual

Set PWM period.

Parameters
PWMperiod in counts

Implements PWM.

Definition at line 96 of file Stm32PWM.hxx.

Member Data Documentation

◆ channel_

uint32_t Stm32PWMGroup::Channel::channel_
private

Definition at line 140 of file Stm32PWM.hxx.

◆ lastDuty_

uint32_t Stm32PWMGroup::Channel::lastDuty_ {0}
private

Last set duty cycle.

Definition at line 142 of file Stm32PWM.hxx.

◆ parent_

Stm32PWMGroup* Stm32PWMGroup::Channel::parent_
private

Definition at line 139 of file Stm32PWM.hxx.


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