Known Issues
- ESP32 Boards
- USB-CDC (aka native USB) appears to be broken in the 3.0 core. Will eventually hang if sending a lot of data both directions at the same time. Use one of the standard UART interfaces until this is fixed.
New Boards
- ESP32-H2 and ESP32-C6 variants (
--target esp32
):- Depends on ESP32 Arduino Core 3.0+
- No WiFi on H2
Board Changes
-
ESP32 Boards
- 3.0+ version of the ESP32 Arduino Core now required.
-
Raspberry Pi Pico (RP2040)
- WS2812 LED strips work now.
New Peripherals
-
Bit-Bang I2C:
- Class:
Denko::I2C::BitBang
- Start a software bit-banged I2C bus on any 2 pins.
- Interchangeable with hardware bus (
Denko::I2C::Bus
), as far as I2C peripherals are concerned.
- Class:
-
ADS1100 Analog-to-Digital Converter:
- Class:
Denko::AnalogIO::ADS1100
- Connects via I2C bus. Driver written in Ruby.
- Modeled after
AnalogIO::Input
since it's a single channel ADC. - Can be read directly with
#read
or polled with#poll
. - Full scale voltage must be given in the initailize hash,
full_scale_voltage:
. - Gain and sample rate configurable. See example for more.
- Class:
-
SSD1306 1-Color OLED
- Added SPI version.
- Both use
Denko::Display::SSD1306
. Instances mutate to I2C or SPI behavior, based on bus given.
-
SH1106 1-Color OLED
- Class:
Denko::Display::SH1106
- Almost the same as SSD1306. Most driver code is shared between them.
- I2C and SPI versions both supported, as SSD1306 above.
- Class:
Peripheral Changes
-
All Peripherals:
- On CRuby,
@state_mutex
and@callback_mutex
are now instances ofDenko::MutexStub
, which just runs the given block when called with#synchronize
. - The options hash (now called params), given to
#initialize
is always available through the#params
method. #initialize
no longer acceptspullup: true
orpulldown: true
. Set mode explicitly, likemode: :input_pullup
.
- On CRuby,
-
Temperature / Pressure / Humidity Sensors:
DS18B20
,DHT
andHTU21D
readings now match all the others (Hash with same keys).- Readings standardized to be in ºC, %RH and Pascals. Callbacks always receive hash with these.
[]
access for@state
removed removed. Use#temperature
,#pressure
,#humidity
instead.- Added
#temperature_f
#temperature_k
#pressure_atm
#pressure_bar
helper conversion methods. #read
methods standardized to always read ALL sub-sensors. AffectsHTU21D
andBMP180
.
-
AnalogIO::Input
:- Added
#smoothing=
and#smoothing_size=
accessors toAnalogIO::Input
for configuration. AnalogIO::Sensor
removed. UseInput
instead.
- Added
-
Behavior::InputPin
- Added
#debounce=(time)
which just callsBoard#set_pin_debounce
for the pin. Only onPiBoard
.
- Added
-
DigitalIO::CBitBang
:- New helper class. Forces initialize validation for bit-bang pins. Essential for
PiBoard
. - As a side-effect, makes sure 2 low-level bit-bang Components (eg. buses) can't use the same pin.
- Always starts pins in
:input
mode. The bit-bang routine is expected to change them.
- New helper class. Forces initialize validation for bit-bang pins. Essential for
-
DigitalIO::RotaryEncoder
:- Pin names standardized to
a:
andb:
, but still accept:clock
,:data
,:clk
,:dt
. steps_per_revolution
changed tocounts_per_revolution
- Every level change is counted now (full-quadrature). Was half-quadrature before.
counts_per_revolution
now defaults to 60 instead of 30 (generic 30-detent encoders).state
and callback hash store:count
instead of:steps
.
- Pin names standardized to
-
I2C::Bus
:- No longer requires SDA pin to initialize.
- Accepts
index:
param (default 0) on initialize, specifying which I2C interface to use.- Only works for PiBoard on Linux right now.
#update
accepts String of comma delimited ASCII numbers (Board), or Array of bytes (PiBoard).
-
I2C::Peripheral
:#i2c_read
arg order changed from(register, num_bytes)
to(num_bytes, register: nil)
-
LED
:Base
,RGB
andSevenSegment
all inherit fromPulseIO::PWMOutput
, so see that below.#write
MUST always be given a PWM value if used, not0
or1
.- Prefer using
duty=
if possible, which is percentage based. - Alternatively, call
#digital_write
only to stay in faster digital mode.
-
LED::RGB
:#write
takes 3 regular args now. Use*array
instead to pass an array.#color
only takes a symbol for one of the predefined colors (or:off
) now.
-
Motor::Stepper
:#step_cc
renamed to#step_ccw
.
-
OneWire::Bus
:#update
accepts String of comma delimited ASCII numbers (Board), or Array of bytes (PiBoard).
-
PulseIO::IRTransmitter
:- Renamed to
PulseIO::IROutput
to be more consistent with other classes. #emit
renamed to#write
for consistency.
- Renamed to
-
PulseIO::PWMOutput
:#write
will never try to call#digital_write
, always#pwm_write
.- Initial mode is
:output
instead of:output_pwm
, saving MCU PWM channels until needed. - Mode change is lazy. Happens with first call to
#pwm_write
. - Call only
#digital_write
to stay in digital:output
mode (faster). - Added
#duty=
. Set duty cycle in percentage regardless of PWM resolution. - Set resolution and frequency per
PWMOutput
instance (pin), instead of perBoard
instance:#initialize
hash acceptsfrequency:
andresolution:
keys.- Call
#pwm_enable
withfrequency:
andresolution:
kwargs - Or use
#resolution=
and#frequency=
methods. - Defaults are 1 kHz frequency and 8-bit resolution.
- ONLY works on ESP32 and
PiBoard
right now. Others still control at the Board level. - Limited to 13-bit resolution on
Denko::Board
for now.
-
SPI::Bus
:- Accepts
index:
param (default 0) on initialize, specifying which SPI interface to use.- Only works for PiBoard on Linux right now.
- Accepts
-
SPI::Peripheral
:- Split into
SPI:Peripheral::SinglePin
andSpi::Peripheral::MultiPin
to allow modeling more complex peripherals. #update
accepts String of comma delimited ASCII numbers (Board), or Array of bytes (PiBoard).
- Split into
-
SPI::OutputRegister
:- Removed automatic buffering of writes.
- Call
#set_bit(value)
instead to modify state in memory, without writing to the physical register. - Call
#write
to send state to the register after modifying.
Fiwmare Changes
-
General:
- Boards now report their serial buffer as 8 bytes less than the actual buffer size.
- Removed local callback hooks (meant for customization in C) from the Arduino sketches.
- Improved serial interface selection for ATSAMD21 boards. Some boards have the native interface as
Serial
, some asSerialUSB
. The native interface is always selected now, regardless of its name. - More accurate pin counts when initializing digital listener storage for different boards.
-
Core I/O:
- Removed
INPUT_OUTPUT
mode. Only ESP32 used it and it's the same asOUTPUT
. - Added an optimized single-byte binary message type for
#digital_write
. Improves write throughput 6-7x. Only works for pins 0..63. Fallback automatic for higher pins.
- Removed
-
Hardware I2C:
- Message format changed so "value" isn't used. Will be used for differentiating multiple I2C interfaces in future.
- Responses now prefixed with
I2C{index}:
(index = I2C device integer, always 0 for now), instead of SDA pin number.
-
Hardware SPI:
- Transfers don't need a chip select pin now. This is for LED strips like APA102.
-
Bit-Bang I2C:
- Newly added. Works similar to Bit-Bang SPI.
Board Interface Changes
-
Board#set_pin_mode
now takes a third hash argument,options={}
. Only used keys areresolution:
andfrequency:
for setting PWM resolution. Only works on ESP32 boards andPiBoard
on Linux. -
Added
Board#set_pin_debounce
- Implemented for Linux GPIO alerts in
Denko::PiBoard
(denko-piboard gem). - Sets a time (in microseconds) that level changes on a pin must be stable for, before an update happens.
- Does nothing for
Denko::Board
.
- Implemented for Linux GPIO alerts in
-
Added
OUTPUT_OPEN_DRAIN
andOUTPUT_OPEN_SOURCE
pin modes to supportPiBoard
.
CLI Changes
- All Atmel targets now prefixed with "at". Eg.
atsamd21
now, instead ofsamd21
before.
Bugs Fixed
- ADS111X sensors were incorrectly validating sample rate when set.
- Handshake could fail if board was left in a state where it kept transmitting data.
- An ESP32 with no DACs might not release a LEDC channel after use.
Denko::Connection
could have negative bytes in transit, making it overflow the board's rx buffer.Servo
,Buzzer
andIRTransmitter
didn't start in:output_pwm
mode.SSD1306#on
and#off
would raise errors, trying to write Integer instead of Array toI2C::Bus
.SPI::BitBang
did not correctly set initial clock state for modes 2 and 3.IRTransmitter.emit
didn't work at all ESP8266. Pulse data wasn't aligned properly in memory.Board#ws2812_write
was validating max length to 256 instead of 255.- WS2812 write on ESP32 would crash it, only with some low 8-bit pixel values. Still unsure why, but four extra 0 bytes (preceding the pixel data in auxMsg) seems to work around this.