zoukankan      html  css  js  c++  java
  • 《开发板 —— i2c-tools调试i2c设备》

    1. i2c-tools

      下载网址:https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/ 

      直接下载,然后修改tools/Makefile中的编译器,根据自己的板卡选择不同的交叉编译器。

      然后make编译。会在tools/下生成i2cdetect, i2cdump, i2cget, i2cset。

    2.i2cdetect

    2.1 用i2cdetect检测有几组i2c总线在系统上,输入:i2cdetect -l

       可以看出系统中目前正在使用的i2c总线是i2c-1和i2c-4。

    2.2用i2cdetect检测挂载在i2c总线上器件,输入 i2cdetect -r -y 1(检测i2c-1上的挂载情况)

       UU表示有设备挂在到该总线上,可以看到0x10和0x32都有设备挂载。

       可以证明该i2c设备已经成功挂载到了i2c-1总线上。

    3.i2cdump

     用i2cdump查看器件所有寄存器的值。i2cdump -f -y 1 0x32

    4.i2cget

     i2cget -f -y 1 0x32 0x77     (读取i2c-1上0x32器件的0x77寄存器值)

    5.i2cset

    i2cset -f -y 1 0x32 0x77 0x3f (设置i2c-1上0x32器件的0x77寄存器值为0x3f)

  • 相关阅读:
    asp.net 2.0 run
    Regular Expression
    assembly
    asp.net loading..
    session
    asp.net performance
    asp.net page order
    interface
    UVA 562 Dividing coins
    UVA 10003 Cutting Sticks
  • 原文地址:https://www.cnblogs.com/zhuangquan/p/15352947.html
Copyright © 2011-2022 走看看