Speeduino
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
PwmOutputChannel< TPin > Struct Template Reference

#include <PwmOutputChannel.h>

Public Member Functions

 PwmOutputChannel ()=default
 Default construction - not usable yet.
 
 PwmOutputChannel (uint8_t pinNum, uint16_t fullDuty)
 Construct a new Pwm Output Channel object.
 
void setTargetDuty (uint8_t duty) noexcept
 Set the target PWM duty.
 
bool isNoDuty (void) const
 
bool isPartialDuty (void) const
 
bool isFullDuty (void) const
 

Public Attributes

uint16_t maxDuty = 0
 Maximum duty based on motor frequency.
 
uint16_t targetDuty = 0
 Requested duty cycle (0-100% or 0-255)
 
trackedOutputPinAdapter_t< TPin > pin
 The pin.
 

Constructor & Destructor Documentation

◆ PwmOutputChannel() [1/2]

template<class TPin >
PwmOutputChannel< TPin >::PwmOutputChannel ( )
default

Default construction - not usable yet.

◆ PwmOutputChannel() [2/2]

template<class TPin >
PwmOutputChannel< TPin >::PwmOutputChannel ( uint8_t  pinNum,
uint16_t  fullDuty 
)
inline

Construct a new Pwm Output Channel object.

Parameters
pinNumThe pin controlling the PWM motor
fullDutyThe frequency in Hz at 100% duty

Member Function Documentation

◆ isFullDuty()

template<class TPin >
bool PwmOutputChannel< TPin >::isFullDuty ( void  ) const
inline

◆ isNoDuty()

template<class TPin >
bool PwmOutputChannel< TPin >::isNoDuty ( void  ) const
inline

◆ isPartialDuty()

template<class TPin >
bool PwmOutputChannel< TPin >::isPartialDuty ( void  ) const
inline

◆ setTargetDuty()

template<class TPin >
void PwmOutputChannel< TPin >::setTargetDuty ( uint8_t  duty)
inlinenoexcept

Set the target PWM duty.

Parameters
dutyTarget duty in %*2. I.e. 0 to 200

Member Data Documentation

◆ maxDuty

template<class TPin >
uint16_t PwmOutputChannel< TPin >::maxDuty = 0

Maximum duty based on motor frequency.

◆ pin

template<class TPin >
trackedOutputPinAdapter_t<TPin> PwmOutputChannel< TPin >::pin

The pin.

◆ targetDuty

template<class TPin >
uint16_t PwmOutputChannel< TPin >::targetDuty = 0

Requested duty cycle (0-100% or 0-255)


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