导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    分享一个全志GPIO号计算方法

    灌水区
    1
    1
    1315
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • H
      haaland LV 6 最后由 编辑

      一、源码定义

      全志的GPIO号在 sunxi-gpio.h 中定义

      sunxi-gpio.h
      

      二、GPIO号定义

      #define SUNXI_PA_BASE   0
      #define SUNXI_PB_BASE   32
      #define SUNXI_PC_BASE   64
      #define SUNXI_PD_BASE   96
      #define SUNXI_PE_BASE   128
      #define SUNXI_PF_BASE   160
      #define SUNXI_PG_BASE   192
      #define SUNXI_PH_BASE   224
      #define SUNXI_PI_BASE   256
      #define SUNXI_PJ_BASE   288
      #define SUNXI_PK_BASE   320
      #define SUNXI_PL_BASE   352
      #define SUNXI_PM_BASE   384
      #define SUNXI_PN_BASE   416
      #define SUNXI_PO_BASE   448
      #define AXP_PIN_BASE    1024
      

      三、计算方式

      举两个例子

      1、PA13
      PA 是从0开始定义的,那么就是: 0 +13 = 13
      那么 PA13 的GPIO号 就是 GPIO13

      2、PE10
      PE 是从128开始定义的,那么就是:128 + 10 = 138
      那么 PE10 的GPIO号 就是 GPIO138

      原文链接:https://blog.csdn.net/weixin_44205779/article/details/109021937

      1 条回复 最后回复 回复 引用 分享 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策