driver/uinput: add uinput button support

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai
2021-12-24 16:30:36 +08:00
committed by Xiang Xiao
parent 377c15955e
commit 3bb4e053fe
4 changed files with 201 additions and 2 deletions
+5
View File
@@ -148,6 +148,11 @@ struct btn_lowerhalf_s
CODE void (*bl_enable)(FAR const struct btn_lowerhalf_s *lower,
btn_buttonset_t press, btn_buttonset_t release,
btn_handler_t handler, FAR void *arg);
/* Key write callback function */
CODE ssize_t (*bl_write)(FAR const struct btn_lowerhalf_s *lower,
FAR const char *buffer, size_t buflen);
};
/****************************************************************************
+17
View File
@@ -49,4 +49,21 @@
int uinput_touch_initialize(FAR const char *name, int maxpoint,
int buffnums);
/****************************************************************************
* Name: uinput_button_initialize
*
* Description:
* Initialized the uinput button device
*
* Input Parameters:
* name: Button devices name
*
* Returned Value:
* Zero is returned on success. Otherwise, a negated errno value is
* returned to indicate the nature of the failure.
*
****************************************************************************/
int uinput_button_initialize(FAR const char *name);
#endif /* __INCLUDE_NUTTX_INPUT_UINPUT_H */