1 #ifndef _LCD_CFG_H_
2 #define _LCD_CFG_H_
3 
4 #include <stdint.h>
5 
6 #define COORD_Y_REVERSE    (1<<0)
7 #define COORD_X_REVERSE    (1<<1)
8 #define COORD_XY_EXCHANGE  (1<<2)
9 
10 
11 #define DEFAULT_LCD_CONFIG {\
12     type: "rgb",\
13     width:480,\
14     height:272,\
15     bits_pixel:18,\
16     timing:\
17     {\
18         pixel_clock_hz:10000000,\
19         h_front_porch:8,\
20         h_back_porch:43,\
21         h_sync_len:4,\
22         v_front_porch:8,\
23         v_back_porch:12,\
24         v_sync_len:4,\
25         h_sync_active:0,\
26         v_sync_active:0,\
27         den_active:1,\
28         clk_active:1\
29     },\
30     swap_flag:0,\
31     ctp_flag:0,\
32     bl_mode:1,\
33     bl_gpio_pin:GPIOB(6),\
34     bl_gpio_level:1,\
35     bl_pwm_name: "pwm",\
36     bl_pwm_hz:1000,\
37     bl_pwm_pol:0,\
38     bl_pwm_val:60,\
39     bl_pin:GPIOG(13),\
40     bl_level:1,\
41     pwr_pin:GPIOG(15),\
42     pwr_level:1,\
43     lane:4\
44 }
45 
46 struct panel_timing
47 {
48     int pixel_clock_hz;
49     int h_front_porch;
50     int h_back_porch;
51     int h_sync_len;
52     int v_front_porch;
53     int v_back_porch;
54     int v_sync_len;
55     int h_sync_active;
56     int v_sync_active;
57     int den_active;
58     int clk_active;
59 };
60 typedef struct panel_timing *panel_timing_t;
61 
62 struct lcd_cfg_panel_info
63 {
64     rt_int8_t type[8];
65     int width;
66     int height;
67     int bits_pixel;
68     struct panel_timing timing;
69     int swap_flag;
70     int ctp_flag;
71 
72     int bl_mode;
73     int bl_gpio_pin;
74     int bl_gpio_level;
75     rt_int8_t bl_pwm_name[8];
76     int bl_pwm_hz;
77     int bl_pwm_pol;
78     int bl_pwm_val;
79     int bl_pin;
80     int bl_level;
81     int pwr_pin;
82     int pwr_level;
83     int lane;
84 
85 };
86 
87 const struct lcd_cfg_panel_info* load_lcd_config_from_xml(void);
88 
89 #endif
90