xref: /OK3568_Linux_fs/app/lvgl_demo/lv_demo/main.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun #ifndef __MAIN_H__
2*4882a593Smuzhiyun #define __MAIN_H__
3*4882a593Smuzhiyun 
4*4882a593Smuzhiyun #include <errno.h>
5*4882a593Smuzhiyun #include <fcntl.h>
6*4882a593Smuzhiyun #include <inttypes.h>
7*4882a593Smuzhiyun #include <limits.h>
8*4882a593Smuzhiyun #include <malloc.h>
9*4882a593Smuzhiyun #include <math.h>
10*4882a593Smuzhiyun #include <png.h>
11*4882a593Smuzhiyun #include <poll.h>
12*4882a593Smuzhiyun #include <pthread.h>
13*4882a593Smuzhiyun #include <signal.h>
14*4882a593Smuzhiyun #include <stdbool.h>
15*4882a593Smuzhiyun #include <stdint.h>
16*4882a593Smuzhiyun #include <stdio.h>
17*4882a593Smuzhiyun #include <stdlib.h>
18*4882a593Smuzhiyun #include <string.h>
19*4882a593Smuzhiyun #include <stdarg.h>
20*4882a593Smuzhiyun #include <sys/ioctl.h>
21*4882a593Smuzhiyun #include <sys/mman.h>
22*4882a593Smuzhiyun #include <sys/stat.h>
23*4882a593Smuzhiyun #include <time.h>
24*4882a593Smuzhiyun #include <unistd.h>
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #include <lvgl/lvgl.h>
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun #include "lv_port_file.h"
29*4882a593Smuzhiyun #include "lv_port_indev.h"
30*4882a593Smuzhiyun #include "timestamp.h"
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #define ALIGN(x, a)     (((x) + (a - 1)) & ~(a - 1))
33*4882a593Smuzhiyun #define FAKE_FD         1234
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun enum {
36*4882a593Smuzhiyun     SCALE_MODE_FILL = 0x0,  // full screen stretch
37*4882a593Smuzhiyun     SCALE_MODE_CONTAIN,     // keep the scale, The side with the larger ratio
38*4882a593Smuzhiyun                             // is aligned with the container, and the other
39*4882a593Smuzhiyun                             // side is scaled equally
40*4882a593Smuzhiyun     SCALE_MODE_COVER,       // keep the scale, The side with the smaller ratio
41*4882a593Smuzhiyun                             // is aligned with the container, and the other
42*4882a593Smuzhiyun                             // side is scaled equally
43*4882a593Smuzhiyun     SCALE_MODE_NONE,
44*4882a593Smuzhiyun };
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #define RK_LV_IMG_DSC_MAGIC     0x6996a55a
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun typedef struct
49*4882a593Smuzhiyun {
50*4882a593Smuzhiyun     lv_img_dsc_t img_dsc;
51*4882a593Smuzhiyun     uint32_t magic;
52*4882a593Smuzhiyun     void (*free)(void *para);
53*4882a593Smuzhiyun     void *para;
54*4882a593Smuzhiyun     int rot;
55*4882a593Smuzhiyun } rk_lv_img_dsc_t;
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun int app_disp_rotation(void);
58*4882a593Smuzhiyun 
59*4882a593Smuzhiyun #endif
60*4882a593Smuzhiyun 
61