提交 116b7880 编写于 作者: T tyustli

add enable/disable interrupt command

上级 10ac5f7a
......@@ -66,8 +66,6 @@ static rt_err_t rt_touch_irq_init(rt_touch_t touch)
rt_pin_irq_enable(touch->config.irq_pin.pin, PIN_IRQ_ENABLE);
LOG_I("interrupt init success");
return RT_EOK;
}
......@@ -197,6 +195,12 @@ static rt_err_t rt_touch_control(rt_device_t dev, int cmd, void *args)
LOG_D("set y coordinate range :%d \n", touch->info.range_x);
}
break;
case RT_TOUCH_CTRL_DISABLE_INT:
rt_touch_irq_disable(touch);
break;
case RT_TOUCH_CTRL_ENABLE_INT:
rt_touch_irq_enable(touch);
break;
default:
return RT_ERROR;
......
......@@ -43,6 +43,8 @@ extern "C" {
#define RT_TOUCH_CTRL_SET_X_RANGE (3) /* Set x coordinate range */
#define RT_TOUCH_CTRL_SET_Y_RANGE (4) /* Set y coordinate range */
#define RT_TOUCH_CTRL_SET_X_TO_Y (5) /* Set X Y coordinate exchange */
#define RT_TOUCH_CTRL_DISABLE_INT (6) /* Disable interrupt */
#define RT_TOUCH_CTRL_ENABLE_INT (7) /* Enable interrupt */
/* Touch event */
#define RT_TOUCH_EVENT_NONE (0) /* Touch none */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册