Skip to content

feat: extend PinMode enum with INPUT_FLOATING and INPUT_ANALOG#264

Open
Aymane-ST wants to merge 1 commit intoarduino:masterfrom
Aymane-ST:pr/pinmode-extend
Open

feat: extend PinMode enum with INPUT_FLOATING and INPUT_ANALOG#264
Aymane-ST wants to merge 1 commit intoarduino:masterfrom
Aymane-ST:pr/pinmode-extend

Conversation

@Aymane-ST
Copy link
Copy Markdown

Summary

Extend PinMode with:

  • INPUT_FLOATING = INPUT
  • INPUT_ANALOG = 0x5

Also add:

  • OUTPUT_OPEN_DRAIN = OUTPUT_OPENDRAIN

Why

Some cores, especially STM32, expose more explicit GPIO modes than the current common API:

  • INPUT_FLOATING improves readability and compatibility with existing code, while remaining an alias of INPUT
  • INPUT_ANALOG exposes a real hardware mode available on many MCUs
  • OUTPUT_OPEN_DRAIN provides a clearer alias for the existing spelling

Compatibility

This is backward-compatible:

  • existing values are unchanged
  • aliases do not change behavior
  • INPUT_ANALOG is additive and only affects code that explicitly uses it

Benefit

This makes the generic API more expressive and reduces the need for core-specific pin mode constants in sketches and libraries.

Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants