Go to the documentation of this file.
17 #if defined(ESP32) || defined(ESP8266)
26 #define STORED_IN_RAM IRAM_ATTR
29 #define STORED_IN_RAM ICACHE_RAM_ATTR
31 #else // Other architectures
52 virtual void setPinState(uint8_t pin, uint8_t state) = 0;
73 virtual void setPWM(uint8_t pin,
int dutyCycle) = 0;
92 virtual size_t i2cWrite(uint8_t value) = 0;
108 virtual uint8_t
i2cRequestFrom(uint8_t address, uint8_t numberOfBytes) = 0;
150 virtual void delayMillis(
unsigned long milliseconds) = 0;
157 virtual void delayMicros(
unsigned int microseconds) = 0;
168 virtual unsigned long getPulseDuration(uint8_t pin, uint8_t state,
unsigned long timeout) = 0;
virtual int getPinState(uint8_t pin)=0
Get the pin state, equivalent of digitalRead in Arduino.
virtual uint8_t i2cEndTransmission()=0
Ends a transmission to an I2C device equivalent of Wire.endTransmission in Arduino.
virtual void delayMicros(unsigned int microseconds)=0
Block the execution for the specified number of microseconds, equivalent of delayMicroseconds in Ardu...
A callback to be invoked. Depending on the platform different callback types may be necessary.
virtual uint8_t getHighState() const =0
Get the runtime-specific value representing a logical HIGH voltage state.
virtual void i2cInit()=0
Initialize I2C bus as master, equivalent of Wire.begin in Arduino.
virtual void setPinState(uint8_t pin, uint8_t state)=0
Set pin state, equivalent of digitalWrite in Arduino.
virtual void delayMillis(unsigned long milliseconds)=0
Block the execution for the specified number of milliseconds, equivalent of delay in Arduino.
virtual uint8_t getOutputState() const =0
Get the runtime-specific value representing an OUTPUT pin state.
virtual int getRisingEdgeMode() const =0
Get the rising edge constant for setting an interrupt.
virtual void setInterrupt(uint8_t pin, InterruptCallback callback, int mode)=0
Enables an external hardware interrupt and provides a callback, equivalent to attachInterrupt in Ardu...
virtual void i2cBeginTransmission(uint8_t address)=0
Initiate a transmission to the specified I2C slave device, equivalent of Wire.beginTransmission in Ar...
virtual int i2cRead()=0
Reads a byte from I2C bus, equivalent of Wire.read in Arduino.
virtual unsigned long getPulseDuration(uint8_t pin, uint8_t state, unsigned long timeout)=0
Gets the incomming pulse length in microseconds starting from the nearest state, equivalent to pulseI...
virtual void setPWM(uint8_t pin, int dutyCycle)=0
Set PWM state, equivalent of analogWrite in Arduino.
virtual uint8_t getLowState() const =0
Get the runtime-specific value representing a logical LOW voltage state.
virtual uint8_t i2cRequestFrom(uint8_t address, uint8_t numberOfBytes)=0
Request a number of bytes from the specified I2C slave, equivalent of Wire.requestFrom in Arduino.
virtual unsigned long currentTimeMillis()=0
Gets the amount of milliseconds since the microcontroller started running, equivalent of millis in Ar...
virtual int i2cAvailable()=0
Gets the number of bytes available to be retrieved, equivalent of Wire.availableO in Arduino.
virtual unsigned long currentTimeMicros()=0
Gets the amount of microseconds since the microcontroller started running, equivalent of micros in Ar...
virtual uint8_t getInputState() const =0
Get the runtime-specific value representing an INPUT pin state.
virtual void setPinDirection(uint8_t pin, uint8_t direction)=0
Set pin direction, equivalent of pinMode in Arduino.
virtual ~Runtime()=default
virtual int8_t pinToInterrupt(uint8_t pin)=0
Gets the interrupt number of the specified pin, equivalent of digitalPinToInterrupt in Arduino.
virtual size_t i2cWrite(uint8_t value)=0
Send the specified byte via i2c, equivalent of Wire.write in Arduino.
virtual int getAnalogPinState(uint8_t pin)=0
Get pin's analog (ADC) reading, equivalent of analogRead in Arduino.