VIM4板子默认没有红外接收头,如果需要有红外遥控器支持的话,硬件上需要从40PIN排针扩展输出,另外软件上需要配置。
硬件连接
IR_IN
(红外接收信号)是40PIN排针上的39管脚 GPIOD_15
:
软件配置
- 在
common/arch/arm64/boot/dts/amlogic/meson-ir-map.dtsi
文件中增加遥控器配置:
1 | --- a/arch/arm64/boot/dts/amlogic/meson-ir-map.dtsi |
- 增加Android Key Layout(kl)文件:
kl文件的ID号需要和dtsi文件配置的ID号保持一致, 如前面步骤增加的ID号(as vendor=0x0003, product=0x0003)
1
2+ vendor = <0x0003>;
+ product = <0x0003>;新增Key Layout(kl)文件:
device/khadas/common/keyboards/Vendor_xxxx_Product_xxxx.kl
(as Vendor_0003_Product_0003.kl)1
$ vim device/khadas/kVIM4/files/Vendor_0003_Product_0003.kl
1
2
3
4
5
6
7
8
9
10
11
12key 116 POWER
key 139 MENU
key 103 DPAD_UP
key 108 DPAD_DOWN
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 232 DPAD_CENTER
key 114 VOLUME_DOWN
key 63 F5
key 115 VOLUME_UP
key 158 BACK
key 102 HOME查看是否匹配成功
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25kvim4:/ # dumpsys input
INPUT MANAGER (dumpsys input)
Input Manager State:
Interactive: true
System UI Visibility: 0x8708
Pointer Speed: 0
Pointer Gestures Enabled: true
Show Touches: false
Pointer Capture Enabled: false
......
8: ir_keypad
Classes: 0x00000029
Path: /dev/input/event6
Enabled: true
Descriptor: a6893ab22828f3b8b792fe40bc0d6df2b2725f26
Location: keypad/input0
ControllerNumber: 0
UniqueId:
Identifier: bus=0x0010, vendor=0x0003, product=0x0003, version=0x0300
KeyLayoutFile: /vendor/usr/keylayout/Vendor_0003_Product_0003.kl
KeyCharacterMapFile: /system/usr/keychars/Generic.kcm
ConfigurationFile:
HaveKeyboardLayoutOverlay: false
VideoDevice: <none>如上所示,当
KeyLayoutFile:
字符后面是添加的kl文件Vendor_0003_Product_0003.kl
,说明匹配成功。