Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison lcd.h @ 8:58d76cf522ff
Split out code into separate files.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Sat, 04 Feb 2012 13:29:31 +1030 |
parents | 9404b9869c27 |
children | be0a1ac64d97 |
comparison
equal
deleted
inserted
replaced
7:9404b9869c27 | 8:58d76cf522ff |
---|---|
1 #ifndef LCD_H_ | 1 void lcd_init(void); |
2 #define LCD_H_ | 2 void lcd_wr_reg(uint16_t index, uint16_t val); |
3 uint16_t lcd_rd_reg(uint16_t index); | |
4 uint16_t lcd_rd_data(int first); | |
5 void lcd_wr_data(uint16_t val); | |
6 void lcd_wr_startdata(uint16_t x, uint16_t y); | |
7 void lcd_setpwm(uint16_t val); | |
8 void lcd_pixel(uint16_t x, uint16_t y, uint16_t colour); | |
9 void lcd_circle(uint16_t x0, uint16_t y0, uint16_t radius, uint16_t colour); | |
10 void lcd_line(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t colour); | |
3 | 11 |
4 void LCD_init(void); | 12 #define LCD_HEIGHT 240 |
5 void LCD_WR_Reg(uint16_t index, uint16_t val); | 13 #define LCD_WIDTH 320 |
6 uint16_t LCD_RD_Reg(uint16_t index); | |
7 uint16_t LCD_RD_Data(int first); | |
8 void LCD_WR_Data(uint16_t val); | |
9 void LCD_WR_StartData(uint16_t x, uint16_t y); | |
10 void Delay(__IO uint32_t nCount); | |
11 | 14 |
12 /* Touch controller (TSC2046N) defines */ | 15 #define RGB24_565(R, G, B) (((((R) >> 3) & 0x1f) << 11) | ((((G) >> 2) & 0x3f) << 5) | (((B) >> 3) & 0x1f)) |
13 /* Mode/channel select defines */ | 16 #define LCD_WHITE RGB24_565(255, 255, 255) |
14 #define TP_READ_SEL(chan, mode, ref, pd) (0x80 | (((chan) & 0x07) << 4) | (((mode) & 0x01) << 3) | (((ref) & 0x01) << 2) | ((pd) & 0x03)) | 17 #define LCD_BLACK RGB24_565(0, 0, 0) |
15 | 18 #define LCD_RED RGB24_565(255, 0, 0) |
16 /* Channel select */ | 19 #define LCD_GREEN RGB24_565(0, 255, 0) |
17 #define TP_CHAN_TEMP0 0 | 20 #define LCD_BLUE RGB24_565(0, 0, 255) |
18 #define TP_CHAN_Y 1 | |
19 #define TP_CHAN_VBAT 2 | |
20 #define TP_CHAN_Z1 3 | |
21 #define TP_CHAN_Z2 4 | |
22 #define TP_CHAN_X 5 | |
23 #define TP_CHAN_AUX 6 | |
24 #define TP_CHAN_TEMP1 7 | |
25 | |
26 /* Mode select */ | |
27 #define TP_MODE_12 0 | |
28 #define TP_MODE_8 1 | |
29 | |
30 /* Reference type */ | |
31 #define TP_REF_DIFF 0 | |
32 #define TP_REF_SER 1 | |
33 | |
34 /* Power down mode */ | |
35 #define TP_PD_AUTO 0 | |
36 #define TP_PD_REF_OFF 1 | |
37 #define TP_PD_REF_ON 2 | |
38 #define TP_PD_ON 3 | |
39 | |
40 uint16_t TPRead(uint8_t type); | |
41 | |
42 uint16_t FlashReadID(void); | |
43 uint8_t FlashReadStatus(void); | |
44 | |
45 #define FL_BP0 (1<<2) | |
46 #define FL_BP1 (1<<3) | |
47 #define FL_BP2 (1<<4) | |
48 #define FL_BP3 (1<<5) | |
49 #define FL_BPL (1<<7) | |
50 void FlashWriteStatus(uint8_t status); | |
51 | |
52 void FlashWriteCtl(int enable); | |
53 | |
54 void lcd_setpwm(uint16_t val); | |
55 | |
56 #endif | |
57 |