{"id":875,"date":"2022-08-20T09:58:40","date_gmt":"2022-08-20T01:58:40","guid":{"rendered":"https:\/\/swordofmorning.com\/?p=875"},"modified":"2025-10-09T13:55:34","modified_gmt":"2025-10-09T05:55:34","slug":"licheepi-nano-03","status":"publish","type":"post","link":"https:\/\/swordofmorning.com\/index.php\/2022\/08\/20\/licheepi-nano-03\/","title":{"rendered":"Licheepi Nano 03 GT911\u89e6\u6478\u5c4f\u4e0eLVGL"},"content":{"rendered":"<p>&emsp;&emsp;\u5728\u672c\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5bf9Nano\u6dfb\u52a0GT911\u89e6\u6478\u5c4f\u9002\u914d\uff0c\u4ee5\u53caLVGL\u7684\u79fb\u690d\u3002<\/p>\n<p><div class=\"has-toc have-toc\"><\/div><\/p>\n<h2 >\u4e00\u3001\u4fee\u6539\u8bbe\u5907\u6811<\/h2>\n<p>&emsp;&emsp;GT911\u9700\u89816\u4e2a\u63a5\u53e3\uff0c\u5373\uff1aVDD\u3001GND\uff1bSDA\u3001SCK\uff1bIRQ\u3001RST\u3002\u8fd9\u91cc\u4f7f\u7528PE11\u3001PE12\u4f5c\u4e3ai2c\u63a5\u53e3\uff1b\u4f7f\u7528PE10\u4f5c\u4e3a\u4e2d\u65ad\uff0cPE9\u4f5c\u4e3aReset\u3002\u9996\u5148\u6211\u4eec\u9700\u8981\u5728<code>dtsi<\/code>\u6587\u4ef6\u4e2d\u6dfb\u52a0\u6211\u4eec\u4f7f\u7528\u7684i2c\u63a5\u53e3\u7684\u5b9a\u4e49\u3002\u9996\u5148\u5728<code>soc-&gt;pio<\/code>\u8282\u70b9\u4e0b\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code class='language-c' lang='c'>i2c0_pins: i2c0 {\n                pins = &quot;PE11&quot;, &quot;PE12&quot;;\n                function = &quot;i2c0&quot;;\n            };\n<\/code><\/pre>\n<p>\u7136\u540e\u5728<code>soc<\/code>\u8282\u70b9\u4e0b\u6dfb\u52a0\uff1a<\/p>\n<pre><code class='language-c' lang='c'>i2c0: i2c@1C27000 {\n            compatible = &quot;allwinner,sun6i-a31-i2c&quot;;\n            reg = &lt;0x01C27000 0x400&gt;;\n            interrupts = &lt;7&gt;;\n            clocks = &lt;&amp;ccu CLK_BUS_I2C0&gt;;\n            resets = &lt;&amp;ccu RST_BUS_I2C0&gt;;\n            pinctrl-names = &quot;default&quot;;\n            pinctrl-0 = &lt;&amp;i2c0_pins&gt;;\n            status = &quot;disabled&quot;;\n            #address-cells = &lt;1&gt;;\n            #size-cells = &lt;0&gt;;\n        };\n<\/code><\/pre>\n<p>&emsp;&emsp;\u63a5\u4e0b\u6765\u5728<code>dts<\/code>\u6587\u4ef6\u4e2d\u6dfb\u52a0GT911\u7684\u63cf\u8ff0\u5185\u5bb9\u3002\u76f4\u63a5\u5728\u540e\u9762\u8ffd\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code class='language-c' lang='c'>\/* GT911 *\/\n&amp;i2c0 {\n    pinctrl-0 = &lt;&amp;i2c0_pins&gt;;\n    pinctrl-names = &quot;default&quot;;\n    status = &quot;okay&quot;;\n\n    gt911: touchscreen@5d {\n        compatible = &quot;goodix,gt911&quot;;\n        reg = &lt;0x5d&gt;;\n        interrupt-parent = &lt;&amp;pio&gt;;\n        interrupts = &lt;4 10 IRQ_TYPE_EDGE_FALLING&gt;; \/* (PE10) *\/\n        pinctrl-names = &quot;default&quot;;\n        \/\/ pinctrl-0 = &lt;&amp;ts_reset_pin&gt;;\n        irq-gpios = &lt;&amp;pio 4 10 GPIO_ACTIVE_HIGH&gt;; \/* (PE10) *\/\n        reset-gpios = &lt;&amp;pio 4 9 GPIO_ACTIVE_HIGH&gt;; \/* RST (PE9) *\/\n        max-x = &lt;800&gt;;\n        max-y = &lt;480&gt;;\n        \/* touchscreen-swapped-x-y *\/\n    };\n}; \n\n\/\/ gt911 pio\n&amp;pio {\n    gt911_int_pin: gt911_int_pin@0{\n        pins = &quot;PE10&quot;;\n        function = &quot;gpio_in&quot;;\n    };\n\n    ts_reset_pin: ts_reset_pin@0 {\n        pins = &quot;PE9&quot;;\n        function = &quot;gpio_out&quot;;\n    };\n<\/code><\/pre>\n<p>\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u91cc\u7684GT911\u7684\u5730\u5740\u9700\u8981\u5bf9\u5e94\u624b\u518c\u67e5\u770b\u4e3a<code>0x14<\/code>\u8fd8\u662f<code>0x5d<\/code>\uff1b\u540c\u65f6\uff0cpinctrl\u9700\u8981\u6ce8\u91ca\uff0c\u5426\u5219\u4f1a\u62a5\u9519<code>pin already request<\/code>\u3002\u8fd9\u91cc\u662f\u5b8c\u6574\u7684<a href = \"https:\/\/cdn.swordofmorning.com\/SwordofMorning\/Article%20File\/LicheepiNano\/03\/suniv-f1c100s.dtsi\">dsti\u6587\u4ef6<\/a>\u548c<a href = \"https:\/\/cdn.swordofmorning.com\/SwordofMorning\/Article%20File\/LicheepiNano\/03\/suniv-f1c100s-licheepi-nano.dts\">dts\u6587\u4ef6<\/a>\u3002<\/p>\n<h2 >\u4e8c\u3001\u7f16\u8bd1\u5185\u6838<\/h2>\n<p>&emsp;&emsp;\u5728\u786e\u4fdd<code>\/drivers\/input\/touchscreen\/<\/code>\u4e0b\u6709goodix.c\u5b58\u5728\uff0c\u4e4b\u540e\u7f16\u8bd1\u5185\u6838\uff0c\u8fd9\u91cc\u9009\u62e9\u5c06gooidx\u7f16\u8bd1\u5230\u5185\u6838\u5f53\u4e2d\uff08\u91c7\u7528\u6a21\u5757\u7684\u65b9\u5f0f\u53ef\u80fd\u4f1a\u9047\u5230\u7f3a\u5c11bin\u6587\u4ef6\u7684\u60c5\u51b5\uff09\u3002\u5b8c\u6210\u540e\u8fdb\u5165\u542f\u52a8\u8354\u679d\u6d3e\uff0c\u8fdb\u5165<code>\/dev\/<\/code>\u76ee\u5f55\uff0c\u786e\u8ba4input\u6587\u4ef6\u5939\u7684\u5b58\u5728\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<code>ts_calibrate<\/code>\u6216\u8005\u76f4\u63a5dump<code>input\/event0<\/code>\u6587\u4ef6\u6765\u786e\u8ba4\u89e6\u6478\u5c4f\u5df2\u7ecf\u751f\u6548\u3002<\/p>\n<p>&emsp;&emsp;\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u8354\u679d\u6d3e\u7684\u677f\u5b50\u4e0a\u6ca1\u6709\u4e0a\u62c9\u7535\u963b\uff0c\u6240\u4ee5\u9700\u8981\u5355\u72ec\u5916\u63a5\u4e0a\u62c9\u7535\u963b\u3002\u5bf9\u4e8eI2C\u6765\u8bf4\uff0c\u63a5\u7684\u7535\u963b1k-2k\u5de6\u53f3\uff1b\u4e2d\u65ad\u9700\u8981\u5916\u63a510k\u7535\u963b\u3002<\/p>\n<img loading=\"lazy\" decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/cdn.swordofmorning.com\/SwordofMorning\/Article%20Images\/LicheepiNano\/03\/1.JPG\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  width=\"4032\" height=\"3024\" alt=\"\u56fe1\" class=\"size-full\" \/ >\n<img loading=\"lazy\" decoding=\"async\"   class=\"lazyload\" data-src=\"https:\/\/cdn.swordofmorning.com\/SwordofMorning\/Article%20Images\/LicheepiNano\/03\/2.JPG\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/moezx\/cdn@3.0.2\/img\/svg\/loader\/trans.ajax-spinner-preloader.svg\" onerror=\"imgError(this)\"  width=\"4032\" height=\"3024\" alt=\"\u56fe2\" class=\"size-full\" \/ >\n<h2 >\u4e09\u3001LVGL\u7684\u79fb\u690d<\/h2>\n<p>&emsp;&emsp;LVGL\u4f7f\u7528<a href = \"https:\/\/github.com\/lvgl\/lv_port_linux_frame_buffer\">lv_port_linux_frame_buffer<\/a>\u7248\u672c\uff0c\u8fd9\u91cc\u6211\u7a0d\u4f5c\u4fee\u6539\uff0c\u4f7f\u7528Cmake\u6765\u7ba1\u7406\u9879\u76ee\uff0c\u5177\u4f53\u5185\u5bb9\u5982\u4e0b\u3002<\/p>\n<pre><code class='language-shell' lang='shell'>.\n\u251c\u2500\u2500 CMakeLists.txt\n\u251c\u2500\u2500 lv_conf.h\n\u251c\u2500\u2500 lv_drivers\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 CMakeLists.txt\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 display\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 docs\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 gtkdrv\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 indev\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 library.json\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 LICENSE\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 lv_drivers.mk\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 lv_drv_conf_template.h\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 README.md\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 sdl\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 wayland\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 win32drv\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 win_drv.c\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 win_drv.h\n\u251c\u2500\u2500 lv_drv_conf.h\n\u251c\u2500\u2500 lvgl\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 CMakeLists.txt\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 component.mk\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 env_support\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 idf_component.yml\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 Kconfig\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 library.json\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 library.properties\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 LICENCE.txt\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 lv_conf_template.h\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 lvgl.h\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 lvgl.mk\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 README.md\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 README_pt_BR.md\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 README_zh.md\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 SConscript\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 scripts\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 src\n\u251c\u2500\u2500 main.c\n\u2514\u2500\u2500 mouse_cursor_icon.c\n<\/code><\/pre>\n<p>&emsp;&emsp;\u8fd9\u91cc\u9700\u8981\u81ea\u884c\u66f4\u6539\u4e00\u4e9b\u914d\u7f6e\u53c2\u6570\uff0cevdev\u5728<code>lv_drv_conf.h<\/code>\u4e2d\u914d\u7f6e\uff0c\u5c4f\u5e55\u5206\u8fa8\u7387\u3001\u7f13\u5b58\u5927\u5c0f\u7b49\u5728main.c\u5f53\u4e2d\u8bbe\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&emsp;&emsp;\u5728\u672c\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5bf9Nano\u6dfb\u52a0GT911\u89e6\u6478\u5c4f\u9002\u914d\uff0c\u4ee5\u53caLVGL\u7684\u79fb\u690d\u3002 \u4e00\u3001\u4fee\u6539\u8bbe\u5907\u6811 &#038;ems &#8230","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[242],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/875"}],"collection":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/comments?post=875"}],"version-history":[{"count":2,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/875\/revisions"}],"predecessor-version":[{"id":877,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/posts\/875\/revisions\/877"}],"wp:attachment":[{"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/media?parent=875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/categories?post=875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swordofmorning.com\/index.php\/wp-json\/wp\/v2\/tags?post=875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}