Skip to content

Conversation

@soburi
Copy link
Member

@soburi soburi commented Feb 1, 2026

This PR introduce new configuration system without variants/[board].overlay.

Boards that has arduino like connector mostly has define arduino-header.
We can use this information to configure automatically for each boards.
We can support all zephyr supported that has arduino-header.
That means, we make it works for more 200 boards, including Nucleo series.

However, only Blinky works out of the box, and ADC and PWM channels are required.
These should be made into snippets in the future.

@soburi soburi force-pushed the configure_by_connector_def branch from 30e80c9 to 2157ae2 Compare February 1, 2026 15:38
@soburi soburi changed the title Configure by connector def Support **file-less** configuration Feb 1, 2026
@soburi soburi changed the title Support **file-less** configuration Support "file-less" configuration Feb 1, 2026
@soburi soburi force-pushed the configure_by_connector_def branch 2 times, most recently from d14bab2 to 769f878 Compare February 5, 2026 15:17
@soburi soburi marked this pull request as ready for review February 5, 2026 15:17
Copilot AI review requested due to automatic review settings February 5, 2026 15:17
@soburi soburi marked this pull request as draft February 5, 2026 15:17
Copy link

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

This PR introduces a "file-less" configuration system that automatically configures boards using Arduino-compatible header definitions from the device tree, eliminating the need for board-specific overlay files. The system detects supported connector types (arduino_header, arduino_mkr_header, etc.) and automatically maps GPIO pins, enabling support for 200+ Zephyr-supported boards including the Nucleo series.

Changes:

  • Added automatic board detection using device tree connector labels (arduino_header, pico_header, etc.)
  • Introduced GPIO port/pin abstraction layer with constexpr helper functions for compile-time pin mapping
  • Modified tone/noTone implementation to support dynamic timer allocation by tracking pin assignments
  • Updated PWM and ADC pin mappings to support both legacy and new connector-based configurations

Reviewed changes

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

File Description
cores/arduino/Arduino.h Adds macro definitions for automatic connector detection (ZARD_CONNECTOR, ZARD_ADC_CONNECTOR, ZARD_PWM_CONNECTOR) and updates digital/analog pin enums to support both legacy and connector-based configurations
cores/arduino/zephyrCommon.cpp Implements GPIO abstraction layer with constexpr functions for pin mapping, updates all GPIO operations to use new abstraction, and modifies tone/noTone for improved timer management

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

Copy link

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


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

@soburi soburi force-pushed the configure_by_connector_def branch 3 times, most recently from 9d23221 to 293076c Compare February 9, 2026 10:57
@DhruvaG2000
Copy link
Member

This PR looks quite interesting, will be on my next list of things to review!

@soburi soburi force-pushed the configure_by_connector_def branch from 293076c to 7e1fd4c Compare February 9, 2026 14:23
* Copyright (c) 2026 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
Copy link
Member

Choose a reason for hiding this comment

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

If we can get #161 merged before this, then this will no longer be needed.

@soburi soburi force-pushed the configure_by_connector_def branch 2 times, most recently from 4190e65 to 1a5ad63 Compare February 10, 2026 13:32
Fixed a bug where tone() with duration=0 would stop the tone immediately
instead of ringing infinitely.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Allows you to change the maximum number of notes that can be
played with `tone()`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add a tone_doremi sample to demonstrate how to sounding with tone API

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
In preparation for improvements to allow the use of GPIOs without
device tree definitions,
the interface will be changed to specify port and pin instead of
`gpio_dt_spec`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
If digital-gpio-pins is not defined,
the pin configuration will be generated using the connector definition.

This allows ArduinoCore-Zephyr to be used on boards that have
arduino-header defined,
without requiring specific configuration in ArduinoCore-Zephyr.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
A new configuration method has been adopted, allowing support to be added
with less configuration than before.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
@soburi soburi force-pushed the configure_by_connector_def branch from 1a5ad63 to fd0d3fb Compare February 10, 2026 13:40
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