2022-01-18 00:58:54 +08:00

129 lines
4.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*********************************************************************************************************************
* COPYRIGHT NOTICE
* Copyright (c) 2020,<2C><><EFBFBD>ɿƼ<C9BF>
* All rights reserved.
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<51><C8BA><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA>824575535
*
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>;<EFBFBD><CDBE>
* <20><>ӭ<EFBFBD><D3AD>λʹ<CEBB>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EBB1A3><EFBFBD><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC>İ<EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @file 1.8<EFBFBD><EFBFBD>TFT
* @company <09>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>ɿƼ<C9BF><C6BC><EFBFBD><EFBFBD>޹<EFBFBD>˾
* @author <09><><EFBFBD>ɿƼ<C9BF>(QQ3184284598)
* @version <09>鿴doc<6F><63>version<6F>ļ<EFBFBD> <20>汾˵<E6B1BE><CBB5>
* @Software ADS v1.2.2
* @Target core TC264D
* @Taobao https://seekfree.taobao.com/
* @date 2020-3-23
* @note
<09><><EFBFBD>߶<EFBFBD><DFB6>
------------------------------------
ģ<><C4A3><EFBFBD>ܽ<EFBFBD> <09><>Ƭ<EFBFBD><C6AC><EFBFBD>ܽ<EFBFBD>
SCL <20>鿴TFT_SCL<43><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<><D3B2>SPI<50><49><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
SDA <20>鿴TFT_SDA<44><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<><D3B2>SPI<50><49><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
RES <20>鿴REST_PIN<49><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
DC <20>鿴DC_PIN<49><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CS <20>鿴TFT_CS<43><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<><D3B2>SPI<50><49><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
<09><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
BL 3.3V<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD>PWM<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD>
VCC 3.3V<EFBFBD><EFBFBD>Դ
GND <20><>Դ<EFBFBD><D4B4>
<09><><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>128*160
------------------------------------
********************************************************************************************************************/
#ifndef _SEEKFREE_18TFT_h
#define _SEEKFREE_18TFT_h
#include "common.h"
#include "SEEKFREE_FONT.h"
//-----------------<2D><><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>------------------------------
#define TFT_SPIN SPI_2 //<2F><><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD>SPI<50><49>
#define TFT_SCL SPI2_SCLK_P15_3 //<2F><><EFBFBD><EFBFBD>SPI_SCK<43><4B><EFBFBD><EFBFBD>
#define TFT_SDA SPI2_MOSI_P15_5 //<2F><><EFBFBD><EFBFBD>SPI_MOSI<53><49><EFBFBD><EFBFBD>
#define TFT_SDA_IN SPI2_MISO_P15_4 //<2F><><EFBFBD><EFBFBD>SPI_MISO<53><4F><EFBFBD><EFBFBD> IPSû<53><C3BB>MISO<53><4F><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><E5A3AC>spi<70>ij<EFBFBD>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1>Ҫʹ<D2AA><CAB9>
#define TFT_CS SPI2_CS0_P15_2 //<2F><><EFBFBD><EFBFBD>SPI_CS<43><53><EFBFBD><EFBFBD>
#define BL_PIN P15_4 //Һ<><D2BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD> <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>ͨѶδʹ<CEB4><CAB9>P15_4<5F><34><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFB8B4>ΪGPIO
#define REST_PIN P15_1 //Һ<><D2BA><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
#define DC_PIN P15_0 //Һ<><D2BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
#define DC(x) gpio_set(DC_PIN,x)
#define REST(x) gpio_set(REST_PIN,x)
//-------<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>SEEKFREE_FONT.h<>ļ<EFBFBD><C4BC>ж<EFBFBD><D0B6><EFBFBD>----------
//#define RED 0xF800 //<2F><>ɫ
//#define BLUE 0x001F //<2F><>ɫ
//#define YELLOW 0xFFE0 //<2F><>ɫ
//#define GREEN 0x07E0 //<2F><>ɫ
//#define WHITE 0xFFFF //<2F><>ɫ
//#define BLACK 0x0000 //<2F><>ɫ
//#define GRAY 0X8430 //<2F><>ɫ
//#define BROWN 0XBC40 //<2F><>ɫ
//#define PURPLE 0XF81F //<2F><>ɫ
//#define PINK 0XFE19 //<2F><>ɫ
//<2F><><EFBFBD><EFBFBD>д<EFBFBD>ֱʵ<D6B1><CAB5><EFBFBD>ɫ
#define TFT_PENCOLOR RED
//<2F><><EFBFBD><EFBFBD><E5B1B3><EFBFBD><EFBFBD>ɫ
#define TFT_BGCOLOR WHITE
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
//0 <20><><EFBFBD><EFBFBD>ģʽ
//1 <20><><EFBFBD><EFBFBD>ģʽ <20><>ת180
//2 <20><><EFBFBD><EFBFBD>ģʽ
//3 <20><><EFBFBD><EFBFBD>ģʽ <20><>ת180
#define TFT_DISPLAY_DIR 3
#if (0==TFT_DISPLAY_DIR || 1==TFT_DISPLAY_DIR)
#define TFT_X_MAX 128 //Һ<><D2BA>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define TFT_Y_MAX 160 //Һ<><D2BA>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#elif (2==TFT_DISPLAY_DIR || 3==TFT_DISPLAY_DIR)
#define TFT_X_MAX 160 //Һ<><D2BA>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define TFT_Y_MAX 128 //Һ<><D2BA>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#else
#error "TFT_DISPLAY_DIR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#endif
void lcd_init(void);
void lcd_clear(uint16 color);
void lcd_drawpoint(uint16 x,uint16 y,uint16 color);
void lcd_showchar(uint16 x,uint16 y,const int8 dat);
void lcd_showstr(uint16 x,uint16 y,const int8 dat[]);
void lcd_showint8(uint16 x,uint16 y,int8 dat);
void lcd_showuint8(uint16 x,uint16 y,uint8 dat);
void lcd_showint16(uint16 x,uint16 y,int16 dat);
void lcd_showuint16(uint16 x,uint16 y,uint16 dat);
void lcd_showint32(uint16 x,uint16 y,int32 dat,uint8 num);
void lcd_showfloat(uint16 x,uint16 y,double dat,uint8 num,uint8 pointnum);
void showimage(const unsigned char *p);
void lcd_displayimage032(uint8 *p, uint16 width, uint16 height);
void lcd_displayimage032_zoom(uint8 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void lcd_displayimage8660_zoom(uint16 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void lcd_displayimage7725(uint8 *p, uint16 width, uint16 height);
void lcd_display_chinese(uint16 x, uint16 y, uint8 size, const uint8 *p, uint8 number, uint16 color);
#endif