ettft240320tp3_2_rev_b.h


1
/**************************************************************************************************
2
 *                                                  *
3
 *               Header für Display "ET-TFT240320 TP3.2 Rev.b"                *
4
 *                                                  *
5
 **************************************************************************************************/
6
7
#ifndef ETTFT240320TP3_2_REV_B_H
8
#define ETTFT240320TP3_2_REV_B_H
9
10
// Farb Konstanten
11
#define no_bg      0x0001 // No Color Back Ground Black
12
#define Black     0x0000
13
#define White      0xFFFF
14
#define Red        0xFCF3
15
#define Green      0x9FF3
16
17
18
19
// Valiable for Touch Screen Function GLCD
20
long dif_adc_X,dif_adc_Y          ;
21
long buf_adc_X[100],buf_adc_Y[100];
22
long ave_adc_X,ave_adc_Y          ;
23
long tcs_ave_X[3]                 ; // Keep Value adc Touch Point X
24
long tcs_ave_Y[3]                 ; // Keep Value adc Touch Point Y
25
long dis_XD[3]            ; // Value refer Point X at 10% of Display(X=240:0-239) 3 Position
26
long dis_YD[3]             ; // Value refer Point Y at 10% of Display(Y=320:0-319) 3 Position
27
long divider,An,Bn,Cn,Dn,En,Fn,X,Y; // Valiable for keep coefficient Calibrat and position touch Screen
28
29
/*** 1.Function Control Graphic LCD ET-TFT240320TP-3.2 REV.B (Driver SPFD5408A)***/
30
void gp_cs_hi(void)      ;
31
void gp_cs_lo(void)      ;
32
void gp_rs_hi(void)      ;
33
void gp_rs_lo(void)      ;
34
void gp_wr_hi(void)      ;
35
void gp_wr_lo(void)      ;
36
void gp_rd_hi(void)      ;
37
void gp_rd_lo(void)      ;
38
void gp_res_hi(void)    ;
39
void gp_res_lo(void)    ;
40
void gp_bl_on(void)      ;
41
void gp_bl_off(void)     ;
42
void gp_wr_cmm(uint8_t cmm)  ;
43
void gp_wr_data(uint16_t dw);
44
void init_glcd(void)        ;
45
46
/*** 2.Function Control SPI Touch-Screen (ADS7846) ***/
47
void tcs_sck_hi(void)           ;
48
void tcs_sck_lo(void)           ;
49
void tcs_cs_hi(void)      ;
50
void tcs_cs_lo(void)      ;
51
void tcs_sdo_hi(void)      ;
52
void tcs_sdo_lo(void)      ;
53
void tcs_busy(void)             ;
54
uint8_t status_touch(void)      ;
55
uint8_t tcs_wr(uint8_t DataByte);
56
void tcs_read(void)             ;
57
void ave_x_y(uint8_t num)    ;
58
59
void touch_calibrate(void)      ;
60
void set_matrix(void)           ;
61
void get_point(uint8_t num)     ;
62
63
/*** 3.Function Application of GLCD ***/
64
void bg_color(unsigned int bg_color)                    ;
65
void plot_mark(uint8_t x1,uint16_t y1,uint8_t x2,uint16_t y2,uint16_t color);
66
67
void lcd_Ascii(uint8_t row,uint8_t font, uint8_t adx,uint16_t ady,uint16_t fg_clr,uint16_t bg_clr);
68
void print_Str(char *str,uint8_t font,uint8_t sx,uint16_t sy,uint16_t fg_color,uint16_t bg_color) ;
69
void print_Num(uint16_t num,uint8_t nr,uint8_t font,uint8_t x,uint16_t y,uint16_t fg_color, uint16_t bg_color);
70
71
void plot_dot(uint8_t dx,uint16_t dy,uint16_t color)                          ;
72
void Line(uint8_t lx1,uint16_t ly1,uint8_t lx2,uint16_t ly2,uint8_t line_type,uint16_t color)      ;
73
void Circle(uint8_t cx,uint16_t cy,uint8_t Radius,uint8_t tick,uint16_t color,uint8_t fill)       ;
74
void Ellipse(uint16_t h,uint16_t k,long rx,long ry,uint8_t tick,uint16_t color,uint8_t fill)     ;
75
void Rectan(uint8_t x1,uint16_t y1,uint8_t x2,uint16_t y2,uint8_t tick,uint16_t color,uint8_t fill);
76
77
78
void delay_ms(uint16_t cnt);
79
void init_port(void);
80
81
82
#endif