Skip to content

Extending PinMode to support MCUs with open-drain outputs? #155

Closed
@obra

Description

@obra

I'm in the process of collaborating with some other folks to build a new Arduino port for GigaDevice's GD32 chips[1]. We're attempting to build on top of ArduinoCore-API. In general, It's so much better than the old way of doing things. One thing we're running into is how to handle gaps in the PinMode enum.

Specifically, we're short an OUTPUT_OPENDRAIN in PinMode

Would a PR that adds a new OUPUT_OPENDRAIN = 0x4 to the PinMode definition be welcome? If not, is there an alternate "Arduinoish" way to build the user-facing API to set a pin as an open-drain output?

[1] https://github.com/CommunityGD32Cores/ArduinoCore-GD32

Thanks!

Activity

facchinm

facchinm commented on Sep 22, 2021

@facchinm
Member

I'm totally 👍 to add the OUTPUT_OPENDRAIN define; would you mind to file a PR with the change?

added a commit that references this issue on Sep 22, 2021
4270ce3
obra

obra commented on Sep 22, 2021

@obra
ContributorAuthor

Done as #157, with copious notes for the next person who needs to work around lack of some pin mode in the commit message ;)

Based on the implementation of Analog pins in the Arduino world, I'm guessing that a standard "INPUT_ANALOG" PinMode is not of general interest?

added a commit that references this issue on Sep 30, 2021
df98331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @obra@facchinm

      Issue actions

        Extending PinMode to support MCUs with open-drain outputs? · Issue #155 · arduino/ArduinoCore-API