本文主要是介绍rk3288 外部EINT 中断问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
驱动OK
硬件触发方式为稳定的“上升沿触发 ”__| ̄ ̄ "
2# code
//static irqreturn_t eint_isr1(struct eint_keypad *eint_ddata)
static irqreturn_t eint_isr1(int irq, void *dev_id)
{struct eint_keypad *eint_ddata = (struct eint_keypad*)dev_id;printk("jiangdou....irq == gpio_one\n");input_event(eint_ddata->input, EV_KEY, EINT_GPIO1, 1);input_sync(eint_ddata->input);input_event(eint_ddata->input, EV_KEY, EINT_GPIO1, 0);input_sync(eint_ddata->input);return 0;}
//static irqreturn_t eint_isr2(struct eint_keypad *eint_ddata)
static irqreturn_t eint_isr2(int irq, void *dev_id)
{struct eint_keypad *eint_ddata = (struct eint_keypad*)dev_id;printk("jiangdou....irq == gpio_two\n");input_event(eint_ddata->input, EV_KEY, EINT_GPIO2, 1);input_sync(eint_ddata->input);input_event(eint_ddata->input, EV_KEY, EINT_GPIO2, 0);input_sync(eint_ddata->input);return 0;}
root@rk3288:/ # getevent -l
add device 1: /dev/input/event3
name: "USB OPTICAL MOUSE "
add device 2: /dev/input/event0
name: "eint-gpio.34"
add device 3: /dev/input/event2
name: "rk29-keypad"
add device 4: /dev/input/event1
name: "rkxx-remotectl.33"
root@rk3288:/ #
include/uapi/linux/input.h:477:#define EINT_GPIO1 249 /* add by jiangdou */
include/uapi/linux/input.h:478:#define EINT_GPIO2 250 /* add by jiangdou */
4#
/dev/input/event0
事件读取问题,,请参考其他共性问题!!!
5## android
/* add by jiangdou for KEY_F2 into POWERDOWN 20150827. start{{------------ */} else if((keyCode == KeyEvent.KEYCODE_DOU) &&!down){try {Intent intenta = new Intent("android.intent.action.ACTION_REQUEST_SHUTDOWN");intenta.putExtra("android.intent.extra.KEY_CONFIRM", false);intenta.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);mContext.startActivity(intenta);} catch (Exception e) {e.printStackTrace();}/* add by jiangdou for KEY_F2 into POWERDOWN 20150827. end ------------}} */vi vi frameworks/base/data/keyboards/Generic.kl# add by jiangdou
key 251 DOU
key 249 GINT1
key 250 GINT2vi vi frameworks/base/data/keyboards/qwerty.kl
# add by jiangdou
#key 59 F1
key 251 DOU
key 249 GINT1
key 250 GINT2
key 63 F5vi frameworks/base/core/res/res/values/attrs.xml<!-- add by jiangdou for IR --><enum name="KEYCODE_DOU" value="251" /><enum name="KEYCODE_GINT1" value="249" /><enum name="KEYCODE_GINT2" value="250" /><enum name="KEYCODE_F1" value="131" />vi frameworks/native/include/android/keycodes.hAKEYCODE_F1 = 131,AKEYCODE_DOU = 251, /*add by jiangdou for IR*/AKEYCODE_GINT1 = 249, /*add by jiangdou for GINT1*/AKEYCODE_GINT2 = 250, /*add by jiangdou for GINT2*/vi frameworks/base/core/java/android/view/KeyEvent.java/* add by jiangdou for IR */public static final int KEYCODE_DOU = 251;/* add by jiangdou for GINT1 */public static final int KEYCODE_GINT1 = 249;/* add by jiangdou for GINT2 */public static final int KEYCODE_GINT2 = 250;.....(..)names.append(KEYCODE_F1, "KEYCODE_F1");names.append(KEYCODE_DOU, "KEYCODE_DOU");names.append(KEYCODE_DOU, "KEYCODE_GINT1");names.append(KEYCODE_DOU, "KEYCODE_GINT2");vi frameworks/native/libs/input/Input.cppcase AKEYCODE_DOU:case AKEYCODE_GINT1:case AKEYCODE_GINT2:vi frameworks/base/api/current.txtfield public static final int KEYCODE_F = 34; // 0x22field public static final int KEYCODE_DOU = 251; //add by jiangdou for IRfield public static final int KEYCODE_GINT1 = 249; //add by jiangdou for GINT1field public static final int KEYCODE_GINT2 = 250; //add by jiangdou for GINT2
6###
vi frameworks/native/include/input/KeycodeLabels.h
// NOTE: If you add a new keycode here you must also add it to several other files.
// Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
{"DOU", 251}, /* add by jiangdou for IR */
{"GINTA", 249}, /* add by jiangdou for GINTA */
{"GINTB", 250}, /* add by jiangdou for GINTB */
{ NULL, 0 }
};
6###
//for test EINTpublic boolean onKeyDown(int keyCode, KeyEvent event){switch (keyCode){case KeyEvent.KEYCODE_TV_INPUT_COMPONENT_1: //for KEY_GINTA//DisplayToast("RK3288_外部中断_SP1DI,EINT1");Log.e(MainActivity.ACTIVITY_TAG, "RK3288_外部中断_SP1DI,EINT1.............."); break;case KeyEvent.KEYCODE_TV_INPUT_COMPONENT_2: //for KEY_GINTB//DisplayToast("RK3288_外部中断_SP1DO,EINT2");Log.e(MainActivity.ACTIVITY_TAG, "RK3288_外部中断_SP1DO,EINT2..............");break; default:break;}return super.onKeyDown(keyCode, event);}
7###xx
12-12 05:54:08.310: V/Zygote(2055): Switching descriptor 34 to /dev/null
12-12 05:54:08.310: V/Zygote(2055): Switching descriptor 11 to /dev/null
12-12 05:54:08.310: D/dalvikvm(2055): Late-enabling CheckJNI
12-12 05:54:08.330: E/jdwp(2055): Failed sending reply to debugger: Broken pipe
12-12 05:54:08.330: D/dalvikvm(2055): Debugger has detached; object registry had 1 entries
12-12 05:54:08.430: I/MaliGPU(2055): mali_so with ver '8@0', built at '15:33:21', on 'Nov 10 2014'.
12-12 05:54:08.440: D/mali_winsys(2055): new_window_surface returns 0x3000
12-12 05:54:08.470: D/OpenGLRenderer(2055): Enabling debug mode 0
12-12 05:54:10.400: D/keymatch(2055): jiangdou rk3288_gpio out high : set gpio236 value:1
12-12 05:54:10.400: D/keymatch(2055): rk3288gpio_output for set GPIO:236 to value:1
12-12 05:54:11.400: D/keymatch(2055): write rk3288 :/sys/class/gpio/gpio236/value to value:1 fail...
12-12 05:54:11.410: I/Choreographer(2055): Skipped 59 frames! The application may be doing too much work on its main thread.
12-12 05:54:11.420: E/GpioDemo(2055): RK3288_外部中断_SP1DI,EINT1..............
12-12 05:54:13.110: D/keymatch(2055): jiangdou rk3288_gpio out low : set gpio236 value:0
12-12 05:54:13.110: D/keymatch(2055): rk3288gpio_output for set GPIO:236 to value:0
12-12 05:54:14.120: D/keymatch(2055): write rk3288 :/sys/class/gpio/gpio236/value to value:0 fail...
12-12 05:54:14.130: I/Choreographer(2055): Skipped 60 frames! The application may be doing too much work on its main thread.
12-12 05:54:24.030: D/keymatch(2055): jiangdou rk3288_gpio out high : set gpio236 value:1
12-12 05:54:24.030: D/keymatch(2055): rk3288gpio_output for set GPIO:236 to value:1
12-12 05:54:25.030: D/keymatch(2055): write rk3288 :/sys/class/gpio/gpio236/value to value:1 fail...
12-12 05:54:25.040: I/Choreographer(2055): Skipped 59 frames! The application may be doing too much work on its main thread.
12-12 05:54:25.050: E/GpioDemo(2055): RK3288_外部中断_SP1DI,EINT1..............
12-12 05:54:26.380: D/keymatch(2055): jiangdou rk3288_gpio out low : set gpio236 value:0
12-12 05:54:26.380: D/keymatch(2055): rk3288gpio_output for set GPIO:236 to value:0
12-12 05:54:27.380: D/keymatch(2055): write rk3288 :/sys/class/gpio/gpio236/value to value:0 fail...
12-12 05:54:27.400: I/Choreographer(2055): Skipped 60 frames! The application may be doing too much work on its main thread.
12-12 05:54:29.260: D/keymatch(2055): jiangdou rk3288_gpio out high : set gpio236 value:1
12-12 05:54:29.260: D/keymatch(2055): rk3288gpio_output for set GPIO:236 to value:1
12-12 05:54:30.270: D/keymatch(2055): write rk3288 :/sys/class/gpio/gpio236/value to value:1 fail...
12-12 05:54:30.270: I/Choreographer(2055): Skipped 60 frames! The application may be doing too much work on its main thread.
12-12 05:54:30.280: E/GpioDemo(2055): RK3288_外部中断_SP1DI,EINT1..............
xx
RK3288_BOX_SDK问题
root@rk3288:/ # cat /proc/bus/input/devices
cat /proc/bus/input/devices
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="ff680000.pwm"
P: Phys=gpio-keys/input11
S: Sysfs=/devices/ff680000.pwm/input/input0
U: Uniq=
H: Handlers=event0 ddr_freq keychord
B: PROP=0
B: EV=3
B: KEY=70010 200000 0 0 0 9000100 2000000 6800000 40008800 1e16c0 0 8000000 10000ffc
I: Bus=0003 Vendor=1a2c Product=2124 Version=0110
N: Name="SEM USB Keyboard"
P: Phys=usb-ff540000.usb-1.3/input0
S: Sysfs=/devices/ff540000.usb/usb3/3-1/3-1.3/3-1.3:1.0/input/input1
U: Uniq=
H: Handlers=sysrq event1 ddr_freq keychord
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff800000 7ff febeffdf f3cfffff ffffffff fffffffe
B: MSC=10
B: LED=7
I: Bus=0003 Vendor=1a2c Product=2124 Version=0110
N: Name="SEM USB Keyboard"
P: Phys=usb-ff540000.usb-1.3/input1
S: Sysfs=/devices/ff540000.usb/usb3/3-1/3-1.3/3-1.3:1.1/input/input2
U: Uniq=
H: Handlers=event2 ddr_freq keychord
B: PROP=0
B: EV=1f
B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 120c13 b17c000 267bfa d941dfed 9e1680 4400 0 10000002
B: REL=40
B: ABS=1 0
B: MSC=10
root@rk3288:/ # getevent -l
getevent -l
add device 1: /dev/input/event2
name: "SEM USB Keyboard"
add device 2: /dev/input/event1
name: "SEM USB Keyboard"
add device 3: /dev/input/event0
name: "ff680000.pwm"
^C
C:\Users\jiangdou>adb shell
vi frameworks/base/data/keyboards/Vendor_0001_Product_0001.kl /* add this file OK for IR */
这篇关于rk3288 外部EINT 中断问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!