Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • U uPython-mirror
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • TASTETASTE
  • uPython-mirror
  • Repository
  • uPython-mirror
  • zephyr
  • Makefile
Find file BlameHistoryPermalink
  • Daniel Thompson's avatar
    zephyr: Initial implementation of machine.Pin. · 67b6d9d4
    Daniel Thompson authored Sep 28, 2016
    
    
    The integration with Zephyr is fairly clean but as MicroPython Hardware API
    requires pin ID to be a single value, but Zephyr operates GPIO in terms of
    ports and pins, not just pins, a "hierarchical" ID is required, using tuple
    of (port, pin). Port is a string, effectively a device name of a GPIO port,
    per Zephyr conventions these are "GPIO_0", "GPIO_1", etc.; pin is integer
    number of pin with the port (supposed to be in range 0-31).
    
    Example of pin initialization:
    
    pin = Pin(("GPIO_1", 21), Pin.OUT)
    
    (an LED on FRDM-K64F's Port B, Pin 21).
    
    There is support for in/out pins and pull up/pull down but currently
    there is no interrupt support.
    
    Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
    Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@linaro.org>
    Signed-off-by: default avatarPaul Sokolovsky <paul.sokolovsky@linaro.org>
    67b6d9d4