We chased a bug with handling/clearing interrupts on Encoder into the depths of madness, finding that a Debug build would magically fix the bug.
Turns out it was probably just us being a little aggressive with the poor little MS51-based Encoder driver.
* Fix delays to be more delayey.
* Replace big 'ol loop and boolean with straight up checks and an early exit- the bit-addressed regs are never going to change
Library:
Includes classes for driving WS2812 and APA102 LEDs and defines for Plasma features.
Encoder Example:
Supports connecting a Rotary Encoder via the Qw'St connector.
Works with APA102 or WS281X pixels.
Pressing A will cycle between:
1. Colour change
2. Brightness change
3. Cycle delay
Pressing B will switch back into auto-cycle mode.
Turning the encoder at any time will switch out of auto cycle mode into parameter adjust mode.
Also includes a bugfix to Rotary Encoder for getting the interrupt correctly.
Rainbow Example:
Basic rainbow cycle, press B to speed up and A to slow down.
Removes i2c_inst_t from constructors since it's ignored, and updated the Python bindings not to supply this argument. Instance is inferred from the supplied pins.
Removes all driver-specific SDA/SCL pin definitions and defaults.
Pin type is "uint" everywhere, but "PIN_UNUSED" is *int*_max for MicroPython compat. That's still a lot of pins!
Adds baudrate to the I2C class, and allows a driver (like Trackball) to check the baudrate is supported
This change adds a common I2C class, gathering various I2C functions into a single point of responsibility.
It's necessary for correctly managing the I2C bus pins and state across multiple devices.