pikapython/bsp/TC264D/Libraries/seekfree_peripheral/SEEKFREE_IPS200_PARALLEL8.h
2022-01-18 00:58:54 +08:00

181 lines
7.0 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 2.0<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>
D0 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D0_PIN <20><EFBFBD><EAB6A8>
D1 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D1_PIN <20><EFBFBD><EAB6A8>
D2 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D2_PIN <20><EFBFBD><EAB6A8>
D3 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D3_PIN <20><EFBFBD><EAB6A8>
D4 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D4_PIN <20><EFBFBD><EAB6A8>
D5 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D5_PIN <20><EFBFBD><EAB6A8>
D6 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D6_PIN <20><EFBFBD><EAB6A8>
D7 <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_D7_PIN <20><EFBFBD><EAB6A8>
BL <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_BL_PIN <20><EFBFBD><EAB6A8>
CS <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_CS_PIN <20><EFBFBD><EAB6A8>
RD <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_RD_PIN <20><EFBFBD><EAB6A8>
WR <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_WR_PIN <20><EFBFBD><EAB6A8>
RS <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_RS_PIN <20><EFBFBD><EAB6A8>
RST <09>鿴SEEKFREE_IPS200_PARALLEL8.H<>ļ<EFBFBD><C4BC>ڵ<EFBFBD>IPS200_RST_PIN <20><EFBFBD><EAB6A8>
<09><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
VCC 3.3V<EFBFBD><EFBFBD>Դ
GND <20><>Դ<EFBFBD><D4B4>
<09><><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>240*320
------------------------------------
********************************************************************************************************************/
#ifndef _SEEKFREE_IPS200PARALLEL8_H
#define _SEEKFREE_IPS200PARALLEL8_H
#include "common.h"
#include "SEEKFREE_FONT.h"
//-------<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><>ɫ
#define IPS200_BGCOLOR WHITE //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
#define IPS200_PENCOLOR RED //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
//<2F><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѡ<EFBFBD><D1A1>B C D<><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>GPIO<49><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ٶ<EFBFBD>
#define IPS200_RD_PIN P15_3
#define IPS200_WR_PIN P15_5
#define IPS200_RS_PIN P15_1
#define IPS200_RST_PIN P15_0
#define IPS200_CS_PIN P15_2
#define IPS200_BL_PIN P15_4
//D0-D3<44>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>C0-C3,C1-C4<43>ȵȣ<C8B5>
//D4-D7<44>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>B0-B3,B1-B4<42>ȵȡ<C8B5>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>ͬ<EFBFBD>˿ڵ<CBBF><DAB5><EFBFBD>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB>D0-D3<44><33>C1-C4<43><34><EFBFBD>ӣ<EFBFBD>D4-D7<44><37>B2-B5<42><35><EFBFBD>ӡ<EFBFBD>
//<2F>л<EFBFBD><D0BB><EFBFBD><EFBFBD>ź<EFBFBD>ע<EFBFBD><D7A2><EFBFBD>޸<EFBFBD>IPS200_DATA_PORT1<54><31>IPS200_DATA_PORT2<54><EFBFBD><EAB6A8>
#define IPS200_D0_PIN P11_9
#define IPS200_D1_PIN P11_10
#define IPS200_D2_PIN P11_11
#define IPS200_D3_PIN P11_12
#define IPS200_D4_PIN P13_0
#define IPS200_D5_PIN P13_1
#define IPS200_D6_PIN P13_2
#define IPS200_D7_PIN P13_3
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ˿<DDB6><CBBF><EFBFBD><EFBFBD><EFBFBD>PORT<52><54><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>PORT<52><54><EFBFBD>и<EFBFBD><D0B8><EFBFBD>
#define IPS200_DATA_PORT1 3 //0<><30>P00<30>˿<EFBFBD> 1<><31>P02<30>˿<EFBFBD> 2<><32>P10<31>˿<EFBFBD> 3<><33>P11<31>˿<EFBFBD> 4<><34>P13<31>˿<EFBFBD> 5<><35>P14<31>˿<EFBFBD> 6<><36>P15<31>˿<EFBFBD> 7<><37>P20<32>˿<EFBFBD> 8<><38>P21<32>˿<EFBFBD> 9<><39>P22<32>˿<EFBFBD> 10<31><30>P23<32>˿<EFBFBD> 11<31><31>P32<33>˿<EFBFBD> 12<31><32>P33<33>˿<EFBFBD>
#define IPS200_DATAPORT1 (((Ifx_P *)IfxPort_cfg_indexMap[IPS200_DATA_PORT1].module)->OUT.U) //<2F><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>GPIO<49><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>
#define DATA_START_NUM1 (IPS200_D0_PIN&0x1f) //<2F><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
#define IPS200_DATA_PORT2 4 //0<><30>P00<30>˿<EFBFBD> 1<><31>P02<30>˿<EFBFBD> 2<><32>P10<31>˿<EFBFBD> 3<><33>P11<31>˿<EFBFBD> 4<><34>P13<31>˿<EFBFBD> 5<><35>P14<31>˿<EFBFBD> 6<><36>P15<31>˿<EFBFBD> 7<><37>P20<32>˿<EFBFBD> 8<><38>P21<32>˿<EFBFBD> 9<><39>P22<32>˿<EFBFBD> 10<31><30>P23<32>˿<EFBFBD> 11<31><31>P32<33>˿<EFBFBD> 12<31><32>P33<33>˿<EFBFBD>
#define IPS200_DATAPORT2 (((Ifx_P *)IfxPort_cfg_indexMap[IPS200_DATA_PORT2].module)->OUT.U) //<2F><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>GPIO<49><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>
#define DATA_START_NUM2 (IPS200_D4_PIN&0x1f) //<2F><EFBFBD><EAB6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
#define IPS200_BL(x) gpio_set(IPS200_BL_PIN,x)
#define IPS200_CS(x) gpio_set(IPS200_CS_PIN,x)
#define IPS200_RD(x) gpio_set(IPS200_RD_PIN,x)
#define IPS200_WR(x) gpio_set(IPS200_WR_PIN,x)
#define IPS200_RS(x) gpio_set(IPS200_RS_PIN,x)
#define IPS200_RST(x) gpio_set(IPS200_RST_PIN,x)
#define IPS200_W 240
#define IPS200_H 320
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
//0 <20><><EFBFBD><EFBFBD>ģʽ
//1 <20><><EFBFBD><EFBFBD>ģʽ <20><>ת180<38><30>
//2 <20><><EFBFBD><EFBFBD>ģʽ
//3 <20><><EFBFBD><EFBFBD>ģʽ <20><>ת180<38><30>
#define IPS200_DISPLAY_DIR 0
#if (0==IPS200_DISPLAY_DIR || 1==IPS200_DISPLAY_DIR)
#define IPS200_X_MAX IPS200_W //Һ<><D2BA>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define IPS200_Y_MAX IPS200_H //Һ<><D2BA>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#elif (2==IPS200_DISPLAY_DIR || 3==IPS200_DISPLAY_DIR)
#define IPS200_X_MAX IPS200_H //Һ<><D2BA>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define IPS200_Y_MAX IPS200_W //Һ<><D2BA>Y<EFBFBD><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#else
#error "IPS200_DISPLAY_DIR <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#endif
void ips200_init(void); //<2F><>ʼ<EFBFBD><CABC>Ӳ<EFBFBD><D3B2>
void ips200_w_data(uint8 dat);
void ips200_wr_reg(uint8 com);
void ips200_wr_data(uint8 dat);
void ips200_wr_data16(uint16 dat);
void ips200_w_reg(uint8 com,uint8 dat);
void ips200_address_set(uint16 x1,uint16 y1,uint16 x2,uint16 y2);
void ips200_clear(uint16 color);
void ips200_drawpoint(uint16 x,uint16 y,uint16 color);
void ips200_showchar(uint16 x,uint16 y,const int8 dat);
void ips200_showstr(uint16 x,uint16 y,const int8 dat[]);
void ips200_showint8(uint16 x,uint16 y,int8 dat);
void ips200_showuint8(uint16 x,uint16 y,uint8 dat);
void ips200_showint16(uint16 x,uint16 y,int16 dat);
void ips200_showuint16(uint16 x,uint16 y,uint16 dat);
void ips200_showint32(uint16 x,uint16 y,int dat,uint8 num);
void ips200_showfloat(uint16 x,uint16 y,double dat,int8 num,int8 pointnum);
void ips200_showimage(uint16 x,uint16 y,uint16 w,uint16 l,const unsigned char *p);
void ips200_displayimage032(uint8 *p, uint16 width, uint16 height);
void ips200_displayimage032_zoom(uint8 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void ips200_displayimage032_zoom1(uint8 *p, uint16 width, uint16 height, uint16 start_x, uint16 start_y, uint16 dis_width, uint16 dis_height);
void ips200_displayimage8660_zoom(uint16 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void ips200_displayimage8660_zoom1(uint16 *p, uint16 width, uint16 height, uint16 start_x, uint16 start_y, uint16 dis_width, uint16 dis_height);
void ips200_displayimage8660_grayscale_zoom(uint16 *p, uint16 width, uint16 height, uint16 dis_width, uint16 dis_height);
void ips200_displayimage7725(uint8 *p, uint16 width, uint16 height);
void ips200_display_chinese(uint16 x, uint16 y, uint8 size, const uint8 *p, uint8 number, uint16 color);
#endif