Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

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

    灌水区
    1
    1
    1821
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      haaland LV 6 last edited by

      一、源码定义

      全志的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 Reply Last reply Reply Quote Share 0
      • 1 / 1
      • First post
        Last post

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

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