115 uint8_t scanPeriod_mS = 0)
129 for (uint8_t i = 0; i <
MAX_PINS; ++i)
146 (uint8_t)displayMode,
152 int16_t result =
_sw.sendPacket(tx0);
169 return _sw.sendPacket(tx1);
193 int16_t result =
_sw.sendPacket(tx2);
210 return _sw.sendPacket(tx3);
234 return writeLEDCommand(
236 led0, led1, led2, led3, led4);
247 int16_t
setLEDs(
const uint8_t ledIndexes[], uint8_t count)
249 return writeLEDCommand(
276 return writeLEDCommand(
278 led0, led1, led2, led3, led4);
289 int16_t
clearLEDs(
const uint8_t ledIndexes[], uint8_t count)
291 return writeLEDCommand(
338 return _sw.sendPacket(tx);
350 for (uint8_t firstLEDIndex = 0;
356 lookupTable[firstLEDIndex],
357 lookupTable[firstLEDIndex + 1],
358 lookupTable[firstLEDIndex + 2],
359 lookupTable[firstLEDIndex + 3]);
377 return (uint8_t)((highPinIndex << 4) | (lowPinIndex & 0x0F));
399 int16_t writeLEDCommand(uint8_t command,
406 const uint8_t ledIndexes[5] = {led0, led1, led2, led3, led4};
408 for (uint8_t i = 0; i < 5; ++i)
427 return _sw.sendPacket(tx);
430 int16_t writeLEDCommand(uint8_t command,
431 const uint8_t ledIndexes[],
447 for (uint8_t i = 0; i < count; ++i)
453 leds[i] = ledIndexes[i];
456 return writeLEDCommand(
@ CONFIGURE_PIN_MODE0
(200)
@ CONFIGURE_PIN_MODE3
(203)
@ CONFIGURE_PIN_MODE4
(204)
@ CONFIGURE_PIN_MODE5
(205)
@ CONFIGURE_PIN_MODE6
(206)
@ CONFIGURE_PIN_MODE2
(202)
@ CONFIGURE_PIN_MODE1
(201)
@ PIN_MODE_CHARLIEPLEX
(43)
SerialWombatAbstractScaledOutput(SerialWombatChip &sw)
Constructor for the SerialWombatAbstractScaledOutput Class.
@ DISPLAY_MODE_SCALED_SINGLE_LED
Scaled-output value selects one logical LED index.
@ DISPLAY_MODE_PUBLIC_DATA_BITMAP
Controlling pin public data controls LEDs 0 through 15 as a bitfield.
@ DISPLAY_MODE_SCALED_BARGRAPH
Scaled-output value lights LEDs 0 through the selected index.
@ DISPLAY_MODE_BITMAP
Seven-byte protocol bitmap controls up to 56 LEDs.
int16_t setLEDs(uint8_t led0, uint8_t led1=UNUSED_LED, uint8_t led2=UNUSED_LED, uint8_t led3=UNUSED_LED, uint8_t led4=UNUSED_LED)
Set up to five logical LEDs in bitmap display mode.
static uint8_t encodePinPair(uint8_t highPinIndex, uint8_t lowPinIndex)
Encode a logical high pin and logical low pin into one lookup byte.
static const uint8_t BITMAP_BYTES
uint8_t pin()
Fulfills a virtual function requirement of SerialWombatAbstractScaledOutput.
int16_t begin(uint8_t pin0, uint8_t pin1, uint8_t pin2, uint8_t pin3, uint8_t pin4, uint8_t pin5=UNUSED_PIN, uint8_t pin6=UNUSED_PIN, uint8_t pin7=UNUSED_PIN, displayMode_t displayMode=DISPLAY_MODE_BITMAP, uint8_t scanPeriod_mS=0)
Initialize a Charlieplexed LED display.
static const uint8_t MAX_PINS
SerialWombatCharlieplex(SerialWombatChip &serialWombat)
Constructor for the SerialWombatCharlieplex class.
static const uint8_t MAX_LEDS
uint8_t swPinModeNumber()
Fulfills a virtual function requirement of SerialWombatAbstractScaledOutput.
int16_t clearLEDs()
Turn off all LEDs in bitmap display mode.
int16_t clearLEDs(const uint8_t ledIndexes[], uint8_t count)
Clear up to five logical LEDs from an array.
static const uint8_t UNUSED_PIN
int16_t setLEDs(const uint8_t ledIndexes[], uint8_t count)
Set up to five logical LEDs from an array.
int16_t writeLookupEntries(uint8_t firstLEDIndex, uint8_t entry0, uint8_t entry1, uint8_t entry2, uint8_t entry3)
Write four consecutive logical LED lookup entries.
int16_t clearLEDs(uint8_t led0, uint8_t led1=UNUSED_LED, uint8_t led2=UNUSED_LED, uint8_t led3=UNUSED_LED, uint8_t led4=UNUSED_LED)
Clear up to five logical LEDs in bitmap display mode.
static const uint8_t UNUSED_LED
int16_t writeLookupTable(const uint8_t lookupTable[MAX_LEDS])
Write all 56 logical LED lookup entries.
int16_t writeLEDArray(const uint8_t ledArray[BITMAP_BYTES])
Write the complete LED bitmap from an array of bytes.
Class for a Serial Wombat chip. Each Serial Wombat chip on a project should have its own instance.
SerialWombatPin(SerialWombatChip &serialWombatChip)
Instantiates a Serial Wombat Pin.