Skip to content

Consistent Pin API for all ports #1408

@danicampora

Description

@danicampora

This continues what started being discussed in #1405. The Pin API as far as the constructor (and the init()) method is concerned needs to be modified a bit in order to make it more general and suitable for a wide range of MCUs. Here's my proposal:

Pin(pin, mode, *, type=Pin.PP, pull=None, af=0)
  • mode can be IN, OUT or AF
  • type can be PP or OD. Irrelevant when mode=Pin.IN.
  • pull can be PULL_UP, PULL_DOWN or None (or PULL_NONE but we could save on QSTRs)
  • af is only relevant when mode=Pin.AF. Alternate functions can vary widely from micro to micro so I think it's OK for the values of this param to be port specific.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfcRequest for Comment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy