Skip to content

kakip: build the robot-eye demo against libgpiod 1.x or 2.x - #10

Merged
wigcheng merged 4 commits into
open-ep:masterfrom
jason9816:kakip-26.04
Oct 18, 2026
Merged

wigcheng merged 4 commits into
open-ep:masterfrom
jason9816:kakip-26.04

Conversation

@jason9816

Copy link
Copy Markdown
Contributor
  • common/gpiod_compat.h: one GPIO API (open chip by name, path or label;
    request line as output/input; set, get, release; close) with an
    implementation per libgpiod major version, picked from gpiod.h at
    compile time
  • pixpaper-213-m-robot-eye-kakip.c: use gpiod_compat.h instead of the
    libgpiod 1.x API directly
  • pixpaper-213-m-robot-eye-kakip.c: open the RZ/V2H pinctrl chip by
    label (10410000.pinctrl) instead of gpiochip0
  • pixpaper-213-m-robot-eye-kakip.c: default to /dev/spidev1.0 and take
    the spidev path as the first argument

Tested on Kakip, Ubuntu 26.04 (libgpiod 2.2.1): e-paper demo on CE0 and
CE1, 10 re-inits + 300 s run. Compiles against gpiod.h 1.0 to 2.3.1.

gpiod_compat.h gives the demos one open/request/set/get/release API
that builds unchanged against libgpiod 1.x or 2.x.

Compiles against gpiod.h 1.0 to 2.3.1 (ten releases) without warnings.
Run on Kakip with libgpiod 2.2.1; the 1.x path is compile-tested only.
Ubuntu 26.04 ships libgpiod 2.x, which is not source compatible with
the 1.x API this demo called directly. Use common/gpiod_compat.h,
which builds against either.
Open the RZ/V2H pinctrl by its label instead of gpiochip0; the number
depends on which GPIO controllers probe first.
On the Kakip 6.1 kernel the 40-pin header is SPI bus 1, so default to
/dev/spidev1.0 and take the device path as the first argument:

  sudo ./robot-eye                  # /dev/spidev1.0
  sudo ./robot-eye /dev/spidev1.1   # second chip select
@wigcheng
wigcheng merged commit b68eec9 into open-ep:master Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants