1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2019-03-07     ZYH          first version
9  */
10 
11 #ifndef DRV_LCD_H__
12 #define DRV_LCD_H__
13 
14 int rt_hw_lcd_init(void);
15 
16 //POINT_COLOR
17 #define WHITE 0xFFFF
18 #define BLACK 0x0000
19 #define BLUE 0x001F
20 #define BRED 0XF81F
21 #define GRED 0XFFE0
22 #define GBLUE 0X07FF
23 #define RED 0xF800
24 #define MAGENTA 0xF81F
25 #define GREEN 0x07E0
26 #define CYAN 0x7FFF
27 #define YELLOW 0xFFE0
28 #define BROWN 0XBC40
29 #define BRRED 0XFC07
30 #define GRAY 0X8430
31 #define GRAY175 0XAD75
32 #define GRAY151 0X94B2
33 #define GRAY187 0XBDD7
34 #define GRAY240 0XF79E
35 
36 typedef enum _lcd_dir
37 {
38     DIR_XY_RLUD = 0x00,
39     DIR_YX_RLUD = 0x20,
40     DIR_XY_LRUD = 0x40,
41     DIR_YX_LRUD = 0x60,
42     DIR_XY_RLDU = 0x80,
43     DIR_YX_RLDU = 0xA0,
44     DIR_XY_LRDU = 0xC0,
45     DIR_YX_LRDU = 0xE0,
46     DIR_XY_MASK = 0x20,
47     DIR_MASK = 0xE0,
48 } lcd_dir_t;
49 
50 /* for mpy machine.lcd */
51 void lcd_display_on(void);
52 void lcd_display_off(void);
53 void lcd_clear(int color);
54 void lcd_draw_point_color(int x, int y, int color);
55 void lcd_show_string(int x, int y, int size, const char *data);
56 void lcd_draw_line(int x1, int y1, int x2, int y2);
57 void lcd_draw_rectangle(int x1, int y1, int x2, int y2);
58 void lcd_draw_circle(int x1, int y1, int r);
59 void lcd_set_color(int back, int fore);
60 void lcd_show_image(int x, int y, int length, int wide, const unsigned char *buf);
61 int lcd_init(void);
62 void lcd_set_direction(lcd_dir_t dir);
63 
64 #endif
65