IRremoteIDF
Infrared send & receive for ESP-IDF
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
IRplatform.h File Reference

Go to the source code of this file.

Typedefs

typedef std::string String
 The protocol code builds human readable output with String. On ESP-IDF that is just std::string.
 

Functions

uint32_t irMillis (void)
 Milliseconds since boot. Wraps every ~49.7 days, like Arduino's millis().
 
uint32_t irMicros (void)
 Microseconds since boot. Wraps every ~71.6 minutes.
 
void irDelayMs (uint32_t msec)
 Sleep, yielding the CPU to other FreeRTOS tasks.
 
void irDelayUs (uint32_t usec)
 Busy-wait. Accurate, but blocks the core it runs on.
 
void irYield (void)
 Feed the task watchdog without giving up the CPU for long.
 
bool irGpioOutput (uint16_t pin)
 Configure a GPIO as a push-pull output.
 
bool irGpioInput (uint16_t pin, bool pullup)
 Configure a GPIO as an input, optionally with the internal pull-up.
 
void irGpioWrite (uint16_t pin, uint8_t level)
 Set the level of an output GPIO.
 
uint8_t irGpioRead (uint16_t pin)
 Read the level of a GPIO.
 
void irRestart (void)
 Reboot the chip. Used when a buffer allocation fails.
 
int8_t irCarrierAttach (uint16_t pin, bool inverted)
 Claim an LEDC channel and bind it to pin.
 
void irCarrierDetach (int8_t channel, uint16_t pin, bool inverted)
 Release a previously claimed channel.
 
void irCarrierConfig (int8_t channel, uint32_t freq, uint8_t duty)
 Set the carrier frequency (Hz) and duty cycle (percent).
 
void irCarrierOn (int8_t channel)
 Start emitting the carrier.
 
void irCarrierOff (int8_t channel)
 Stop emitting the carrier, leaving the pin at its idle level.
 
void irDebugPrint (const char *str)
 
void irDebugPrint (const String &str)
 
void irDebugPrint (char c)
 
void irDebugPrint (uint64_t value)
 
void irDebugPrint (int64_t value)
 
template<typename T >
std::enable_if< std::is_integral< T >::value >::type irDebugPrint (T value)
 Any other integer type. Without this, an int or a uint16_t converts equally well to uint64_t and int64_t, and the call is ambiguous.
 

Variables

const uint8_t kIrLow = 0
 Logical pin levels.
 
const uint8_t kIrHigh = 1
 

Typedef Documentation

◆ String

typedef std::string String

The protocol code builds human readable output with String. On ESP-IDF that is just std::string.

Function Documentation

◆ irCarrierAttach()

int8_t irCarrierAttach ( uint16_t  pin,
bool  inverted 
)

Claim an LEDC channel and bind it to pin.

Returns
The channel number, or -1 if none was available.

◆ irCarrierConfig()

void irCarrierConfig ( int8_t  channel,
uint32_t  freq,
uint8_t  duty 
)

Set the carrier frequency (Hz) and duty cycle (percent).

◆ irCarrierDetach()

void irCarrierDetach ( int8_t  channel,
uint16_t  pin,
bool  inverted 
)

Release a previously claimed channel.

◆ irCarrierOff()

void irCarrierOff ( int8_t  channel)

Stop emitting the carrier, leaving the pin at its idle level.

◆ irCarrierOn()

void irCarrierOn ( int8_t  channel)

Start emitting the carrier.

◆ irDebugPrint() [1/6]

void irDebugPrint ( char  c)

◆ irDebugPrint() [2/6]

void irDebugPrint ( const char *  str)

◆ irDebugPrint() [3/6]

void irDebugPrint ( const String &  str)

◆ irDebugPrint() [4/6]

void irDebugPrint ( int64_t  value)

◆ irDebugPrint() [5/6]

template<typename T >
std::enable_if< std::is_integral< T >::value >::type irDebugPrint ( T  value)
inline

Any other integer type. Without this, an int or a uint16_t converts equally well to uint64_t and int64_t, and the call is ambiguous.

◆ irDebugPrint() [6/6]

void irDebugPrint ( uint64_t  value)

◆ irDelayMs()

void irDelayMs ( uint32_t  msec)

Sleep, yielding the CPU to other FreeRTOS tasks.

◆ irDelayUs()

void irDelayUs ( uint32_t  usec)

Busy-wait. Accurate, but blocks the core it runs on.

◆ irGpioInput()

bool irGpioInput ( uint16_t  pin,
bool  pullup 
)

Configure a GPIO as an input, optionally with the internal pull-up.

Returns
true on success.

◆ irGpioOutput()

bool irGpioOutput ( uint16_t  pin)

Configure a GPIO as a push-pull output.

Returns
true on success.

◆ irGpioRead()

uint8_t irGpioRead ( uint16_t  pin)

Read the level of a GPIO.

◆ irGpioWrite()

void irGpioWrite ( uint16_t  pin,
uint8_t  level 
)

Set the level of an output GPIO.

◆ irMicros()

uint32_t irMicros ( void  )

Microseconds since boot. Wraps every ~71.6 minutes.

◆ irMillis()

uint32_t irMillis ( void  )

Milliseconds since boot. Wraps every ~49.7 days, like Arduino's millis().

◆ irRestart()

void irRestart ( void  )

Reboot the chip. Used when a buffer allocation fails.

◆ irYield()

void irYield ( void  )

Feed the task watchdog without giving up the CPU for long.

Variable Documentation

◆ kIrHigh

const uint8_t kIrHigh = 1

◆ kIrLow

const uint8_t kIrLow = 0

Logical pin levels.