Arduino Helpers master
Utility library for Arduino
Classes | Typedefs | Functions
Extended Input/Output

Detailed Description

All Elements that extend the number of IO pins of the Arduino: Includes shift registers (e.g.

74HC595), multiplexers (e.g. 74HC4067, 74HC4051), port expanders (e.g. MCP23017), LED drivers (e.g. MAX7219), etc.

Classes

class  AnalogMultiplex< N >
 A class for reading multiplexed analog inputs. More...
 
class  MAX7219< NumChips, SPIDriver >
 A class for LED outputs using the MAX7219 LED display driver. More...
 
class  MCP23017< WireType >
 Class for MCP23017 I²C I/O expanders. More...
 
class  ShiftRegisterOut< N >
 A class for serial-in/parallel-out shift registers, like the 74HC595. More...
 
class  ShiftRegisterOutBase< N >
 A class for serial-in/parallel-out shift registers, like the 74HC595. More...
 
class  SPIShiftRegisterOut< N, SPIDriver >
 A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bus. More...
 

Typedefs

using CD74HC4067 = AnalogMultiplex< 4 >
 An alias for AnalogMultiplex<4> to use with CD74HC4067 analog multiplexers. More...
 
using CD74HC4051 = AnalogMultiplex< 3 >
 An alias for AnalogMultiplex<3> to use with CD74HC4051 analog multiplexers. More...
 

Functions

bool isNativePin (pin_t pin)
 Check if the given pin number is a real Arduino pin number, and not an ExtIO pin number. More...
 
ExtendedIOElementgetIOElementOfPinOrNull (pin_t pin)
 Find the IO element of a given extended IO pin number. More...
 
ExtendedIOElementgetIOElementOfPin (pin_t pin)
 Find the IO element of a given extended IO pin number. More...
 
void pinMode (pin_t pin, PinMode_t mode)
 An ExtIO version of the Arduino function. More...
 
void pinMode (int pin, PinMode_t mode)
 Overload to Arduino pinMode function. More...
 
void digitalWrite (pin_t pin, PinStatus_t val)
 An ExtIO version of the Arduino function. More...
 
void digitalWrite (int pin, PinStatus_t val)
 Overload to Arduino digitalWrite function. More...
 
PinStatus_t digitalRead (pin_t pin)
 An ExtIO version of the Arduino function. More...
 
PinStatus_t digitalRead (int pin)
 Overload to Arduino digitalRead function. More...
 
analog_t analogRead (pin_t pin)
 An ExtIO version of the Arduino function. More...
 
analog_t analogRead (int pin)
 Overload to Arduino analogRead function. More...
 
void analogWrite (pin_t pin, analog_t val)
 An ExtIO version of the Arduino function. More...
 
void analogWrite (pin_t pin, int val)
 An ExtIO version of the Arduino function. More...
 
void analogWrite (int pin, analog_t val)
 Overload to Arduino analogWrite function. More...
 
void analogWrite (int pin, int val)
 Overload to Arduino analogWrite function. More...
 
void shiftOut (pin_t dataPin, pin_t clockPin, BitOrder_t bitOrder, uint8_t val)
 An ExtIO version of the Arduino function. More...
 
void shiftOut (int dataPin, int clockPin, BitOrder_t bitOrder, uint8_t val)
 Overload to Arduino shiftOut function. More...
 
void pinModeBuffered (pin_t pin, PinMode_t mode)
 A buffered ExtIO version of the Arduino function. More...
 
void digitalWriteBuffered (pin_t pin, PinStatus_t val)
 A buffered ExtIO version of the Arduino function. More...
 
PinStatus_t digitalReadBuffered (pin_t pin)
 A buffered ExtIO version of the Arduino function. More...
 
analog_t analogReadBuffered (pin_t pin)
 A buffered ExtIO version of the Arduino function. More...
 
void analogWriteBuffered (pin_t pin, analog_t val)
 A buffered ExtIO version of the Arduino function. More...
 
void analogWriteBuffered (pin_t pin, int val)
 A buffered ExtIO version of the Arduino function. More...
 

Typedef Documentation

◆ CD74HC4067

An alias for AnalogMultiplex<4> to use with CD74HC4067 analog multiplexers.

Definition at line 185 of file AnalogMultiplex.hpp.

◆ CD74HC4051

An alias for AnalogMultiplex<3> to use with CD74HC4051 analog multiplexers.

Definition at line 193 of file AnalogMultiplex.hpp.

Function Documentation

◆ isNativePin()

bool isNativePin ( pin_t  pin)
inline

Check if the given pin number is a real Arduino pin number, and not an ExtIO pin number.

Definition at line 24 of file ExtendedInputOutput.hpp.

◆ getIOElementOfPinOrNull()

ExtendedIOElement * getIOElementOfPinOrNull ( pin_t  pin)

Find the IO element of a given extended IO pin number.

Parameters
pinThe extended IO pin number to find the IO element of.
Returns
A pointer to the extended IO element that the given pin belongs to.

Definition at line 14 of file ExtendedInputOutput.cpp.

◆ getIOElementOfPin()

ExtendedIOElement * getIOElementOfPin ( pin_t  pin)

Find the IO element of a given extended IO pin number.

Parameters
pinThe extended IO pin number to find the IO element of.
Returns
A pointer to the extended IO element that the given pin belongs to. Throws an error if the element was not found.

Definition at line 23 of file ExtendedInputOutput.cpp.

◆ pinMode() [1/2]

void pinMode ( pin_t  pin,
PinMode_t  mode 
)

◆ pinMode() [2/2]

void pinMode ( int  pin,
PinMode_t  mode 
)

Overload to Arduino pinMode function.

Definition at line 47 of file ExtendedInputOutput.cpp.

◆ digitalWrite() [1/2]

void digitalWrite ( pin_t  pin,
PinStatus_t  val 
)

◆ digitalWrite() [2/2]

void digitalWrite ( int  pin,
PinStatus_t  val 
)

Overload to Arduino digitalWrite function.

Definition at line 61 of file ExtendedInputOutput.cpp.

◆ digitalRead() [1/2]

PinStatus_t digitalRead ( pin_t  pin)

◆ digitalRead() [2/2]

PinStatus_t digitalRead ( int  pin)

Overload to Arduino digitalRead function.

Definition at line 75 of file ExtendedInputOutput.cpp.

◆ analogRead() [1/2]

analog_t analogRead ( pin_t  pin)

An ExtIO version of the Arduino function.

See also
ExtendedIOElement::analogRead
Examples
1.AnalogReadSerial.ino.

Definition at line 79 of file ExtendedInputOutput.cpp.

◆ analogRead() [2/2]

analog_t analogRead ( int  pin)

Overload to Arduino analogRead function.

Definition at line 89 of file ExtendedInputOutput.cpp.

◆ analogWrite() [1/4]

void analogWrite ( pin_t  pin,
analog_t  val 
)

An ExtIO version of the Arduino function.

See also
ExtendedIOElement::analogWrite

Definition at line 91 of file ExtendedInputOutput.cpp.

◆ analogWrite() [2/4]

void analogWrite ( pin_t  pin,
int  val 
)

An ExtIO version of the Arduino function.

See also
ExtendedIOElement::analogWrite

Definition at line 103 of file ExtendedInputOutput.cpp.

◆ analogWrite() [3/4]

void analogWrite ( int  pin,
analog_t  val 
)

Overload to Arduino analogWrite function.

Definition at line 105 of file ExtendedInputOutput.cpp.

◆ analogWrite() [4/4]

void analogWrite ( int  pin,
int  val 
)

Overload to Arduino analogWrite function.

Definition at line 108 of file ExtendedInputOutput.cpp.

◆ shiftOut() [1/2]

void shiftOut ( pin_t  dataPin,
pin_t  clockPin,
BitOrder_t  bitOrder,
uint8_t  val 
)

An ExtIO version of the Arduino function.

Definition at line 174 of file ExtendedInputOutput.cpp.

◆ shiftOut() [2/2]

void shiftOut ( int  dataPin,
int  clockPin,
BitOrder_t  bitOrder,
uint8_t  val 
)

Overload to Arduino shiftOut function.

Definition at line 204 of file ExtendedInputOutput.cpp.

◆ pinModeBuffered()

void pinModeBuffered ( pin_t  pin,
PinMode_t  mode 
)

A buffered ExtIO version of the Arduino function.

See also
ExtendedIOElement::pinModeBuffered

Definition at line 113 of file ExtendedInputOutput.cpp.

◆ digitalWriteBuffered()

void digitalWriteBuffered ( pin_t  pin,
PinStatus_t  val 
)

A buffered ExtIO version of the Arduino function.

See also
ExtendedIOElement::digitalWriteBuffered

Definition at line 124 of file ExtendedInputOutput.cpp.

◆ digitalReadBuffered()

PinStatus_t digitalReadBuffered ( pin_t  pin)

A buffered ExtIO version of the Arduino function.

See also
ExtendedIOElement::digitalReadBuffered

Definition at line 135 of file ExtendedInputOutput.cpp.

◆ analogReadBuffered()

analog_t analogReadBuffered ( pin_t  pin)

A buffered ExtIO version of the Arduino function.

See also
ExtendedIOElement::analogReadBuffered

Definition at line 146 of file ExtendedInputOutput.cpp.

◆ analogWriteBuffered() [1/2]

void analogWriteBuffered ( pin_t  pin,
analog_t  val 
)

A buffered ExtIO version of the Arduino function.

See also
ExtendedIOElement::analogWriteBuffered

Definition at line 158 of file ExtendedInputOutput.cpp.

◆ analogWriteBuffered() [2/2]

void analogWriteBuffered ( pin_t  pin,
int  val 
)

A buffered ExtIO version of the Arduino function.

See also
ExtendedIOElement::analogWriteBuffered

Definition at line 170 of file ExtendedInputOutput.cpp.