6#include "ExtendedInputOutput.hpp"
18template <
class WireType>
39 MCP23017(WireType &wire, uint8_t addressOffset = 0,
48 void begin()
override;
50 void updateBufferedOutputs()
override;
51 void updateBufferedInputs()
override;
53 void updateBufferedPinModes();
65 constexpr static uint8_t I2C_BASE_ADDRESS = 0x20;
72 bool pinModesDirty =
true;
74 bool pullupsDirty =
true;
76 bool outputsDirty =
true;
82 bool hasInputs()
const;
86 void writeI2C(
const uint8_t (&values)[N]);
96 template <
class... Args>
97 void writeI2C(uint8_t addr, Args... values);
#define BEGIN_AH_NAMESPACE
AH::function_traits< decltype(::pinMode)>::argument_t< 1 > PinMode_t
AH::function_traits< decltype(::digitalWrite)>::argument_t< 1 > PinStatus_t
#define AH_DIAGNOSTIC_POP()
#define AH_DIAGNOSTIC_WERROR()
Class for MCP23017 I²C I/O expanders.
BitArray< 16 > bufferedPullups
pin_t pinA(pin_t p)
Get the identifier of the given pin in register A.
BitArray< 16 > bufferedInputs
BitArray< 16 > bufferedOutputs
pin_t pinB(pin_t p)
Get the identifier of the given pin in register B.
BitArray< 16 > bufferedPinModes
A class for ExtendedIOElements with a fixed size.
void analogWriteBuffered(pin_t pin, analog_t val)
A buffered ExtIO version of the Arduino function.
void pinModeBuffered(pin_t pin, PinMode_t mode)
A buffered ExtIO version of the Arduino function.
void digitalWriteBuffered(pin_t pin, PinStatus_t val)
A buffered ExtIO version of the Arduino function.
PinStatus_t digitalReadBuffered(pin_t pin)
A buffered ExtIO version of the Arduino function.
analog_t analogReadBuffered(pin_t pin)
A buffered ExtIO version of the Arduino function.
uint16_t analog_t
The type returned from analogRead and similar functions.
constexpr pin_t NO_PIN
A special pin number that indicates an unused or invalid pin.
Type for storing pin numbers of Extended Input/Output elements.