Releases: denko-rb/lgpio
Releases · denko-rb/lgpio
v0.1.11
General:
- Better validation of Ruby arrays inside C functions
- Added
LGPIO.micro_delay(duration)
Hardware PWM:
- Ensure polarity is always set to :normal on initialize, not :inversed by default on some hardware
- Add
#polarity
,#polarity=
and#frequency
- Duty cycles are now correctly set as floats, not integers
Hardware SPI:
- Allow reading and writing different lengths in
LGPIO.spi_xfer
. Now requires a 3rd arg always, for number of bytes to read.
Bit-Bang I2C:
- Move bit level operations back into C. Very little C code, so still mostly Ruby to maintain, but much faster where YJIT isn't available (mostly Raspberry Pi Zero W). On newer boards performance difference is negligible.
v0.1.10
- Fix
I2CBitBang
andSPIBitBang
, which were broken by the last version. - They both now take a hash of pin hashes for initialization, and can work across gpiochip devices.
- Each pin hash must have an already open LGPIO handle (NOT chip number) for the chip to be used, and which line number of that chip is to be used.
- I2C example:
{ scl: { handle: h0, line: 1 }, sda: { handle: h1, line: 15 } }
- SPI example:
{ clock: { handle: h0, line: 3 }, input: { handle: h1, line: 4 }, output: { handle: h2, line: 5 } }
v0.1.9
- Changed arg order for
_claim_
methods, compared to lgpio C, so that gpio number (or group of numbers) always follows handle. The general pattern ishandle, gpio, flags, state
. This affects:gpio_claim_input
gpio_claim_output
gpio_claim_alert
group_claim_input
group_claim_output
Helpful on boards where the usable GPIO lines are spread across multiple /dev/gpiochipN
devices. Lines/groups can be referred to by tuples of [gpiochip, line/group]
, then then splatted when given to these methods.