29template <u
int8_t NumChips = 1,
class SPIDriver = decltype(SPI) &>
64 return {row, col, rowgrp, rowmask, colmask};
98 val ? buffer[
i.row] |=
i.colmask
99 : buffer[
i.row] &=
~i.colmask;
100 updateBufferedOutputRow(
i);
111 val ? buffer[
i.row] |=
i.colmask
112 : buffer[
i.row] &=
~i.colmask;
113 dirty_rows |=
i.rowmask;
150 return 1023 * digitalRead(pin);
158 return 1023 * digitalRead(pin);
188 this->sendRowAll(
i.rowgrp, buffer.data +
i.rowgrp, 8);
189 dirty_rows &=
~i.rowmask;
198 if (dirty_rows & 0x80)
199 this->sendRowAll(row, buffer.data + row, 8);
#define BEGIN_AH_NAMESPACE
constexpr PinStatus_t LOW
AH::function_traits< decltype(::digitalWrite)>::argument_t< 1 > PinStatus_t
constexpr PinStatus_t HIGH
AH::function_traits< decltype(::pinMode)>::argument_t< 1 > PinMode_t
A base class for classes that control MAX7219 LED drivers.
A class for LED outputs using the MAX7219 LED display driver.
void updateBufferedOutputRow(IndexMask i)
void updateBufferedOutputs() override
Write the internal state to the physical outputs.
void pinMode(pin_int_t pin, PinMode_t mode) override __attribute__((deprecated))
The pinMode function is not implemented because the mode is OUTPUT by definition.
PinStatus_t digitalRead(pin_int_t pin) override
Get the current state of a given output.
void digitalWrite(pin_int_t pin, PinStatus_t val) override
Set the state of a given output pin.
void analogWriteBuffered(pin_int_t pin, analog_t val) override __attribute__((deprecated))
The analogWrite function is deprecated because a MAX7219 is always digital.
PinStatus_t digitalReadBuffered(pin_int_t pin) override
Get the current state of a given output.
void pinModeBuffered(pin_int_t pin, PinMode_t mode) override __attribute__((deprecated))
The pinMode function is not implemented because the mode is OUTPUT by definition.
void updateBufferedInputs() override
Read the physical state into the input buffers.
MAX7219(SPIDriver spi, pin_t loadPin)
Create a MAX7219 ExtendedIOElement.
analog_t analogReadBuffered(pin_int_t pin) override __attribute__((deprecated))
The analogRead function is deprecated because a MAX7219 is always digital.
void begin() override
Initialize.
static IndexMask pin2index(pin_t pin)
void digitalWriteBuffered(pin_int_t pin, PinStatus_t val) override
Set the state of a given pin in the software buffer.
Array< uint8_t, 8 *NumChips > buffer
void analogWrite(pin_int_t pin, analog_t val) override __attribute__((deprecated))
The analogWrite function is deprecated because a MAX7219 is always digital.
analog_t analogRead(pin_int_t pin) override __attribute__((deprecated))
The analogRead function is deprecated because a MAX7219 is always digital.
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
A class for ExtendedIOElements with a fixed size.
uint16_t analog_t
The type returned from analogRead and similar functions.
uint_fast16_t pin_int_t
Integer type used internally to store the index of (extended) GPIO pins.
Type for storing pin numbers of Extended Input/Output elements.
pin_int_t pin
The actual underlying pin number.