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

131 lines
4.7 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.14<EFBFBD><EFBFBD>IPS<EFBFBD><EFBFBD>Ļ
* @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>鿴IPS114_SCL_PIN<49><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<><D3B2>SPI<50><49><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
SDA <20>鿴IPS114_SDA_PIN<49><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<><D3B2>SPI<50><49><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
RES <20>鿴IPS114_REST_PIN<49><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
DC <20>鿴IPS114_DC_PIN<49><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CS <20>鿴IPS114_CS_PIN<49><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>135*240
------------------------------------
********************************************************************************************************************/
#ifndef _SEEKFREE_IPS114_H
#define _SEEKFREE_IPS114_H
#include "common.h"
#include "SEEKFREE_FONT.h"
//-----------------<2D><><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>------------------------------
#define IPS114_SPIN_PIN SPI_2 //<2F><><EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD>SPI<50><49>
#define IPS114_SCL_PIN SPI2_SCLK_P15_3 //<2F><><EFBFBD><EFBFBD>SPI_SCK<43><4B><EFBFBD><EFBFBD>
#define IPS114_SDA_PIN SPI2_MOSI_P15_5 //<2F><><EFBFBD><EFBFBD>SPI_MOSI<53><49><EFBFBD><EFBFBD>
#define IPS114_SDA_IN_PIN 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 IPS114_CS_PIN SPI2_CS0_P15_2 //<2F><><EFBFBD><EFBFBD>SPI_CS<43><53><EFBFBD><EFBFBD>
#define IPS114_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 IPS114_REST_PIN P15_1 //Һ<><D2BA><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
#define IPS114_DC_PIN P15_0 //Һ<><D2BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>
#define IPS114_DC(x) gpio_set(IPS114_DC_PIN,x)
#define IPS114_REST(x) gpio_set(IPS114_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 IPS114_PENCOLOR RED
//<2F><><EFBFBD><EFBFBD><E5B1B3><EFBFBD><EFBFBD>ɫ
#define IPS114_BGCOLOR WHITE
#define IPS114_W 135
#define IPS114_H 240
//<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 IPS114_DISPLAY_DIR 3
#if (0==IPS114_DISPLAY_DIR || 1==IPS114_DISPLAY_DIR)
#define IPS114_X_MAX IPS114_W //Һ<><D2BA>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define IPS114_Y_MAX IPS114_H //Һ<><D2BA>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#elif (2==IPS114_DISPLAY_DIR || 3==IPS114_DISPLAY_DIR)
#define IPS114_X_MAX IPS114_H //Һ<><D2BA>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define IPS114_Y_MAX IPS114_W //Һ<><D2BA>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#else
#error "IPS114_DISPLAY_DIR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#endif
void ips114_init(void);
void ips114_clear(uint16 color);
void ips114_drawpoint(uint16 x,uint16 y,uint16 color);
void ips114_showchar(uint16 x,uint16 y,const int8 dat);
void ips114_showstr(uint16 x,uint16 y,const int8 dat[]);
void ips114_showint8(uint16 x,uint16 y,int8 dat);
void ips114_showuint8(uint16 x,uint16 y,uint8 dat);
void ips114_showint16(uint16 x,uint16 y,int16 dat);
void ips114_showuint16(uint16 x,uint16 y,uint16 dat);
void ips114_showint32(uint16 x,uint16 y,int32 dat,uint8 num);
void ips114_showfloat(uint16 x,uint16 y,double dat,uint8 num,uint8 pointnum);
void ips114_displayimage032(uint8 *p, uint16 width, uint16 height);
void ips114_displayimage032_zoom(uint8 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void ips114_displayimage032_zoom1(uint8 *p, uint16 width, uint16 height, uint16 start_x, uint16 start_y, uint16 dis_width, uint16 dis_height);
void ips114_displayimage8660_zoom(uint16 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void ips114_displayimage8660_zoom1(uint8 *p, uint16 width, uint16 height, uint16 start_x, uint16 start_y, uint16 dis_width, uint16 dis_height);
void ips114_displayimage7725(uint8 *p, uint16 width, uint16 height);
void ips114_display_chinese(uint16 x, uint16 y, uint8 size, const uint8 *p, uint8 number, uint16 color);
#endif