Skip to content

Implement global GPIO numbering for PWM and ADC pin mappings#13

Merged
soburi merged 4 commits into
configure_by_connector_deffrom
copilot/sub-pr-4-a39d8ef7-6197-4fa0-a715-fd87b6b4c807
Feb 11, 2026
Merged

Implement global GPIO numbering for PWM and ADC pin mappings#13
soburi merged 4 commits into
configure_by_connector_deffrom
copilot/sub-pr-4-a39d8ef7-6197-4fa0-a715-fd87b6b4c807

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 11, 2026

Completes the implementation of global GPIO numbering mode for PWM and ADC pin configurations when /zephyr,user/digital-pin-gpios is not defined.

Changes

  • PWM pin mapping: Added PWM_PINS_GLOBAL macro to convert pwm-pin-gpios entries to global GPIO numbers, populating arduino_pwm_pins[] correctly in global numbering mode
  • ADC pin mapping: Added ADC_PINS_GLOBAL macro to convert adc-pin-gpios entries to global GPIO numbers, populating arduino_analog_pins[] correctly in global numbering mode

Both macros follow the same pattern as ZARD_AN_ENUM_GLOBAL used in Arduino.h, using ZARD_GLOBAL_GPIO_NUM() to derive pin numbers from GPIO specifiers.

#define PWM_PINS_GLOBAL(n, p, i) \
    ZARD_GLOBAL_GPIO_NUM(DT_PHANDLE_BY_IDX(n, p, i)) + DT_PHA_BY_IDX(n, p, i, pin),

This enables boards using connector-based configuration without explicit digital pin mappings to properly support PWM and ADC functionality.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 11, 2026 00:16
Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Co-authored-by: soburi <458281+soburi@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure board model by connector definitions Implement global GPIO numbering for PWM and ADC pin mappings Feb 11, 2026
Copilot AI requested a review from soburi February 11, 2026 00:17
@soburi soburi marked this pull request as ready for review February 11, 2026 00:20
Copilot AI review requested due to automatic review settings February 11, 2026 00:20
@soburi soburi merged commit dd32c52 into configure_by_connector_def Feb 11, 2026
4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements “global GPIO numbering mode” pin mapping for PWM and ADC when /zephyr,user/digital-pin-gpios is not present, bringing arduino_pwm_pins[] and arduino_analog_pins[] in line with the existing global numbering approach used elsewhere (e.g., ZARD_AN_ENUM_GLOBAL in Arduino.h).

Changes:

  • Add PWM_PINS_GLOBAL to map pwm-pin-gpios entries to global GPIO numbers for arduino_pwm_pins[].
  • Add ADC_PINS_GLOBAL to map adc-pin-gpios entries to global GPIO numbers for arduino_analog_pins[].
  • Ignore CodeQL-generated build artifacts in .gitignore.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
cores/arduino/zephyrCommon.cpp Adds global-numbering macro expansions for PWM/ADC pin arrays when digital_pin_gpios is not defined.
.gitignore Adds CodeQL artifact paths to ignore list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@soburi soburi deleted the copilot/sub-pr-4-a39d8ef7-6197-4fa0-a715-fd87b6b4c807 branch February 11, 2026 00:29
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