Skip to content

GPIO descriptor fixes#578

Merged
KenVanHoeylandt merged 22 commits into
mainfrom
develop3
Jul 22, 2026
Merged

GPIO descriptor fixes#578
KenVanHoeylandt merged 22 commits into
mainfrom
develop3

Conversation

@KenVanHoeylandt

@KenVanHoeylandt KenVanHoeylandt commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Corrected GPIO active-low handling so driven and reported levels match the configured polarity, including reset/interrupt behavior.
    • Improved GPIO initialization reliability by applying direction/pull/interrupt behavior during pin acquisition and standardizing reset pulse sequences.
  • Compatibility

    • Removed reset-active-high / interrupt-active-high options from multiple bindings/configs; polarity is now defined via the GPIO specs (e.g., pin-reset / pin-interrupt).
  • Device Configuration

    • Reduced display bounce-buffer sizes on affected devices; one board now uses a single framebuffer.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8540f95a-9dcc-4eb5-953d-fa5bff9c0f74

📥 Commits

Reviewing files that changed from the base of the PR and between c23d151 and 13c7997.

📒 Files selected for processing (1)
  • TactilityKernel/source/drivers/gpio_hog.cpp

📝 Walkthrough

Walkthrough

The GPIO API now accepts acquisition-time flags, stores descriptor configuration, supports pin-spec acquisition, and exposes flag queries. Drivers and ESP32 peripherals pass direction, pull, interrupt, ownership, and active-low settings during acquisition. GPIO level handling was updated for active-low expanders and ESP32 pins. Display and touch bindings remove configurable polarity fields, while reset and interrupt implementations use fixed active-low behavior. Board GPIO hogs and device configurations were updated accordingly.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the changes, but it is too vague to convey the main scope of the pull request. Use a more specific title that mentions the main theme, such as GPIO acquisition and active-low handling updates.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KenVanHoeylandt

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 04cc9dcd-10b8-468b-997e-14364ac74d44

📥 Commits

Reviewing files that changed from the base of the PR and between b3c6be7 and 66dedb6.

📒 Files selected for processing (112)
  • Devices/m5stack-cores3/m5stack,cores3.dts
  • Devices/m5stack-papers3/source/drivers/papers3_power.cpp
  • Devices/m5stack-stackchan/m5stack,stackchan.dts
  • Devices/m5stack-tab5/Source/devices/devices_v1.cpp
  • Devices/m5stack-tab5/Source/devices/devices_v2.cpp
  • Devices/m5stack-tab5/Source/devices/display_detect.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_headphone_detect.cpp
  • Devices/m5stack-tab5/Source/devices/tab5_power_control.cpp
  • Devices/m5stack-tab5/Source/module.cpp
  • Devices/unphone/source/BatteryManager.cpp
  • Devices/unphone/source/drivers/unphone_nav_buttons.cpp
  • Devices/unphone/source/drivers/unphone_power_switch.cpp
  • Drivers/audio-codec-module/source/audio_codec_gpio_if.c
  • Drivers/aw88298-module/source/aw88298.cpp
  • Drivers/aw9523b-module/source/aw9523b.cpp
  • Drivers/axs5106-module/bindings/axs,axs5106.yaml
  • Drivers/axs5106-module/include/drivers/axs5106.h
  • Drivers/axs5106-module/source/axs5106.cpp
  • Drivers/button-control-module/source/button_control.cpp
  • Drivers/cst328-module/bindings/hynitron,cst328.yaml
  • Drivers/cst328-module/include/drivers/cst328.h
  • Drivers/cst328-module/source/cst328.cpp
  • Drivers/cst66xx-module/bindings/hynitron,cst66xx.yaml
  • Drivers/cst66xx-module/include/drivers/cst66xx.h
  • Drivers/cst66xx-module/source/cst66xx.cpp
  • Drivers/cst816s-module/bindings/hynitron,cst816s.yaml
  • Drivers/cst816s-module/include/drivers/cst816s.h
  • Drivers/cst816s-module/source/cst816s.cpp
  • Drivers/cst816t-module/bindings/hynitron,cst816t.yaml
  • Drivers/cst816t-module/include/drivers/cst816t.h
  • Drivers/cst816t-module/source/cst816t.cpp
  • Drivers/ft5x06-module/bindings/focaltech,ft5x06.yaml
  • Drivers/ft5x06-module/include/drivers/ft5x06.h
  • Drivers/ft5x06-module/source/ft5x06.cpp
  • Drivers/ft6x36-module/bindings/focaltech,ft6x36.yaml
  • Drivers/ft6x36-module/include/drivers/ft6x36.h
  • Drivers/ft6x36-module/source/ft6x36.cpp
  • Drivers/gc9a01-module/bindings/galaxycore,gc9a01.yaml
  • Drivers/gc9a01-module/include/drivers/gc9a01.h
  • Drivers/gc9a01-module/source/gc9a01.cpp
  • Drivers/gt911-module/bindings/goodix,gt911.yaml
  • Drivers/gt911-module/include/drivers/gt911.h
  • Drivers/gt911-module/source/gt911.cpp
  • Drivers/hx8357-module/bindings/himax,hx8357.yaml
  • Drivers/hx8357-module/include/drivers/hx8357.h
  • Drivers/hx8357-module/source/hx8357.cpp
  • Drivers/ili9341-module/source/ili9341.cpp
  • Drivers/ili9488-module/bindings/ilitek,ili9488.yaml
  • Drivers/ili9488-module/include/drivers/ili9488.h
  • Drivers/ili9488-module/source/ili9488.cpp
  • Drivers/ili9881c-module/bindings/ilitek,ili9881c.yaml
  • Drivers/ili9881c-module/include/drivers/ili9881c.h
  • Drivers/ili9881c-module/source/ili9881c.cpp
  • Drivers/jd9165-module/bindings/jdi,jd9165.yaml
  • Drivers/jd9165-module/include/drivers/jd9165.h
  • Drivers/jd9165-module/source/jd9165.cpp
  • Drivers/jd9853-module/bindings/jadard,jd9853.yaml
  • Drivers/jd9853-module/include/drivers/jd9853.h
  • Drivers/jd9853-module/source/jd9853.cpp
  • Drivers/lilygo-module/source/tdeck_trackball.cpp
  • Drivers/lilygo-module/source/tpager_encoder.cpp
  • Drivers/m5stack-module/source/cardputer_keyboard.cpp
  • Drivers/pi4ioe5v6408-module/source/pi4ioe5v6408.cpp
  • Drivers/rgb-display-module/source/rgb_display.cpp
  • Drivers/ssd1306-module/bindings/solomon,ssd1306.yaml
  • Drivers/ssd1306-module/include/drivers/ssd1306.h
  • Drivers/ssd1306-module/source/ssd1306.cpp
  • Drivers/st7123-module/bindings/sitronix,st7123-touch.yaml
  • Drivers/st7123-module/bindings/sitronix,st7123.yaml
  • Drivers/st7123-module/include/drivers/st7123.h
  • Drivers/st7123-module/include/drivers/st7123_touch.h
  • Drivers/st7123-module/source/st7123.cpp
  • Drivers/st7123-module/source/st7123_touch.cpp
  • Drivers/st7701-module/bindings/sitronix,st7701.yaml
  • Drivers/st7701-module/include/drivers/st7701.h
  • Drivers/st7701-module/source/st7701.cpp
  • Drivers/st7735-module/bindings/sitronix,st7735.yaml
  • Drivers/st7735-module/include/drivers/st7735.h
  • Drivers/st7735-module/source/st7735.cpp
  • Drivers/st7789-i8080-module/bindings/sitronix,st7789-i8080.yaml
  • Drivers/st7789-i8080-module/include/drivers/st7789_i8080.h
  • Drivers/st7789-i8080-module/source/st7789_i8080.cpp
  • Drivers/st7789-module/bindings/sitronix,st7789.yaml
  • Drivers/st7789-module/include/drivers/st7789.h
  • Drivers/st7789-module/source/st7789.cpp
  • Drivers/st7796-i8080-module/bindings/sitronix,st7796-i8080.yaml
  • Drivers/st7796-i8080-module/include/drivers/st7796_i8080.h
  • Drivers/st7796-i8080-module/source/st7796_i8080.cpp
  • Drivers/st7796-module/bindings/sitronix,st7796.yaml
  • Drivers/st7796-module/include/drivers/st7796.h
  • Drivers/st7796-module/source/st7796.cpp
  • Drivers/tca8418-module/bindings/ti,tca8418.yaml
  • Drivers/tca8418-module/include/drivers/tca8418.h
  • Drivers/tca8418-module/source/tca8418.cpp
  • Drivers/xpt2046-softspi-module/source/xpt2046_softspi.cpp
  • Platforms/platform-esp32/private/tactility/drivers/esp32_gpio_helpers.h
  • Platforms/platform-esp32/source/drivers/esp32_gpio.cpp
  • Platforms/platform-esp32/source/drivers/esp32_gpio_helpers.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2c.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2c_master.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2s.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i8080.cpp
  • Platforms/platform-esp32/source/drivers/esp32_sdmmc.cpp
  • Platforms/platform-esp32/source/drivers/esp32_sdspi.cpp
  • Platforms/platform-esp32/source/drivers/esp32_spi.cpp
  • Platforms/platform-esp32/source/drivers/esp32_uart.cpp
  • TactilityKernel/include/tactility/drivers/gpio_controller.h
  • TactilityKernel/include/tactility/drivers/gpio_descriptor.h
  • TactilityKernel/source/drivers/gpio_backlight.cpp
  • TactilityKernel/source/drivers/gpio_controller.cpp
  • TactilityKernel/source/drivers/gpio_hog.cpp
  • TactilityKernel/source/drivers/rgb_led_gpio.cpp
💤 Files with no reviewable changes (49)
  • Drivers/st7796-i8080-module/include/drivers/st7796_i8080.h
  • Drivers/ili9881c-module/bindings/ilitek,ili9881c.yaml
  • Drivers/jd9165-module/include/drivers/jd9165.h
  • Drivers/ili9488-module/include/drivers/ili9488.h
  • Drivers/st7123-module/include/drivers/st7123_touch.h
  • Drivers/st7796-module/include/drivers/st7796.h
  • Drivers/hx8357-module/bindings/himax,hx8357.yaml
  • Drivers/st7701-module/include/drivers/st7701.h
  • Drivers/st7789-module/bindings/sitronix,st7789.yaml
  • Drivers/ili9881c-module/include/drivers/ili9881c.h
  • Drivers/cst328-module/include/drivers/cst328.h
  • Drivers/st7789-module/include/drivers/st7789.h
  • Drivers/st7123-module/bindings/sitronix,st7123.yaml
  • Drivers/gt911-module/include/drivers/gt911.h
  • Drivers/cst66xx-module/include/drivers/cst66xx.h
  • Drivers/cst66xx-module/bindings/hynitron,cst66xx.yaml
  • Drivers/st7735-module/include/drivers/st7735.h
  • Drivers/ssd1306-module/include/drivers/ssd1306.h
  • Drivers/gc9a01-module/bindings/galaxycore,gc9a01.yaml
  • Drivers/cst816t-module/include/drivers/cst816t.h
  • Drivers/ili9488-module/bindings/ilitek,ili9488.yaml
  • Drivers/ft5x06-module/include/drivers/ft5x06.h
  • Drivers/st7789-i8080-module/bindings/sitronix,st7789-i8080.yaml
  • Drivers/hx8357-module/include/drivers/hx8357.h
  • Drivers/st7123-module/include/drivers/st7123.h
  • Drivers/tca8418-module/bindings/ti,tca8418.yaml
  • Drivers/jd9853-module/include/drivers/jd9853.h
  • Drivers/jd9165-module/bindings/jdi,jd9165.yaml
  • Drivers/gc9a01-module/include/drivers/gc9a01.h
  • Drivers/st7735-module/bindings/sitronix,st7735.yaml
  • Drivers/cst328-module/bindings/hynitron,cst328.yaml
  • Drivers/st7789-i8080-module/include/drivers/st7789_i8080.h
  • Drivers/axs5106-module/bindings/axs,axs5106.yaml
  • Drivers/tca8418-module/include/drivers/tca8418.h
  • Drivers/ft6x36-module/bindings/focaltech,ft6x36.yaml
  • Drivers/cst816s-module/bindings/hynitron,cst816s.yaml
  • Drivers/ssd1306-module/bindings/solomon,ssd1306.yaml
  • Drivers/axs5106-module/include/drivers/axs5106.h
  • Drivers/cst816t-module/bindings/hynitron,cst816t.yaml
  • Drivers/st7796-module/bindings/sitronix,st7796.yaml
  • Drivers/st7123-module/bindings/sitronix,st7123-touch.yaml
  • Drivers/ft5x06-module/bindings/focaltech,ft5x06.yaml
  • Drivers/jd9853-module/bindings/jadard,jd9853.yaml
  • Drivers/ft6x36-module/include/drivers/ft6x36.h
  • Drivers/cst816s-module/include/drivers/cst816s.h
  • Drivers/st7796-i8080-module/bindings/sitronix,st7796-i8080.yaml
  • Devices/m5stack-tab5/Source/devices/devices_v2.cpp
  • Drivers/gt911-module/bindings/goodix,gt911.yaml
  • Drivers/st7701-module/bindings/sitronix,st7701.yaml

Comment thread Devices/m5stack-papers3/source/drivers/papers3_power.cpp Outdated
Comment thread Drivers/audio-codec-module/source/audio_codec_gpio_if.c Outdated
Comment thread Drivers/button-control-module/source/button_control.cpp Outdated
Comment thread Drivers/cst816t-module/source/cst816t.cpp
Comment thread Platforms/platform-esp32/source/drivers/esp32_i2c.cpp Outdated
Comment thread Platforms/platform-esp32/source/drivers/esp32_i8080.cpp Outdated
Comment thread Platforms/platform-esp32/source/drivers/esp32_sdmmc.cpp Outdated
Comment thread TactilityKernel/source/drivers/gpio_hog.cpp Outdated
Comment thread TactilityKernel/source/drivers/gpio_hog.cpp Outdated
Base automatically changed from develop2 to main July 22, 2026 19:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
TactilityKernel/source/drivers/gpio_hog.cpp (1)

44-48: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Initialize output-low hogs explicitly.

For GPIO_HOG_MODE_OUTPUT_LOW, initial_high is false, so Line 44 skips gpio_descriptor_set_level(). Acquiring output direction does not guarantee the requested low state; preserve the explicit level initialization for both output modes while leaving input mode untouched.

Proposed fix
-    if (initial_high && gpio_descriptor_set_level(descriptor, initial_high) != ERROR_NONE) {
+    if (config->mode != GPIO_HOG_MODE_INPUT &&
+        gpio_descriptor_set_level(descriptor, initial_high) != ERROR_NONE) {

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40d1d315-65ed-4f38-890f-df7bd9fe89ca

📥 Commits

Reviewing files that changed from the base of the PR and between 66dedb6 and e53928b.

📒 Files selected for processing (21)
  • Devices/m5stack-papers3/source/drivers/papers3_power.cpp
  • Devices/unphone/source/drivers/unphone_nav_buttons.cpp
  • Devices/waveshare-s3-touch-lcd-43/waveshare,s3-touch-lcd-43.dts
  • Documentation/ideas.md
  • Drivers/audio-codec-module/source/audio_codec_gpio_if.c
  • Drivers/axs5106-module/source/axs5106.cpp
  • Drivers/button-control-module/source/button_control.cpp
  • Drivers/cst66xx-module/source/cst66xx.cpp
  • Drivers/cst816t-module/source/cst816t.cpp
  • Drivers/ft6x36-module/source/ft6x36.cpp
  • Drivers/ili9341-module/source/ili9341.cpp
  • Drivers/ili9488-module/source/ili9488.cpp
  • Drivers/st7735-module/source/st7735.cpp
  • Drivers/st7789-i8080-module/source/st7789_i8080.cpp
  • Drivers/st7789-module/source/st7789.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2c.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2c_master.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i8080.cpp
  • Platforms/platform-esp32/source/drivers/esp32_sdmmc.cpp
  • TactilityKernel/source/drivers/gpio_controller.cpp
  • TactilityKernel/source/drivers/gpio_hog.cpp
🚧 Files skipped from review as they are similar to previous changes (14)
  • Drivers/ili9488-module/source/ili9488.cpp
  • Drivers/st7735-module/source/st7735.cpp
  • Drivers/st7789-i8080-module/source/st7789_i8080.cpp
  • Devices/unphone/source/drivers/unphone_nav_buttons.cpp
  • Drivers/cst66xx-module/source/cst66xx.cpp
  • Drivers/st7789-module/source/st7789.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2c.cpp
  • Drivers/button-control-module/source/button_control.cpp
  • Drivers/cst816t-module/source/cst816t.cpp
  • Drivers/audio-codec-module/source/audio_codec_gpio_if.c
  • TactilityKernel/source/drivers/gpio_controller.cpp
  • Platforms/platform-esp32/source/drivers/esp32_i2c_master.cpp
  • Drivers/ft6x36-module/source/ft6x36.cpp
  • Drivers/ili9341-module/source/ili9341.cpp

Comment thread Devices/m5stack-papers3/source/drivers/papers3_power.cpp
Comment thread Platforms/platform-esp32/source/drivers/esp32_sdmmc.cpp Outdated
@KenVanHoeylandt
KenVanHoeylandt merged commit 8b92aa8 into main Jul 22, 2026
0 of 15 checks passed
@KenVanHoeylandt
KenVanHoeylandt deleted the develop3 branch July 22, 2026 20:43
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.

1 participant