当前位置: 首页 > news >正文

青岛官网建站wordpress更改后台路径

青岛官网建站,wordpress更改后台路径,石狮网站建设公司哪家好,人人建站前言 V3s 带有一个 USB 接口,将其设置为 HOST 或 OTG 模式,这样可以用来接入键盘、鼠标等 USB 外设。 USB 简介 USB 有两种设备:HOST 和 USB 功能设备。 在 USB2.0 中又引入了一个新的概念 OTG,即设备角色可以动态切换。 切换方…

前言

V3s 带有一个 USB 接口,将其设置为 HOST 或 OTG 模式,这样可以用来接入键盘、鼠标等 USB 外设。

USB 简介

USB 有两种设备:HOST 和 USB 功能设备。
在 USB2.0 中又引入了一个新的概念 OTG,即设备角色可以动态切换。
切换方式一:硬件
使用 USB_ID 引脚,默认上拉,处于 device 状态。
如果需要 OTG 控制器进入 HOST 状态,需要外接的 USB 口将 USB_ID 短接到地。
切换方式二:设备树
设备树直接配置

&usb_otg {dr_mode = "otg"; /* 三个可选项: otg / host / peripheral */status = "okay";
};

切换方式三:手动修改 /sys
进入 Linux 系统,执行,usb 将会被设置成为 host 模式

echo host > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode

我们使用硬件方式切换

硬件

USB 电路简单,只有两根线 D+、D-,器件也简单,就一个 USB 母座,甚至连电阻电容都不需要,其它外设如果也能像 USB 这样就好了。😊😊😊
焊接就很简单了,就一个 USB 母座,我使用的是 Type C 母座
请添加图片描述

设备树

arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts


/ {soc {// 增加 ehci0 (usb2.0)、ohci0 (usb1.1) 这两个节点ehci0: usb@01c1a000 {compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci";reg = <0x01c1a000 0x100>;interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;status = "okay";};ohci0: usb@01c1a400 {compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci";reg = <0x01c1a400 0x100>;interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,<&ccu CLK_USB_OHCI0>;resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;status = "okay";};};
};&usb_otg {dr_mode = "otg";status = "okay";
};&usbphy {usb0_id_det-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;status = "okay";
};

调试

# lsusb 
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001

插入键盘

# 
[   64.047789] usb 2-1: USB disconnect, device number 2
[   69.109743] usb 2-1: new full-speed USB device number 3 using ohci-platform
[   69.410757] usbhid 2-1:1.0: can't add hid device: -71
[   69.417442] usbhid: probe of 2-1:1.0 failed with error -71
[   69.438942] input: Gaming KB  System Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0001/input/input1
[   69.520323] input: Gaming KB  Consumer Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0001/input/input2
[   69.536532] input: Gaming KB  Keyboard as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0001/input/input3
[   69.558009] hid-generic 0003:258A:1006.0001: input: USB HID v1.11 Keyboard [Gaming KB ] on usb-1c1a400.usb-1/input1
[   71.259791] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   73.019839] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   74.999799] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   76.809912] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   77.469746] usb 2-1: device not accepting address 3, error -62
[   77.679753] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   79.639774] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   81.230445] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   83.079769] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   85.079781] usb 2-1: reset full-speed USB device number 3 using ohci-platform
[   85.354764] usb 2-1: device descriptor read/all, error -71
[   85.569730] usb 2-1: reset full-speed USB device number 3 using ohci-platform

报错 usb 2-1: device descriptor read/all, error -71
拔插一次

# 
[  207.536060] usb 2-1: USB disconnect, device number 3
[  210.899724] usb 2-1: new full-speed USB device number 4 using ohci-platform
[  211.196755] usbhid 2-1:1.0: can't add hid device: -62
[  211.203540] usbhid: probe of 2-1:1.0 failed with error -62
[  211.231919] input: Gaming KB  Gaming KB  System Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0002/input/input4
[  211.310302] input: Gaming KB  Gaming KB  Consumer Control as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0002/input/input5
[  211.327496] input: Gaming KB  Gaming KB  Keyboard as /devices/platform/soc/1c1a400.usb/usb2/2-1/2-1:1.1/0003:258A:1006.0002/input/input6
[  211.359852] hid-generic 0003:258A:1006.0002: input: USB HID v1.11 Keyboard [Gaming KB  Gaming KB ] on usb-1c1a400.usb-1/input1

还是报错 usbhid: probe of 2-1:1.0 failed with error -62

# ls /dev/input/ -lh
total 0      
crw-------    1 root     root       13,  64 Jan  1 00:00 event0
crw-------    1 root     root       13,  65 Jan  1 00:03 event1 // 键盘
crw-------    1 root     root       13,  66 Jan  1 00:03 event2 // 键盘
crw-------    1 root     root       13,  67 Jan  1 00:03 event3 // 键盘

/dev/input 目录下虽然产生了键盘对应的 event 设备,但是监听这些设备,按下键盘,没有任何反应

# hexdump /dev/input/event1# hexdump /dev/input/event2# hexdump /dev/input/event3

起初怀疑是供电不足,于是使用一个电源适配器专门给 HUB 供电,还是报错。
又怀疑是 1 拖 4 的 USB HUB 质量不好,或者耗电太大,于是又买了个 1 拖 1 的 USB HUB(其实不能算是 HUB,应该只能算是 Type C 转 Type A 转换器),结果还是报错。
还怀疑是 USB_ID 引脚没有下拉,于是飞线到 GND 进行下拉,还是报错。
就这样调试了两天未果,最终从《USB 为什么一般选择48MHz》 这篇文章中找到了线索,

USB 的系统时钟需要时 bitrate 的 4 倍, 如低速 USB,传输速率是 1.5Mbps, 系统时钟需要选择为1.5*4 == 6Mhz,全速 usb 12MHz * 4 == 48Mhz

想到我使用的晶振是 26MHz,不是 4 的整数倍,难道是这个原因?
将晶振从 26MHz 换成了 24MHz,相应地,uboot 和 kernel dts 也修改成 24MHz,上电测试竟然还真的正常了。

测试

插入 USB HUB
请添加图片描述

# 
[  290.679671] usb 1-1: new high-speed USB device number 2 using ehci-platform
[  290.881127] hub 1-1:1.0: USB hub found
[  290.886219] hub 1-1:1.0: 4 ports detected# lsusb 
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 1a40:0101 // USB HUB
Bus 002 Device 001: ID 1d6b:0001

插入键盘

# 
[  587.679662] usb 1-1.1: new full-speed USB device number 3 using ehci-platform
[  587.936322] input: Gaming KB  Gaming KB  as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.0/0003:258A:1006.0001/input/input1
[  588.020368] hid-generic 0003:258A:1006.0001: input: USB HID v1.11 Keyboard [Gaming KB  Gaming KB ] on usb-1c1a000.usb-1.1/input0
[  588.049607] input: Gaming KB  Gaming KB  System Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:258A:1006.0002/input/input2
[  588.130279] input: Gaming KB  Gaming KB  Consumer Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:258A:1006.0002/input/input3
[  588.147663] input: Gaming KB  Gaming KB  Keyboard as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.1/1-1.1:1.1/0003:258A:1006.0002/input/input4
[  588.170084] hid-generic 0003:258A:1006.0002: input: USB HID v1.11 Keyboard [Gaming KB  Gaming KB ] on usb-1c1a000.usb-1.1/input1# lsusb 
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 258a:1006 // 键盘
Bus 001 Device 002: ID 1a40:0101
Bus 002 Device 001: ID 1d6b:0001# ls /dev/input/ -lh
total 0      
crw-------    1 root     root       13,  64 Jan  1 00:00 event0
crw-------    1 root     root       13,  65 Jan  1 02:04 event1 // 键盘
crw-------    1 root     root       13,  66 Jan  1 02:04 event2 // 键盘
crw-------    1 root     root       13,  67 Jan  1 02:04 event3 // 键盘
crw-------    1 root     root       13,  68 Jan  1 02:04 event4 // 键盘

监听键盘按键

# hexdump /dev/input/event1
0000000 1dbd 0000 9338 0007 0004 0004 000b 0007
0000010 1dbd 0000 9338 0007 0001 0023 0001 0000
0000020 1dbd 0000 9338 0007 0000 0000 0000 0000
0000030 1dbd 0000 eaec 0008 0004 0004 000b 0007
0000040 1dbd 0000 eaec 0008 0001 0023 0000 0000
0000050 1dbd 0000 eaec 0008 0000 0000 0000 0000
0000060 1dbe 0000 01b8 0000 0004 0004 0009 0007
0000070 1dbe 0000 01b8 0000 0001 0021 0001 0000
0000080 1dbe 0000 01b8 0000 0000 0000 0000 0000
0000090 1dbe 0000 1ae3 0001 0004 0004 0009 0007
00000a0 1dbe 0000 1ae3 0001 0001 0021 0000 0000
00000b0 1dbe 0000 1ae3 0001 0000 0000 0000 0000
00000c0 1dbe 0000 d8e5 000b 0004 0004 0015 0007
00000d0 1dbe 0000 d8e5 000b 0001 0013 0001 0000
00000e0 1dbe 0000 d8e5 000b 0000 0000 0000 0000
00000f0 1dbe 0000 8e63 000d 0004 0004 0015 0007
0000100 1dbe 0000 8e63 000d 0001 0013 0000 0000
0000110 1dbe 0000 8e63 000d 0000 0000 0000 0000

插入鼠标

# 
[  806.739667] usb 1-1.4: new full-speed USB device number 4 using ehci-platform
[  806.996984] input: Logitech G102 Prodigy Gaming Mouse as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C084.0003/input/input5
[  807.022588] hid-generic 0003:046D:C084.0003: input: USB HID v1.11 Mouse [Logitech G102 Prodigy Gaming Mouse] on usb-1c1a000.usb-1.4/input0
[  807.067548] input: Logitech G102 Prodigy Gaming Mouse Keyboard as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C084.0004/input/input6
[  807.150288] input: Logitech G102 Prodigy Gaming Mouse Consumer Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C084.0004/input/input7
[  807.168723] input: Logitech G102 Prodigy Gaming Mouse System Control as /devices/platform/soc/1c1a000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C084.0004/input/input8
[  807.193232] hid-generic 0003:046D:C084.0004: input: USB HID v1.11 Keyboard [Logitech G102 Prodigy Gaming Mouse] on usb-1c1a000.usb-1.4/input1# lsusb 
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 258a:1006
Bus 001 Device 002: ID 1a40:0101
Bus 002 Device 001: ID 1d6b:0001
Bus 001 Device 004: ID 046d:c084 // 鼠标# ls /dev/input/ -lh
total 0      
crw-------    1 root     root       13,  64 Jan  1 00:00 event0
crw-------    1 root     root       13,  65 Jan  1 02:04 event1
crw-------    1 root     root       13,  66 Jan  1 02:04 event2
crw-------    1 root     root       13,  67 Jan  1 02:04 event3
crw-------    1 root     root       13,  68 Jan  1 02:04 event4
crw-------    1 root     root       13,  69 Jan  1 02:08 event5 // 鼠标
crw-------    1 root     root       13,  70 Jan  1 02:08 event6 // 鼠标
crw-------    1 root     root       13,  71 Jan  1 02:08 event7 // 鼠标
crw-------    1 root     root       13,  72 Jan  1 02:08 event8 // 鼠标

监听鼠标移动、点击

# hexdump /dev/input/event5
0000000 1e91 0000 9be6 000e 0002 0000 0001 0000
0000010 1e91 0000 9be6 000e 0000 0000 0000 0000
0000020 1e91 0000 befd 000e 0002 0000 0001 0000
0000030 1e91 0000 befd 000e 0000 0000 0000 0000
0000040 1e91 0000 caa5 000e 0002 0001 0001 0000
0000050 1e91 0000 caa5 000e 0000 0000 0000 0000
0000060 1e92 0000 3dfc 0001 0002 0000 0001 0000
0000070 1e92 0000 3dfc 0001 0000 0000 0000 0000
0000080 1e93 0000 cb9d 0008 0002 0000 0001 0000
0000090 1e93 0000 cb9d 0008 0000 0000 0000 0000
00000a0 1e93 0000 15c0 0009 0002 0000 0001 0000
00000b0 1e93 0000 15c0 0009 0000 0000 0000 0000
00000c0 1e93 0000 f24a 000a 0002 0000 0001 0000
00000d0 1e93 0000 f24a 000a 0000 0000 0000 0000
00000e0 1e93 0000 1950 000b 0002 0000 0001 0000
00000f0 1e93 0000 1950 000b 0000 0000 0000 0000
0000100 1e93 0000 3c95 000b 0002 0000 0001 0000
0000110 1e93 0000 3c95 000b 0000 0000 0000 0000
0000120 1e93 0000 5bc9 000b 0002 0000 0001 0000
0000130 1e93 0000 5bc9 000b 0000 0000 0000 0000
0000140 1e93 0000 7afe 000b 0002 0000 0001 0000
0000150 1e93 0000 7afe 000b 0000 0000 0000 0000
0000160 1e96 0000 5793 0000 0004 0004 0001 0009
0000170 1e96 0000 5793 0000 0001 0110 0001 0000
0000180 1e96 0000 5793 0000 0000 0000 0000 0000
0000190 1e96 0000 3fd6 0002 0004 0004 0001 0009
00001a0 1e96 0000 3fd6 0002 0001 0110 0000 0000
00001b0 1e96 0000 3fd6 0002 0000 0000 0000 0000
00001c0 1e96 0000 e13b 0007 0004 0004 0002 0009
00001d0 1e96 0000 e13b 0007 0001 0111 0001 0000
00001e0 1e96 0000 e13b 0007 0000 0000 0000 0000
00001f0 1e96 0000 d35f 0008 0004 0004 0002 0009
0000200 1e96 0000 d35f 0008 0001 0111 0000 0000
0000210 1e96 0000 d35f 0008 0000 0000 0000 0000
0000220 1e96 0000 3cce 0009 0004 0004 0002 0009
0000230 1e96 0000 3cce 0009 0001 0111 0001 0000
0000240 1e96 0000 3cce 0009 0000 0000 0000 0000
0000250 1e96 0000 ae11 0009 0004 0004 0002 0009
0000260 1e96 0000 ae11 0009 0001 0111 0000 0000
0000270 1e96 0000 ae11 0009 0000 0000 0000 0000

至此,USB 调试 OK

http://www.yayakq.cn/news/445282/

相关文章:

  • 哪个网站可以做私单网站模板带后台下载
  • 企业门户网站建设公司乌克兰武装部队最新战报
  • wordpress 登陆后返回北京企业网站优化
  • php网站建设基本流程网站接入查询
  • 服装网站建设开发语言网络培训方案
  • 怎么在网上做装修网站汕头网站建设推广费用
  • 图片比较多的网站怎么做厦门网络推广哪家强
  • 建设网站赚钱网站 刷流量 SEO
  • 百度站内搜索 wordpresswordpress+移动客户端
  • 温州市手机网站制作哪家好iis架设jsp网站
  • 可以做哪方面的网站市场营销ppt模板
  • 黑色大气网站源码重庆市建设工程信息网 安全监督
  • 网站地址搜索asp.net 3.5网站开发实例教程
  • 腾讯云注册域名后怎么做网站哪些网站可以接生意做
  • 宁波网站建设专业定制自建网站套现
  • 网站开发设计制作推广网站网页设计海报图片
  • 网站突然掉排名logo制作软件手机免费版
  • 网站的备案号在哪营业执照名称查询系统
  • 物流行业网站源码婚纱摄影行业网站建设
  • 龙岗网站app建设网站去哪里备案
  • 做淘宝客网站性质单位网站备案
  • 网站开发范围说明书卷帘门怎么做网站
  • 泰州网页网站制作科技网站配色方案
  • 高端网站建设策划学室内设计去哪好
  • 响应式网站空间服务器要求晋江市建设局网站
  • 开发网站的流程步骤网页制作工作网站
  • 网站空间指的是什么意思wordpress 响应
  • 做网站搜索如何显示官网旅游网页设计图片素材
  • 大厂建设局网站wordpress文章字数
  • 网站优化qq群WordPress即时群聊