<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # I2C操作 ## 使能設備樹節點 arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts ~~~ &i2c0 { status = "okay"; ns2009: ns2009@48 { compatible = "nsiway,ns2009"; reg = <0x48>; }; sht21: sht21@40 { compatible = "sht21"; reg = <0x40>; }; atmel_mxt_ts@4a { compatible = "atmel,atmel_mxt_ts"; reg = <0x4a>; /*interrupt-parent = <&pio>; interrupts = <6 5 IRQ_TYPE_LEVEL_LOW>;*/ //省引腳,使用輪訓方式 }; }; ~~~ ## BSP使用 內核中勾選: CONFIG_I2C_CHARDEV fex中使能對應twi號。 ## 使用i2c-tools ~~~ root@LicheePi:~# i2cdetect -l #查看系統使能的i2c總線,這里只有i2c0一個 i2c-0 i2c mv64xxx_i2c adapter I2C adapter root@LicheePi:~# i2cdetect -r -y 0 //檢測總線上的設備。-y表示省去交互式 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 -- -- -- -- -- -- -- UU -- 4a -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- ~~~ 這里的40,48,4a 分別是sht21溫濕度傳感器,ns2009電阻式觸摸傳感器,mxt336T電容式觸摸傳感器。 i2cdump可以dump出該設備的所有寄存器信息 ~~~ # i2cdump -y 0 0x48 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: ff ff ff ff ff ff ff ff 80 3c 3c 3b 3b 3c 3c 3b ........?<<;;<<; 10: 00 fa ff ff ff ff ff ff 80 00 00 00 00 00 00 00 .?......?....... 20: 7f ff ff ff ff ff ff ff 80 29 43 4e 63 6e 86 8b ?.......?)CNcn?? 30: ff ff ff ff ff ff ff ff 80 2b 45 4d 5d 74 74 7c ........?+EM]tt| 40: ff ff ff ff ff ff ff ff 80 49 48 48 49 49 48 49 ........?IHHIIHI 50: ff ff ff ff ff ff ff ff 80 3d 3c 3d 3d 3c 3d 3c ........?=<==<=< 60: 00 fe ff ff ff ff ff ff 80 00 00 00 00 00 00 00 .?......?....... 70: 7f ff ff ff ff ff ff ff 80 24 31 38 45 53 5a 67 ?.......?$18ESZg 80: 50 58 68 70 71 76 80 81 85 88 8e 96 9b a1 9d a9 PXhpqv?????????? 90: c7 c8 c5 be c1 bb c1 b7 b8 b9 b9 ba ba be c3 c1 ???????????????? a0: b1 ab ae b2 a4 9e a8 a8 a3 9d a9 a6 a0 97 9d a2 ???????????????? b0: 88 97 a3 a4 a7 a9 b2 ad b5 b4 b6 b4 b2 af b5 b6 ???????????????? c0: cf d4 cd cd cd d1 c7 ca c4 c0 ba bc bc c3 bc bf ???????????????? d0: dc dd de dc d9 d4 cf d5 d1 c7 c4 bd c2 b8 bb bd ???????????????? e0: c1 bb bf c5 be c8 c2 bb c1 b5 b6 b3 af bb bb c0 ???????????????? f0: 88 71 57 4f 50 45 40 3a 41 3c 45 41 3a 50 57 69 ?qWOPE@:A<EA:PWi ~~~ i2c上讀寫數據: ~~~ i2cset -y 1 0x40 0x00 0x13 i2cget -y 1 0x40 0x00 ~~~ ## sht21 傳感器使用 ~~~ insmod sht21.ko echo sht21 0x40 > /sys/bus/i2c/devices/i2c-0/new_device ls /sys/class/hwmon/hwmon0 device name subsystem uevent humidity1_input power temp1_input cat /sys/class/hwmon/hwmon0/temp1_input 25201 #毫攝氏度,即25.201攝氏度 cat /sys/class/hwmon/hwmon0/humidity1_input 58872 #毫百分之1,即58.872%RH ~~~ ## 參考文檔 https://blog.dbrgn.ch/2017/2/6/read-sht21-sensor-from-linux-raspberry-pi/ http://www.360doc.com/content/14/1008/11/7775902_415207889.shtml http://blog.csdn.net/AJ_chenrui/article/details/51202689
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看