You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.9 KiB
57 lines
1.9 KiB
|
2 months ago
|
/*
|
||
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||
|
|
*
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*
|
||
|
|
* Change Logs:
|
||
|
|
* Date Author Notes
|
||
|
|
* 2025-12-06 Administrator the first version
|
||
|
|
*/
|
||
|
|
#ifndef DRIVERS_INCLUDE_LCD_H_
|
||
|
|
#define DRIVERS_INCLUDE_LCD_H_
|
||
|
|
|
||
|
|
#include "ltdc.h"
|
||
|
|
|
||
|
|
/* 颜色定义(RGB565) */
|
||
|
|
#define WHITE 0xFFFF
|
||
|
|
#define BLACK 0x0000
|
||
|
|
#define RED 0xF800
|
||
|
|
#define GREEN 0x07E0
|
||
|
|
#define BLUE 0x001F
|
||
|
|
#define YELLOW 0xFFE0
|
||
|
|
#define CYAN 0x07FF
|
||
|
|
#define MAGENTA 0xF81F
|
||
|
|
|
||
|
|
/* 注意:_lcd_dev 必须在 extern 之前定义! */
|
||
|
|
typedef struct {
|
||
|
|
uint16_t width;
|
||
|
|
uint16_t height;
|
||
|
|
uint16_t id;
|
||
|
|
uint8_t dir;
|
||
|
|
} _lcd_dev;
|
||
|
|
|
||
|
|
extern uint32_t g_point_color;
|
||
|
|
extern uint32_t g_back_color;
|
||
|
|
extern _lcd_dev lcddev;
|
||
|
|
|
||
|
|
/* 函数声明 */
|
||
|
|
void lcd_init(void);
|
||
|
|
void lcd_clear(uint32_t color);
|
||
|
|
void lcd_draw_point(uint16_t x, uint16_t y, uint32_t color);
|
||
|
|
void lcd_fill(uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey, uint32_t color);
|
||
|
|
void lcd_draw_line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint32_t color);
|
||
|
|
void lcd_draw_rectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint32_t color);
|
||
|
|
void lcd_draw_circle(uint16_t x0, uint16_t y0, uint8_t r, uint32_t color);
|
||
|
|
void lcd_fill_circle(uint16_t x, uint16_t y, uint16_t r, uint32_t color);
|
||
|
|
void lcd_show_char(uint16_t x, uint16_t y, char chr, uint8_t size, uint8_t mode, uint32_t color);
|
||
|
|
void lcd_show_num(uint16_t x, uint16_t y, uint32_t num, uint8_t len, uint8_t size, uint32_t color);
|
||
|
|
void lcd_show_xnum(uint16_t x, uint16_t y, uint32_t num, uint8_t len, uint8_t size, uint8_t mode, uint32_t color);
|
||
|
|
void lcd_show_string(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t size, char *p, uint32_t color);
|
||
|
|
|
||
|
|
/* 新增:声明 lcd_display_dir */
|
||
|
|
void lcd_display_dir(uint8_t dir);
|
||
|
|
|
||
|
|
void lcd_rgb_test();
|
||
|
|
|
||
|
|
#endif /* DRIVERS_INCLUDE_LCD_H_ */
|