IRremote
Usage of timers for the different CPU / boards
Collaboration diagram for Usage of timers for the different CPU / boards:

Macros

#define IR_SEND_PIN
 Hardware / timer dependent pin number for sending IR if SEND_PWM_BY_TIMER is defined. More...
 

Functions

void timerResetInterruptPending ()
 
void timerEnableReceiveInterrupt ()
 Enables the receive sample timer interrupt, which consumes a small amount of CPU every 50 us. More...
 
void timerDisableReceiveInterrupt ()
 Disables the receive sample timer interrupt. More...
 
void timerConfigForReceive ()
 Configures the timer to be able to generate the receive sample interrupt, which consumes a small amount of CPU every 50 (MICROS_PER_TICK) us. More...
 
void enableSendPWMByTimer ()
 Enables output of the PWM signal of the timer at the timer pin. More...
 
void disableSendPWMByTimer ()
 Disables output of the PWM signal of the timer at the timer pin and set it to inactive. More...
 
void timerConfigForSend (uint16_t aFrequencyKHz)
 IF PWM should be generated not by software, but by a timer, this function sets output pin mode, configures the timer for generating a PWM with duty cycle of IR_SEND_DUTY_CYCLE_PERCENT and disables the receive interrupt if it uses the same resource. More...
 

Detailed Description

Macro Definition Documentation

◆ IR_SEND_PIN

#define IR_SEND_PIN

Hardware / timer dependent pin number for sending IR if SEND_PWM_BY_TIMER is defined.

Otherwise used as default for IrSender.sendPin.

Definition at line 96 of file IRTimer.hpp.

Function Documentation

◆ disableSendPWMByTimer()

void disableSendPWMByTimer ( )

Disables output of the PWM signal of the timer at the timer pin and set it to inactive.

Definition at line 138 of file IRTimer.hpp.

◆ enableSendPWMByTimer()

void enableSendPWMByTimer ( )

Enables output of the PWM signal of the timer at the timer pin.

Definition at line 133 of file IRTimer.hpp.

◆ timerConfigForReceive()

void timerConfigForReceive ( )

Configures the timer to be able to generate the receive sample interrupt, which consumes a small amount of CPU every 50 (MICROS_PER_TICK) us.

The actual interrupt generation is controlled by timerEnableReceiveInterrupt() and timerDisableReceiveInterrupt(). timerConfigForReceive() is used exclusively by IRrecv::start()

Definition at line 103 of file IRTimer.hpp.

◆ timerConfigForSend()

void timerConfigForSend ( uint16_t  aFrequencyKHz)

IF PWM should be generated not by software, but by a timer, this function sets output pin mode, configures the timer for generating a PWM with duty cycle of IR_SEND_DUTY_CYCLE_PERCENT and disables the receive interrupt if it uses the same resource.

For most architectures, the pin number(s) which can be used for output is determined by the timer used! The output of the PWM signal is controlled by enableSendPWMByTimer() and disableSendPWMByTimer(). timerConfigForSend() is used exclusively by IRsend::enableIROut().

Parameters
aFrequencyKHzFrequency of the sent PWM signal in kHz. There is no practical reason to have a sub kHz resolution for sending frequency :-).

Definition at line 127 of file IRTimer.hpp.

◆ timerDisableReceiveInterrupt()

void timerDisableReceiveInterrupt ( )

Disables the receive sample timer interrupt.

This must be done before using the timer for e.g. tone(). Is a synonym for calling end() or stop().

Definition at line 115 of file IRTimer.hpp.

◆ timerEnableReceiveInterrupt()

void timerEnableReceiveInterrupt ( )

Enables the receive sample timer interrupt, which consumes a small amount of CPU every 50 us.

Definition at line 108 of file IRTimer.hpp.

◆ timerResetInterruptPending()

void timerResetInterruptPending ( )