MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
4 #include "ExtendedIOElement.hpp"
14 return target >= start && target < end;
19 if (pin < el.getStart())
21 else if (
inRange(pin, el.getStart(), el.getEnd()))
25 F(
"The given pin does not correspond to an Extended IO element."),
39 else if (pin < NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS) {
51 else if (pin < NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS) {
63 else if (pin < NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS) {
76 for (i = 0; i < 8; i++) {
77 if (bitOrder == LSBFIRST)
86 void shiftOut(
int dataPin,
int clockPin, uint8_t bitOrder, uint8_t val) {
93 else if (pin < NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS) {
107 else if (pin < NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS) {
virtual void analogWrite(pin_t pin, analog_t val)=0
Write an analog (or PWM) value to the given pin.
void pinMode(int pin, uint8_t mode)
An ExtIO version of the Arduino function.
virtual int digitalRead(pin_t pin)=0
Read the state of the given pin.
virtual void digitalWrite(pin_t pin, uint8_t state)=0
Set the output of the given pin to the given state.
void analogWrite(pin_t pin, int val)
An ExtIO version of the Arduino function.
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
virtual analog_t analogRead(pin_t pin)=0
Read the analog value of the given pin.
#define AH_DIAGNOSTIC_POP()
An abstract base class for Extended Input/Output elements.
#define FATAL_ERROR(msg, errc)
Print the error message and error code, and stop the execution.
void digitalWrite(int pin, uint8_t val)
An ExtIO version of the Arduino function.
int digitalRead(int pin)
An ExtIO version of the Arduino function.
pin_t getStart() const
Get the smallest global extended IO pin number that belongs to this extended IO element.
ExtendedIOElement & getIOElementOfPin(pin_t pin)
Find the IO element of a given extended IO pin number.
constexpr pin_t NO_PIN
A special pin number that indicates an unused or invalid pin.
uint16_t analog_t
The type returned from analogRead and similar functions.
analog_t analogRead(int pin)
An ExtIO version of the Arduino function.
void shiftOut(int dataPin, int clockPin, uint8_t bitOrder, uint8_t val)
An ExtIO version of the Arduino function.
virtual void pinMode(pin_t pin, uint8_t mode)=0
Set the mode of a given pin.
#define AH_DIAGNOSTIC_WERROR()
#define BEGIN_AH_NAMESPACE
bool inRange(T target, T start, T end)