Infrared4Arduino 1.2.3
Loading...
Searching...
No Matches
Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
IrSenderPwmSoft Class Referenceabstract

Sending function using timer PWM. More...

#include <IrSenderPwmSoft.h>

Inheritance diagram for IrSenderPwmSoft:
Inheritance graph
[legend]
Collaboration diagram for IrSenderPwmSoft:
Collaboration graph
[legend]

Protected Member Functions

 IrSenderPwmSoft (pin_t outputPin)
 
virtual ~IrSenderPwmSoft ()
 
void enable (frequency_t hz, dutycycle_t dutyCycle=Board::defaultDutyCycle)
 
void sendMark (microseconds_t time)
 
virtual void sleepMicros (microseconds_t us)=0
 
virtual void sleepUntilMicros (uint32_t terminateTime)=0
 
- Protected Member Functions inherited from IrSenderPwm
 IrSenderPwm (pin_t sendPin)
 
virtual ~IrSenderPwm ()
 
- Protected Member Functions inherited from IrSender
void writeHigh ()
 
void writeLow ()
 
 IrSender (pin_t pin)
 
virtual void enable (frequency_t frequency, dutycycle_t dutyCycle=Board::defaultDutyCycle)=0
 
virtual void sendSpace (microseconds_t time)
 
virtual void sendMark (microseconds_t time)=0
 

Protected Attributes

microseconds_t periodTime
 
microseconds_t periodOnTime
 
microseconds_t periodOffTime
 

Static Protected Attributes

static constexpr unsigned int PULSE_CORRECTION = 3U
 

Additional Inherited Members

- Public Member Functions inherited from IrSender
pin_t getPin () const
 
virtual ~IrSender ()
 
virtual void send (const IrSequence &irSequence, frequency_t frequency=IrSignal::defaultFrequency, dutycycle_t dutyCycle=Board::defaultDutyCycle)
 Sends an IrSequence with the prescribed frequency. More...
 
void sendIrSignal (const IrSignal &irSignal, unsigned int noSends=1)
 Sends the IrSignal given as argument the prescribed number of times. More...
 
void sendWhile (const IrSignal &irSignal, bool(*trigger)())
 Send an IrSignal, when and as long as trigger() returns true. More...
 
void mute ()
 Force output pin inactive. More...
 
- Static Public Member Functions inherited from IrSenderPwm
static unsigned int getDutyCycle ()
 
static IrSenderPwmgetInstance (bool create=false, pin_t outputPin=Board::getInstance() ->defaultPwmPin())
 Returns a pointer to the instance, or nullptr if not initialized. More...
 
static IrSenderPwmnewInstance (pin_t outputPin)
 Creates a new instance (if not existing) and returns it. More...
 
static void deleteInstance ()
 
- Static Protected Member Functions inherited from IrSender
static void barfForInvalidPin (pin_t sendPin __attribute__((unused)))
 

Detailed Description

Sending function using timer PWM.

Due to the nature of the timers, this is a Highlander, ("There can only be one"), so the class is a singleton class, with private constructor, a factory method that enforces the "highlander property".

Definition at line 28 of file IrSenderPwmSoft.h.

Constructor & Destructor Documentation

◆ IrSenderPwmSoft()

IrSenderPwmSoft::IrSenderPwmSoft ( pin_t  outputPin)
protected

Definition at line 21 of file IrSenderPwmSoft.cpp.

◆ ~IrSenderPwmSoft()

virtual IrSenderPwmSoft::~IrSenderPwmSoft ( )
inlineprotectedvirtual

Definition at line 31 of file IrSenderPwmSoft.h.

Member Function Documentation

◆ enable()

void IrSenderPwmSoft::enable ( frequency_t  hz,
dutycycle_t  dutyCycle = Board::defaultDutyCycle 
)
protectedvirtual

Implements IrSender.

Definition at line 47 of file IrSenderPwmSoft.cpp.

◆ sendMark()

void IrSenderPwmSoft::sendMark ( microseconds_t  time)
protectedvirtual

Implements IrSender.

Definition at line 54 of file IrSenderPwmSoft.cpp.

◆ sleepMicros()

virtual void IrSenderPwmSoft::sleepMicros ( microseconds_t  us)
protectedpure virtual

◆ sleepUntilMicros()

virtual void IrSenderPwmSoft::sleepUntilMicros ( uint32_t  terminateTime)
protectedpure virtual

Member Data Documentation

◆ periodOffTime

microseconds_t IrSenderPwmSoft::periodOffTime
protected

Definition at line 40 of file IrSenderPwmSoft.h.

◆ periodOnTime

microseconds_t IrSenderPwmSoft::periodOnTime
protected

Definition at line 39 of file IrSenderPwmSoft.h.

◆ periodTime

microseconds_t IrSenderPwmSoft::periodTime
protected

Definition at line 38 of file IrSenderPwmSoft.h.

◆ PULSE_CORRECTION

constexpr unsigned int IrSenderPwmSoft::PULSE_CORRECTION = 3U
staticconstexprprotected

Definition at line 34 of file IrSenderPwmSoft.h.


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