當前位置:編程學習大全網 - 編程軟體 - android USB OTG功能怎麽打開及實現

android USB OTG功能怎麽打開及實現

[Description]

USB OTG功能如何打開及實現

[Keyword]

USB OTG U盤 Keyboard Mouse

[Solution]

1、檢查HW原理圖,確認是否支持OTG功能(vbus是否供上電,IDDIG pin連接是否正確)

2、若HW確認支持OTG功能,則按照以下方法分別打開USB OTG功能及實現掛載:

如何打開USB OTG功能: 在alps/mediatek/config/{project}/autoconfig/kconfig/project中打開CONFIG_USB_MTK_OTG和CONFIG_USB_MTK_HDRC_HCD CONFIG_USB_MTK_OTG =y CONFIG_USB_MTK_HDRC_HCD = y 在dws中設定OTG VBUS對應的輸出控制pin配置為GPIO模式,var name為GPIO_OTG_DRVVBUS_PIN。再設定IDDIG pin默認模式為IDDIG,var name為GPIO_OTG_IDDIG_EINT_PIN

如何實現掛載: init.project.rc起始位置處添加如下內容

on early-init

mkdir /mnt/usbotg 0000 system system vold.fstab末尾添加如下壹行

dev_mount usbotg /mnt/usbotg auto /devices/platform/mt_usb storage_list.xml添加如下壹個xml節點

android:storageDescription=@string/storage_external_usb

android:removable=true

android:primary=false /> 備註:需要根據ProjectConfig.mk中的resource_overlay_support的值來修改對應路徑的storage_list.xml文件: RESOURCE_OVERLAY_SUPPORT的值為generic==>> alps/mediatek/custom/{project}/resource_overlay/generic/frameworks/base/core/res/res/xml/storage_list.xml RESOURCE_OVERLAY_SUPPORT的值為空 ==>> framework/base/core/res/res/xml/storage_list.xml 對於82平臺,resource_overlay_support的值可配置為sd_in_ex_otg、sd_ex_otg,則無需再修改對應路徑的storage_list.xml文件

[Attention]

目前USB OTG功能只支持U盤(壹個FAT分區)、Keyboard、Mouse、PTP device

  • 上一篇:深圳市各中學的社團
  • 下一篇:兒童節目拍攝計數器
  • copyright 2024編程學習大全網