comparison lcd.h @ 4:2c87e30c982d

Add LCD init, touch screen writing etc.. PWM of LCD backlight doesn't work yet though..
author Daniel O'Connor <darius@dons.net.au>
date Tue, 03 Jan 2012 22:37:18 +1030
parents 74e9b3baac1e
children efa2c22266e3
comparison
equal deleted inserted replaced
3:74e9b3baac1e 4:2c87e30c982d
1 #ifndef LCD_H_ 1 #ifndef LCD_H_
2 #define LCD_H_ 2 #define LCD_H_
3 3
4 void LCD_init(void); 4 void LCD_init(void);
5 void LCD_WR_Reg(uint16_t index, uint16_t val);
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
10 /* Mode/channel select defines */
11 #define TP_READ_SEL(chan, mode, ref, pd) (0x80 | (((chan) & 0x07) << 4) | (((mode) & 0x01) << 3) | (((ref) & 0x01) << 2) | ((pd) & 0x03))
12
13 /* Channel select */
14 #define TP_CHAN_TEMP0 0
15 #define TP_CHAN_Y 1
16 #define TP_CHAN_VBAT 2
17 #define TP_CHAN_Z1 3
18 #define TP_CHAN_Z2 4
19 #define TP_CHAN_X 5
20 #define TP_CHAN_AUX 6
21 #define TP_CHAN_TEMP1 7
22
23 /* Mode select */
24 #define TP_MODE_12 0
25 #define TP_MODE_8 1
26
27 /* Reference type */
28 #define TP_REF_DIFF 0
29 #define TP_REF_SER 1
30
31 /* Power down mode */
32 #define TP_PD_AUTO 0
33 #define TP_PD_REF_OFF 1
34 #define TP_PD_REF_ON 2
35 #define TP_PD_ON 3
36
37 uint16_t TPRead(uint8_t type);
38
39 uint16_t FlashReadID(void);
40 uint8_t FlashReadStatus(void);
41
42 #define FL_BP0 (1<<2)
43 #define FL_BP1 (1<<3)
44 #define FL_BP2 (1<<4)
45 #define FL_BP3 (1<<5)
46 #define FL_BPL (1<<7)
47 void FlashWriteStatus(uint8_t status);
48
49 void FlashWriteCtl(int enable);
5 50
6 #endif 51 #endif
7 52