ReactESP 2.0.0
Asynchronous programming for the ESP microcontrollers
reactesp::ReactESP Class Reference

Main class of a ReactESP program. More...

#include <ReactESP.h>

Collaboration diagram for reactesp::ReactESP:
[legend]

Public Member Functions

 ReactESP ()
 Construct a new ReactESP object. More...
 
void tick (void)
 
DelayReactiononDelay (const uint32_t t, const react_callback cb)
 Create a new DelayReaction. More...
 
DelayReactiononDelayMicros (const uint64_t t, const react_callback cb)
 Create a new DelayReaction. More...
 
RepeatReactiononRepeat (const uint32_t t, const react_callback cb)
 Create a new RepeatReaction. More...
 
RepeatReactiononRepeatMicros (const uint64_t t, const react_callback cb)
 Create a new RepeatReaction. More...
 
StreamReactiononAvailable (Stream &stream, const react_callback cb)
 Create a new StreamReaction. More...
 
ISRReactiononInterrupt (const uint8_t pin_number, int mode, const react_callback cb)
 Create a new ISRReaction (interrupt reaction) More...
 
TickReactiononTick (const react_callback cb)
 Create a new TickReaction. More...
 

Static Public Attributes

static ReactESPapp = NULL
 Static singleton reference to the instantiated ReactESP object. More...
 

Friends

class Reaction
 
class TimedReaction
 
class RepeatReaction
 
class UntimedReaction
 
class ISRReaction
 

Detailed Description

Main class of a ReactESP program.

Definition at line 247 of file ReactESP.h.

Constructor & Destructor Documentation

◆ ReactESP()

reactesp::ReactESP::ReactESP ( )
inline

Construct a new ReactESP object.

Definition at line 258 of file ReactESP.h.

Member Function Documentation

◆ onAvailable()

StreamReaction * reactesp::ReactESP::onAvailable ( Stream &  stream,
const react_callback  cb 
)

Create a new StreamReaction.

Parameters
streamArduino Stream object to monitor
cbCallback function
Returns
StreamReaction*

Definition at line 171 of file ReactESP.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onDelay()

DelayReaction * reactesp::ReactESP::onDelay ( const uint32_t  t,
const react_callback  cb 
)

Create a new DelayReaction.

Parameters
tDelay, in milliseconds
cbCallback function
Returns
DelayReaction*

Definition at line 145 of file ReactESP.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onDelayMicros()

DelayReaction * reactesp::ReactESP::onDelayMicros ( const uint64_t  t,
const react_callback  cb 
)

Create a new DelayReaction.

Parameters
tDelay, in microseconds
cbCallback function
Returns
DelayReaction*

Definition at line 151 of file ReactESP.cpp.

Here is the call graph for this function:

◆ onInterrupt()

ISRReaction * reactesp::ReactESP::onInterrupt ( const uint8_t  pin_number,
int  mode,
const react_callback  cb 
)

Create a new ISRReaction (interrupt reaction)

Parameters
pin_numberGPIO pin number
modeOne of CHANGE, RISING, FALLING
cbInterrupt handler to call. This should be a very simple function, ideally setting a flag variable or incrementing a counter. The function should be defined with ICACHE_RAM_ATTR.
Returns
ISRReaction*

Definition at line 177 of file ReactESP.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onRepeat()

RepeatReaction * reactesp::ReactESP::onRepeat ( const uint32_t  t,
const react_callback  cb 
)

Create a new RepeatReaction.

Parameters
tInterval, in milliseconds
cbCallback function
Returns
RepeatReaction*

Definition at line 158 of file ReactESP.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onRepeatMicros()

RepeatReaction * reactesp::ReactESP::onRepeatMicros ( const uint64_t  t,
const react_callback  cb 
)

Create a new RepeatReaction.

Parameters
tInterval, in microseconds
cbCallback function
Returns
RepeatReaction*

Definition at line 164 of file ReactESP.cpp.

Here is the call graph for this function:

◆ onTick()

TickReaction * reactesp::ReactESP::onTick ( const react_callback  cb)

Create a new TickReaction.

Parameters
cbCallback function to be called at every loop execution
Returns
TickReaction*

Definition at line 184 of file ReactESP.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tick()

void reactesp::ReactESP::tick ( void  )

Definition at line 140 of file ReactESP.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ISRReaction

friend class ISRReaction
friend

Definition at line 252 of file ReactESP.h.

◆ Reaction

friend class Reaction
friend

Definition at line 248 of file ReactESP.h.

◆ RepeatReaction

friend class RepeatReaction
friend

Definition at line 250 of file ReactESP.h.

◆ TimedReaction

friend class TimedReaction
friend

Definition at line 249 of file ReactESP.h.

◆ UntimedReaction

friend class UntimedReaction
friend

Definition at line 251 of file ReactESP.h.

Member Data Documentation

◆ app

ReactESP * reactesp::ReactESP::app = NULL
static

Static singleton reference to the instantiated ReactESP object.

Definition at line 262 of file ReactESP.h.


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