mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
131 lines
4.7 KiB
C
131 lines
4.7 KiB
C
|
/*********************************************************************************************************************
|
|||
|
* COPYRIGHT NOTICE
|
|||
|
* Copyright (c) 2020,<EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD>
|
|||
|
* All rights reserved.
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQȺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<EFBFBD><EFBFBD>824575535
|
|||
|
*
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>;<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD>λʹ<EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>뱣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD><EFBFBD>İ<EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* @file 1.14<EFBFBD><EFBFBD>IPS<EFBFBD><EFBFBD>Ļ
|
|||
|
* @company <EFBFBD>ɶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
|
|||
|
* @author <EFBFBD><EFBFBD><EFBFBD>ɿƼ<EFBFBD>(QQ3184284598)
|
|||
|
* @version <EFBFBD>鿴doc<EFBFBD><EFBFBD>version<EFBFBD>ļ<EFBFBD> <EFBFBD>汾˵<EFBFBD><EFBFBD>
|
|||
|
* @Software ADS v1.2.2
|
|||
|
* @Target core TC264D
|
|||
|
* @Taobao https://seekfree.taobao.com/
|
|||
|
* @date 2020-3-23
|
|||
|
* @note
|
|||
|
<EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD><EFBFBD>壺
|
|||
|
------------------------------------
|
|||
|
ģ<EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD> <EFBFBD><EFBFBD>Ƭ<EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD>
|
|||
|
SCL <EFBFBD>鿴IPS114_SCL_PIN<EFBFBD>궨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<EFBFBD><EFBFBD>SPI<EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
|
|||
|
SDA <EFBFBD>鿴IPS114_SDA_PIN<EFBFBD>궨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<EFBFBD><EFBFBD>SPI<EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
|
|||
|
RES <EFBFBD>鿴IPS114_REST_PIN<EFBFBD>궨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
DC <EFBFBD>鿴IPS114_DC_PIN<EFBFBD>궨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
CS <EFBFBD>鿴IPS114_CS_PIN<EFBFBD>궨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӳ<EFBFBD><EFBFBD>SPI<EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
|
|||
|
|
|||
|
<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><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 <EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><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
|