Description
lvgl_encoder_process_event can catch encoder event but this event is not passed to assigned object.
What MCU/Processor/Board and compiler are you using?
RW610
What LVGL version are you using?
V8.4
What do you want to achieve?
I have screens as object and want to swipe screens when encoder rotates.
What have you tried so far?
void lv_group_encoder(void)
{
input_g = lv_group_get_default();
if (input_g == NULL) {
input_g = lv_group_create();
lv_group_set_default(input_g);
}
lv_indev_t *cur_drv = NULL;
for (;;) {
cur_drv = lv_indev_get_next(cur_drv);
if (!cur_drv) {
break;
}
if (cur_drv->driver->type == LV_INDEV_TYPE_ENCODER) {
lv_indev_set_group(cur_drv, input_g);
lv_group_focus_freeze(input_g, false);
// cur_drv->driver->read_cb = screen_event_cb;
}
// if (cur_drv->driver->type == LV_INDEV_TYPE_POINTER) {
// lv_indev_set_group(cur_drv, input_g);
// }
}
}
disp_pointer {
compatible = “zephyr,lvgl-pointer-input”;
input = <&ft7401>;
invert-y;
invert-x;
swap-xy;
status = “okay”;
};
disp_encoder {
compatible = "zephyr,lvgl-encoder-input";
rotation-input-code = <INPUT_REL_WHEEL>;
status = "okay";
encoder_gpio_qdec: encoder_gpio_qdec {
compatible = "gpio-qdec";
gpios = <&hsgpio0 15 (GPIO_ACTIVE_HIGH)>,
<&hsgpio1 21 (GPIO_ACTIVE_HIGH)>;
steps-per-period = <4>;
zephyr,axis = <INPUT_REL_WHEEL>;
sample-time-us = <5000>;
idle-timeout-ms = <200>;
status = "okay";
};