diff options
| author | tyustli <[email protected]> | 2019-06-13 16:48:40 +0800 |
|---|---|---|
| committer | tyustli <[email protected]> | 2019-06-13 16:48:40 +0800 |
| commit | 116b7880c39ec86f0612d33933f8d2c04966dc40 (patch) | |
| tree | b86dd0be11646b0ef1447d824023b04b72986a97 /components/drivers/touch | |
| parent | 10ac5f7a3486df6cda77013ab568c444cf72b4f3 (diff) | |
add enable/disable interrupt command
Diffstat (limited to 'components/drivers/touch')
| -rw-r--r-- | components/drivers/touch/touch.c | 8 | ||||
| -rw-r--r-- | components/drivers/touch/touch.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/components/drivers/touch/touch.c b/components/drivers/touch/touch.c index 1dd93d915f..f8802a526f 100644 --- a/components/drivers/touch/touch.c +++ b/components/drivers/touch/touch.c @@ -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; } @@ -198,6 +196,12 @@ static rt_err_t rt_touch_control(rt_device_t dev, int cmd, void *args) } 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; } diff --git a/components/drivers/touch/touch.h b/components/drivers/touch/touch.h index 4fa19aed47..6b7288a5a0 100644 --- a/components/drivers/touch/touch.h +++ b/components/drivers/touch/touch.h @@ -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 */ |
