Skip to content

fix(gpio): support Rockchip global GPIO numbering#58

Merged
rightup merged 1 commit intopyMC-dev:devfrom
mitchellmoss:codex/luckfox-rockchip-gpio
Apr 22, 2026
Merged

fix(gpio): support Rockchip global GPIO numbering#58
rightup merged 1 commit intopyMC-dev:devfrom
mitchellmoss:codex/luckfox-rockchip-gpio

Conversation

@mitchellmoss
Copy link
Copy Markdown
Contributor

Summary

  • Resolve integer GPIO values >=32 to /dev/gpiochip line when the matching banked gpiochip exists.
  • Preserve existing Raspberry Pi / BCM-style behavior for low GPIO line numbers and for systems without a matching banked gpiochip.
  • Guard the python-periphery cdev2 realtime event-clock workaround so older python-periphery builds that do not ship gpio_cdev2 still import cleanly.

Context

Luckfox/Rockchip documentation exposes header pins as global GPIO numbers using bank * 32 + offset. PiMesh V2 / E22P configs on Luckfox use values like 54, 121, and 122; treating those as line offsets on /dev/gpiochip0 opens the wrong GPIO line. This keeps the current integer config style while allowing Rockchip banked GPIOs to resolve to the correct character device.

Verification

  • python3 -m compileall -q src
  • git diff --check
  • python3 -m pytest -q could not run locally because pytest is not installed in the active Python environment.

@rightup rightup merged commit 994de45 into pyMC-dev:dev Apr 22, 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.

3 participants