Skip to content

spi-half-duplex - #726

Open
Shadowtrance wants to merge 2 commits into
TactilityProject:mainfrom
Shadowtrance:spi-half-duplex
Open

Shadowtrance wants to merge 2 commits into
TactilityProject:mainfrom
Shadowtrance:spi-half-duplex

Conversation

@Shadowtrance

@Shadowtrance Shadowtrance commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for configuring SPI peripherals for half-duplex communication. In this mode, enabled write and read phases run sequentially while the peripheral remains selected.
    • Transfers with no transmit buffer clock out zeroes, and supported ESP32 hardware can use external-memory transmit buffers directly for DMA.
  • Bug Fixes
    • Preserved combined transfers for full-duplex devices and improved handling of transfer and bus-acquisition failures.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 23b33810-c3d2-4fb5-85e1-3f6a4f5b3179
Commits

Reviewing files that changed from the base of the PR and between 0c607cf and 4f8ee72.

Files selected for processing: 2
  • Platforms/platform-esp32/source/drivers/esp32_spi.cpp
  • TactilityKernel/include/tactility/drivers/spi_controller.h
Files skipped from review as they are similar to previous changes: 1
  • Platforms/platform-esp32/source/drivers/esp32_spi.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

SpiDeviceConfig now includes a half_duplex flag. The ESP32 driver stores this setting and applies the corresponding ESP-IDF device flag. In half-duplex mode, the driver submits enabled write and read phases sequentially. In full-duplex mode, it submits combined transactions. Transmit helpers zero-fill null buffers in chunks of up to 64 bytes. On supported chips, the driver marks external-RAM transmit buffers for direct DMA.

Priority: Low

Merge Risk: Low · up to 4f8ee

Half-duplex transfers now separate write and read phases correctly. Merge risk is bounded to configuration compatibility: callers must initialize the new half_duplex field explicitly or zero-initialize the configuration.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: adding SPI half-duplex support.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@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


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07b9ca8b-9410-4d83-8594-9955dc167f36
Commits

Reviewing files that changed from the base of the PR and between 0e276da and 0c607cf.

Files selected for processing: 2
  • Platforms/platform-esp32/source/drivers/esp32_spi.cpp
  • TactilityKernel/include/tactility/drivers/spi_controller.h

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Comment thread Platforms/platform-esp32/source/drivers/esp32_spi.cpp Outdated
Comment thread TactilityKernel/include/tactility/drivers/spi_controller.h
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