Navigation

    全志在线开发者论坛

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

    uboot下执行key_test adc_driver,发现例程里gpadc检测不到按键

    V853系列-AI视觉
    2
    3
    125
    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.
    • P
      pengjunchao LV 3 last edited by pengjunchao

      我想在uboot下加一个按键检测,用的V853开发板,开机使用的gpadc读按键

      sunxi_gpadc_init();
      ret = sunxi_gpadc_read(0);
      

      但ret检测到的都是-1,发现函数sunxi_gpadc_read()内的ints = readl(GP_DATA_INTS); 读GP_DATA_INTS寄存器一直都是0根本改不了值,不知道为什么,现在不知道怎么在uboot检测按键了。
      随后发现ubot的key_test有关于gpadc的例程,跑了之后发现也检测不到按键,现在就无语了。
      想问问大家怎么办

      1 Reply Last reply Reply Quote Share 0
      • W
        whycan晕哥 LV 9 last edited by

        @pengjunchao
        我这边测试也是 -1

        打印寄存器也是对的

        => key_test adc_driver
        GP_CTRL = 0x2009004
        gpadc read volxxxxxx:  -1
        gpadc read volxxxxxx:  -1
        gpadc read volxxxxxx:  -1
        
        P 1 Reply Last reply Reply Quote Share 0
        • P
          pengjunchao LV 3 @whycan last edited by

          @whycan 屏幕截图 2023-01-03 103532.png
          加上ints数值的打印你能打印到1 吗,如果不能那返回就一定是-1。

          printk("%s:%d ints:%d\n", FUNCTION, LINE, ints);

          1 Reply Last reply Reply Quote Share 0
          • 1 / 1
          • First post
            Last post

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

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