- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
如何在ADB shell中读取耳机状态和读取ACCDET寄存器
录入:edatop.com 点击:
[Description]
如何在ADB shell中读取耳机状态和读取ACCDET寄存器
[Solution]
获取耳机状态
cat /sys/class/switch/h2w/state
state值为0表示heADSet plug out;
state值为1表示有MIC的耳机插入(四段式耳机);
state值为2表示没有mic的耳机插入(三段式耳机)。
读取寄存器
cd /sys/devices/platform/Accdet_Driver/driver
echo 1 >start_debug
echo1 >dump_register
这样Accdet的reg会每500ms 抓到一次寄存器值,保存在log中
MT6589参考值(仅供参考):
无耳机:
<3>[31366.722403](0)[16408:ACCDET] ACCDET_BASE + 582=1090
<3>[31366.723021](0)[16408:ACCDET] ACCDET_BASE + 584=0
<3>[31366.723606](0)[16408:ACCDET] ACCDET_BASE + 586=0
<3>[31366.724191](0)[16408:ACCDET] ACCDET_BASE + 588=8ff
<3>[31366.724799](0)[16408:ACCDET] ACCDET_BASE + 58a=1ff
<3>[31366.725406](0)[16408:ACCDET] ACCDET_BASE + 58c=81f0
<3>[31366.726025](0)[16408:ACCDET] ACCDET_BASE + 58e=800
<3>[31366.726632](0)[16408:ACCDET] ACCDET_BASE + 590=800
<3>[31366.727240](0)[16408:ACCDET] ACCDET_BASE + 592=10
<3>[31366.727836](0)[16408:ACCDET] ACCDET_BASE + 594=20
<3>[31366.728433](0)[16408:ACCDET] ACCDET_BASE + 596=333
<3>[31366.729040](0)[16408:ACCDET] ACCDET_BASE + 598=0
<3>[31366.729625](0)[16408:ACCDET] ACCDET_BASE + 59a=0
<3>[31366.730211](0)[16408:ACCDET] ACCDET_BASE + 59c=ff
<3>[31366.733668](0)[16408:ACCDET] ACCDET_BASE + 59e=20
<3>[31366.735256](0)[16408:ACCDET] ACCDET_BASE + 5a0=0
<3>[31366.735882](0)[16408:ACCDET] ACCDET_BASE + 5a2=0
<3>[31366.737017](0)[16408:ACCDET] 0x00000114 =0
<3>[31366.737537](0)[16408:ACCDET] 0x0000017E =12
<3>[31366.738068](0)[16408:ACCDET] 0x00000180 =0
<3>[31366.738588](0)[16408:ACCDET] 0x00000182 =0
<3>[31366.739109](0)[16408:ACCDET] 0x00000102 =4607
<3>[31366.739662](0)[16408:ACCDET] 0x00000104 =0
<3>[31366.740183](0)[16408:ACCDET] 0x00000106 =0
<3>[31366.742454](0)[16408:ACCDET] 0x00004000 =0
有耳机:
<3>[31595.222402](0)[16408:ACCDET] ACCDET_BASE + 582=1090
<3>[31595.223020](0)[16408:ACCDET] ACCDET_BASE + 584=1
<3>[31595.223606](0)[16408:ACCDET] ACCDET_BASE + 586=77
<3>[31595.224202](0)[16408:ACCDET] ACCDET_BASE + 588=8ff
<3>[31595.224810](0)[16408:ACCDET] ACCDET_BASE + 58a=1ff
<3>[31595.225417](0)[16408:ACCDET] ACCDET_BASE + 58c=81f0
<3>[31595.226035](0)[16408:ACCDET] ACCDET_BASE + 58e=400
<3>[31595.226643](0)[16408:ACCDET] ACCDET_BASE + 590=800
<3>[31595.227250](0)[16408:ACCDET] ACCDET_BASE + 592=10
<3>[31595.227846](0)[16408:ACCDET] ACCDET_BASE + 594=20
<3>[31595.228443](0)[16408:ACCDET] ACCDET_BASE + 596=333
<3>[31595.229050](0)[16408:ACCDET] ACCDET_BASE + 598=0
<3>[31595.229636](0)[16408:ACCDET] ACCDET_BASE + 59a=0
<3>[31595.230222](0)[16408:ACCDET] ACCDET_BASE + 59c=7055
<3>[31595.232650](0)[16408:ACCDET] ACCDET_BASE + 59e=800
<3>[31595.233258](0)[16408:ACCDET] ACCDET_BASE + 5a0=0
<3>[31595.233842](0)[16408:ACCDET] ACCDET_BASE + 5a2=0
<3>[31595.234428](0)[16408:ACCDET] 0x00000114 =0
<3>[31595.234948](0)[16408:ACCDET] 0x0000017E =16
<3>[31595.235480](0)[16408:ACCDET] 0x00000180 =0
<3>[31595.236000](0)[16408:ACCDET] 0x00000182 =0
<3>[31595.236521](0)[16408:ACCDET] 0x00000102 =607
<3>[31595.237063](0)[16408:ACCDET] 0x00000104 =0
<3>[31595.237584](0)[16408:ACCDET] 0x00000106 =0
<3>[31595.238104](0)[16408:ACCDET] 0x00004000 =0
如何在ADB shell中读取耳机状态和读取ACCDET寄存器
[Solution]
获取耳机状态
cat /sys/class/switch/h2w/state
state值为0表示heADSet plug out;
state值为1表示有MIC的耳机插入(四段式耳机);
state值为2表示没有mic的耳机插入(三段式耳机)。
读取寄存器
cd /sys/devices/platform/Accdet_Driver/driver
echo 1 >start_debug
echo1 >dump_register
这样Accdet的reg会每500ms 抓到一次寄存器值,保存在log中
MT6589参考值(仅供参考):
无耳机:
<3>[31366.722403](0)[16408:ACCDET] ACCDET_BASE + 582=1090
<3>[31366.723021](0)[16408:ACCDET] ACCDET_BASE + 584=0
<3>[31366.723606](0)[16408:ACCDET] ACCDET_BASE + 586=0
<3>[31366.724191](0)[16408:ACCDET] ACCDET_BASE + 588=8ff
<3>[31366.724799](0)[16408:ACCDET] ACCDET_BASE + 58a=1ff
<3>[31366.725406](0)[16408:ACCDET] ACCDET_BASE + 58c=81f0
<3>[31366.726025](0)[16408:ACCDET] ACCDET_BASE + 58e=800
<3>[31366.726632](0)[16408:ACCDET] ACCDET_BASE + 590=800
<3>[31366.727240](0)[16408:ACCDET] ACCDET_BASE + 592=10
<3>[31366.727836](0)[16408:ACCDET] ACCDET_BASE + 594=20
<3>[31366.728433](0)[16408:ACCDET] ACCDET_BASE + 596=333
<3>[31366.729040](0)[16408:ACCDET] ACCDET_BASE + 598=0
<3>[31366.729625](0)[16408:ACCDET] ACCDET_BASE + 59a=0
<3>[31366.730211](0)[16408:ACCDET] ACCDET_BASE + 59c=ff
<3>[31366.733668](0)[16408:ACCDET] ACCDET_BASE + 59e=20
<3>[31366.735256](0)[16408:ACCDET] ACCDET_BASE + 5a0=0
<3>[31366.735882](0)[16408:ACCDET] ACCDET_BASE + 5a2=0
<3>[31366.737017](0)[16408:ACCDET] 0x00000114 =0
<3>[31366.737537](0)[16408:ACCDET] 0x0000017E =12
<3>[31366.738068](0)[16408:ACCDET] 0x00000180 =0
<3>[31366.738588](0)[16408:ACCDET] 0x00000182 =0
<3>[31366.739109](0)[16408:ACCDET] 0x00000102 =4607
<3>[31366.739662](0)[16408:ACCDET] 0x00000104 =0
<3>[31366.740183](0)[16408:ACCDET] 0x00000106 =0
<3>[31366.742454](0)[16408:ACCDET] 0x00004000 =0
有耳机:
<3>[31595.222402](0)[16408:ACCDET] ACCDET_BASE + 582=1090
<3>[31595.223020](0)[16408:ACCDET] ACCDET_BASE + 584=1
<3>[31595.223606](0)[16408:ACCDET] ACCDET_BASE + 586=77
<3>[31595.224202](0)[16408:ACCDET] ACCDET_BASE + 588=8ff
<3>[31595.224810](0)[16408:ACCDET] ACCDET_BASE + 58a=1ff
<3>[31595.225417](0)[16408:ACCDET] ACCDET_BASE + 58c=81f0
<3>[31595.226035](0)[16408:ACCDET] ACCDET_BASE + 58e=400
<3>[31595.226643](0)[16408:ACCDET] ACCDET_BASE + 590=800
<3>[31595.227250](0)[16408:ACCDET] ACCDET_BASE + 592=10
<3>[31595.227846](0)[16408:ACCDET] ACCDET_BASE + 594=20
<3>[31595.228443](0)[16408:ACCDET] ACCDET_BASE + 596=333
<3>[31595.229050](0)[16408:ACCDET] ACCDET_BASE + 598=0
<3>[31595.229636](0)[16408:ACCDET] ACCDET_BASE + 59a=0
<3>[31595.230222](0)[16408:ACCDET] ACCDET_BASE + 59c=7055
<3>[31595.232650](0)[16408:ACCDET] ACCDET_BASE + 59e=800
<3>[31595.233258](0)[16408:ACCDET] ACCDET_BASE + 5a0=0
<3>[31595.233842](0)[16408:ACCDET] ACCDET_BASE + 5a2=0
<3>[31595.234428](0)[16408:ACCDET] 0x00000114 =0
<3>[31595.234948](0)[16408:ACCDET] 0x0000017E =16
<3>[31595.235480](0)[16408:ACCDET] 0x00000180 =0
<3>[31595.236000](0)[16408:ACCDET] 0x00000182 =0
<3>[31595.236521](0)[16408:ACCDET] 0x00000102 =607
<3>[31595.237063](0)[16408:ACCDET] 0x00000104 =0
<3>[31595.237584](0)[16408:ACCDET] 0x00000106 =0
<3>[31595.238104](0)[16408:ACCDET] 0x00004000 =0
很简短的帖子但是很实用,最近就是一直在搞这个!
申明:网友回复良莠不齐,仅供参考。如需专业帮助,请学习易迪拓培训专家讲授的ADS视频培训课程。
上一篇:ADS299DEMAO板脑电采集的问题
下一篇:ADS证书安装失败,求指点
ADS培训课程推荐详情>>
国内最全面、最专业的Agilent ADS培训课程,可以帮助您从零开始,全面系统学习ADS设计应用【More..】
- Agilent ADS教学培训课程套装
- 两周学会ADS2011、ADS2013视频教程
- ADS2012、ADS2013射频电路设计详解
- ADS高低阻抗线微带滤波器设计培训教程
- ADS混频器仿真分析实例视频培训课程
- ADS Momentum电磁仿真设计视频课程
- ADS射频电路与通信系统设计高级培训
- ADS Layout和电磁仿真设计培训视频
- ADS Workspace and Simulators Training Course
- ADS Circuit Simulation Training Course
- ADS Layout and EM Simulation Training Course
- Agilent ADS 内部原版培训教材合集