Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
PCA9685PWMBit Class Reference

Specialization of the PWM abstract interface for the PCA9685. More...

#include <PCA9685PWM.hxx>

Inheritance diagram for PCA9685PWMBit:
PWM

Public Member Functions

 PCA9685PWMBit (PCA9685PWM *instance, unsigned index)
 Constructor.
 
 ~PCA9685PWMBit ()
 Destructor.
 
- 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 Member Functions

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.
 
 DISALLOW_COPY_AND_ASSIGN (PCA9685PWMBit)
 

Private Attributes

PCA9685PWMinstance_
 instance pointer to the whole chip complement
 
unsigned index_
 bit index within PCA9685
 

Additional Inherited Members

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

Detailed Description

Specialization of the PWM abstract interface for the PCA9685.

Definition at line 347 of file PCA9685PWM.hxx.

Constructor & Destructor Documentation

◆ PCA9685PWMBit()

PCA9685PWMBit::PCA9685PWMBit ( PCA9685PWM instance,
unsigned  index 
)
inline

Constructor.

Parameters
instancereference to the chip
indexchannel index on the chip (0 through 15)

Definition at line 353 of file PCA9685PWM.hxx.

◆ ~PCA9685PWMBit()

PCA9685PWMBit::~PCA9685PWMBit ( )
inline

Destructor.

Definition at line 362 of file PCA9685PWM.hxx.

Member Function Documentation

◆ get_duty()

uint32_t PCA9685PWMBit::get_duty ( )
inlineoverrideprivatevirtual

Gets the duty cycle.

Returns
counts duty cycle in counts

Implements PWM.

Definition at line 390 of file PCA9685PWM.hxx.

◆ get_period()

uint32_t PCA9685PWMBit::get_period ( )
inlineoverrideprivatevirtual

Get PWM period.

Returns
PWM period in counts

Implements PWM.

Definition at line 376 of file PCA9685PWM.hxx.

◆ get_period_max()

uint32_t PCA9685PWMBit::get_period_max ( )
inlineoverrideprivatevirtual

Get max period supported.

Returns
period in counts

Implements PWM.

Definition at line 397 of file PCA9685PWM.hxx.

◆ get_period_min()

uint32_t PCA9685PWMBit::get_period_min ( )
inlineoverrideprivatevirtual

Get min period supported.

Returns
period in counts

Implements PWM.

Definition at line 404 of file PCA9685PWM.hxx.

◆ set_duty()

void PCA9685PWMBit::set_duty ( uint32_t  counts)
inlineoverrideprivatevirtual

Sets the duty cycle.

Parameters
countsduty cycle in counts

Implements PWM.

Definition at line 383 of file PCA9685PWM.hxx.

◆ set_period()

void PCA9685PWMBit::set_period ( uint32_t  counts)
inlineoverrideprivatevirtual

Set PWM period.

Parameters
PWMperiod in counts

Implements PWM.

Definition at line 369 of file PCA9685PWM.hxx.

Member Data Documentation

◆ index_

unsigned PCA9685PWMBit::index_
private

bit index within PCA9685

Definition at line 413 of file PCA9685PWM.hxx.

◆ instance_

PCA9685PWM* PCA9685PWMBit::instance_
private

instance pointer to the whole chip complement

Definition at line 410 of file PCA9685PWM.hxx.


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