huangcm
2025-04-07 511b111543524704f6182b374e489f5d0e51db8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * Allwinner SoCs eink driver.
 *
 * Copyright (C) 2019 Allwinner.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 *
 *    File name   :       sunxi_eink.h
 *
 *    Description :       eink engine 2.0  struct declaration
 *
 *    History     :       2019/03/20 liuli   initial version
 *
 */
#ifndef _SUNXI_EINK_H_
#define _SUNXI_EINK_H_
 
enum EINK_CMD {
   EINK_UPDATE_IMG,
   EINK_SET_TEMP,
   EINK_GET_TEMP,
   EINK_SET_GC_CNT,
};
 
enum upd_mode {
   EINK_INIT_MODE = 0x01,
   EINK_DU_MODE = 0x02,
   EINK_GC16_MODE = 0x04,
   EINK_GC4_MODE = 0x08,
   EINK_A2_MODE = 0x10,
   EINK_GL16_MODE = 0x20,
   EINK_GLR16_MODE = 0x40,
   EINK_GLD16_MODE = 0x80,
   EINK_GU16_MODE    = 0x84,
 
   /* use self upd win not de*/
   EINK_RECT_MODE  = 0x400,
   /* AUTO MODE: auto select update mode by E-ink driver */
   EINK_AUTO_MODE = 0x8000,
 
/*    EINK_NO_MERGE = 0x80000000,*/
};
 
enum dither_mode {
   QUANTIZATION,
   FLOYD_STEINBERG,
   ATKINSON,
   ORDERED,
   SIERRA_LITE,
   BURKES,
};
 
struct upd_win {
   u32 left;
   u32 top;
   u32 right;
   u32 bottom;
};
 
enum upd_pixel_fmt {
   EINK_Y8 = 0x09,
   EINK_Y5 = 0x0a,
   EINK_Y4 = 0x0b,
   EINK_Y3 = 0x0e,
};
 
struct eink_upd_cfg {
   struct upd_win        upd_win;
   enum upd_mode        upd_mode;
   enum dither_mode    dither_mode;
   enum upd_pixel_fmt    out_fmt;
   bool            force_fresh;
   bool            upd_all_en;
   bool            de_bypass;
};
#endif