Go to the documentation of this file.
7 #include "analogWrite.h"
10 #define TEN_BIT_ANALOG
11 #include "../../utilities/Utilities.hpp"
17 pinMode(pin, direction);
22 digitalWrite(pin, state);
27 return digitalRead(pin);
32 return analogRead(pin);
40 analogWrite(pin, dutyCycle);
50 Wire.beginTransmission(address);
55 return Wire.write(value);
60 return Wire.endTransmission();
65 return Wire.requestFrom(address, numberOfBytes);
70 return Wire.available();
80 return digitalPinToInterrupt(pin);
100 delayMicroseconds(microseconds);
105 return pulseIn(pin, state, timeout);
110 attachInterrupt(pin, callback, mode);
int8_t pinToInterrupt(uint8_t pin) override
Gets the interrupt number of the specified pin, equivalent of digitalPinToInterrupt in Arduino.
void setPinState(uint8_t pin, uint8_t state) override
Set pin state, equivalent of digitalWrite in Arduino.
void delayMicros(unsigned int microseconds) override
Block the execution for the specified number of microseconds, equivalent of delayMicroseconds in Ardu...
uint8_t getOutputState() const override
Get the runtime-specific value representing an OUTPUT pin state.
void setPWM(uint8_t pin, int dutyCycle) override
Set PWM state, equivalent of analogWrite in Arduino.
A callback to be invoked. Depending on the platform different callback types may be necessary.
uint8_t i2cRequestFrom(uint8_t address, uint8_t numberOfBytes) override
Request a number of bytes from the specified I2C slave, equivalent of Wire.requestFrom in Arduino.
uint8_t getHighState() const override
Get the runtime-specific value representing a logical HIGH voltage state.
void i2cBeginTransmission(uint8_t address) override
Initiate a transmission to the specified I2C slave device, equivalent of Wire.beginTransmission in Ar...
void setPinDirection(uint8_t pin, uint8_t direction) override
Set pin direction, equivalent of pinMode in Arduino.
unsigned long getPulseDuration(uint8_t pin, uint8_t state, unsigned long timeout) override
Gets the incomming pulse length in microseconds starting from the nearest state, equivalent to pulseI...
int i2cAvailable() override
Gets the number of bytes available to be retrieved, equivalent of Wire.availableO in Arduino.
unsigned long currentTimeMillis() override
Gets the amount of milliseconds since the microcontroller started running, equivalent of millis in Ar...
int getAnalogPinState(uint8_t pin) override
Get pin's analog (ADC) reading, equivalent of analogRead in Arduino.
uint8_t i2cEndTransmission() override
Ends a transmission to an I2C device equivalent of Wire.endTransmission in Arduino.
constexpr AnyNumber getMap(AnyNumber valueToMap, AnyNumber fromLow, AnyNumber fromHigh, AnyNumber toLow, AnyNumber toHigh)
Maps a value from a range to another.
size_t i2cWrite(uint8_t value) override
Send the specified byte via i2c, equivalent of Wire.write in Arduino.
int i2cRead() override
Reads a byte from I2C bus, equivalent of Wire.read in Arduino.
void i2cInit() override
Initialize I2C bus as master, equivalent of Wire.begin in Arduino.
uint8_t getInputState() const override
Get the runtime-specific value representing an INPUT pin state.
unsigned long currentTimeMicros() override
Gets the amount of microseconds since the microcontroller started running, equivalent of micros in Ar...
uint8_t getLowState() const override
Get the runtime-specific value representing a logical LOW voltage state.
int getRisingEdgeMode() const override
Get the rising edge constant for setting an interrupt.
void delayMillis(unsigned long milliseconds) override
Block the execution for the specified number of milliseconds, equivalent of delay in Arduino.
void setInterrupt(uint8_t pin, InterruptCallback callback, int mode) override
Enables an external hardware interrupt and provides a callback, equivalent to attachInterrupt in Ardu...
int getPinState(uint8_t pin) override
Get the pin state, equivalent of digitalRead in Arduino.