MTK Android Driver :Key

 MTK Android Driver :Key

1.按键配置(根据原理图):DCT(Driver Customization Tool):

..\mediatek\custom\prj\kernel\dct\dct\codegen.dws

..\mediatek\source\dct\DrvGen.exe

客制化:按键定义表、de-bounce time 、Power key Eint Gpio、DownLoadKey、|Mode Key、Factory Key、Recovery Key

 

2.factory mode工厂模式按键定义

..\mediatek\custom\k6\factory\inc\cust_keys.h

 

//工厂按键测试映射表,自动生成,在.dws中配置按键映射表

\alps\mediatek\custom\prj\kernel\dct\dct\cust_kpd.h

#defineKEYS_PWRKEY_MAP            { KEY_POWER,"Power" }

#defineDEFINE_KEYS_KEYMAP(x)             \

struct key x[] = {                       \

         KEYS_PWRKEY_MAP,             \

         { KEY_HOME,       "Home" },        \

         { KEY_MENU,       "Menu" },         \

         { KEY_HOMEPAGE,   "HomePage" },          \

}

 

//工厂模式按键定义

#define CUST_KEY_UP                KEY_UP

#defineCUST_KEY_VOLUP                KEY_PAGEUP       // KEY_VOLUMEUP

#defineCUST_KEY_DOWN                 KEY_DOWN

#defineCUST_KEY_VOLDOWN KEY_VOLUMEDOWN     // KEY_VOLUMEDOWN

#defineCUST_KEY_LEFT                   KEY_MENU

#defineCUST_KEY_CENTER              KEY_HOMEPAGE

#defineCUST_KEY_RIGHT                 KEY_BACK

 

#defineCUST_KEY_CONFIRM  KEY_VOLUMEUP // KEY_HOME

#defineCUST_KEY_BACK                 KEY_POWER

 

3.recovery mode恢复模式按键定义

\mediatek\custom\prj\recovery\inc\cust_keys.h

#defineRECOVERY_KEY_DOWN     KEY_VOLUMEDOWN

#defineRECOVERY_KEY_UP       KEY_VOLUMEDOWN

#defineRECOVERY_KEY_ENTER    KEY_VOLUMEUP

#define RECOVERY_KEY_MENU     KEY_POWER

 

4. home键配置(直接引出的,不需要在.dws中定义按键映射)

\alps\mediatek\custom\prj\kernel\kpd\kpd\mtk_kpd.h

#defineKPD_PMIC_RSTKEY_MAP KEY_HOME

 

home键添加唤醒功能

\alps\mediatek\config\prj\mtk-kpd.kl

key 102   HOME           WAKE

posted on 2015-10-12 09:59  相伴流年  阅读(1522)  评论(0编辑  收藏  举报

导航