multi-disp: API updates

This commit is contained in:
Gabor Kiss-Vamosi
2019-02-20 23:58:13 +01:00
parent f2bd701927
commit 030fe60b34
19 changed files with 473 additions and 420 deletions

View File

@@ -15,6 +15,12 @@ extern "C" {
/*********************
* INCLUDES
*********************/
#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lv_conf.h"
#else
#include "../../lv_conf.h"
#endif
#include <stdbool.h>
#include <stdint.h>
#include "../lv_misc/lv_area.h"
@@ -28,6 +34,7 @@ extern "C" {
**********************/
struct _disp_t;
struct _lv_indev_t;
/*Possible input device types*/
enum {
@@ -48,22 +55,23 @@ typedef uint8_t lv_indev_state_t;
/*Data type when an input device is read */
typedef struct {
void *user_data; /*'lv_indev_drv_t.priv' for this driver*/
union {
lv_point_t point; /*For LV_INDEV_TYPE_POINTER the currently pressed point*/
uint32_t key; /*For LV_INDEV_TYPE_KEYPAD the currently pressed key*/
uint32_t btn; /*For LV_INDEV_TYPE_BUTTON the currently pressed button*/
int16_t enc_diff; /*For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/
lv_point_t point; /*For LV_INDEV_TYPE_POINTER the currently pressed point*/
uint32_t key; /*For LV_INDEV_TYPE_KEYPAD the currently pressed key*/
uint32_t btn_id; /*For LV_INDEV_TYPE_BUTTON the currently pressed button*/
int16_t enc_diff; /*For LV_INDEV_TYPE_ENCODER number of steps since the previous read*/
};
lv_indev_state_t state; /*LV_INDEV_STATE_REL or LV_INDEV_STATE_PR*/
} lv_indev_data_t;
/*Initialized by the user and registered by 'lv_indev_add()'*/
typedef struct {
lv_hal_indev_type_t type; /*Input device type*/
bool (*read)(lv_indev_data_t *data); /*Function pointer to read data. Return 'true' if there is still data to be read (buffered)*/
lv_hal_indev_type_t type; /*Input device type*/
bool (*read_cb)(struct _lv_indev_t * indev, lv_indev_data_t *data); /*Function pointer to read_cb data. Return 'true' if there is still data to be read_cb (buffered)*/
lv_indev_user_data_t read_user_data; /*Pointer to user defined data, passed in 'lv_indev_data_t' on read*/
struct _disp_t * disp;
void *user_data; /*Pointer to user defined data, passed in 'lv_indev_data_t' on read*/
} lv_indev_drv_t;
struct _lv_obj_t;
@@ -100,8 +108,6 @@ typedef struct _lv_indev_proc_t {
uint8_t disabled :1;
} lv_indev_proc_t;
struct _lv_indev_t;
typedef void (*lv_indev_feedback_t)(struct _lv_indev_t *, uint8_t);
struct _lv_obj_t;