annotate lcd.h @ 5:efa2c22266e3

PWM control LED backlight. Not sure why the AFIO clock needs to be on for this but not, say USART.
author Daniel O'Connor <darius@dons.net.au>
date Fri, 06 Jan 2012 09:46:28 +1030
parents 2c87e30c982d
children 9404b9869c27
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
74e9b3baac1e Jumbo commit to make things work.
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
1 #ifndef LCD_H_
74e9b3baac1e Jumbo commit to make things work.
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
2 #define LCD_H_
74e9b3baac1e Jumbo commit to make things work.
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
3
4
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
4 void LCD_init(void);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
5 void LCD_WR_Reg(uint16_t index, uint16_t val);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
6 uint16_t LCD_RD_Reg(uint16_t index);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
7 uint16_t LCD_RD_Data(int first);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
8 void LCD_WR_Data(uint16_t val);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
9
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
10 /* Mode/channel select defines */
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
11 #define TP_READ_SEL(chan, mode, ref, pd) (0x80 | (((chan) & 0x07) << 4) | (((mode) & 0x01) << 3) | (((ref) & 0x01) << 2) | ((pd) & 0x03))
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
12
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
13 /* Channel select */
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
14 #define TP_CHAN_TEMP0 0
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
15 #define TP_CHAN_Y 1
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
16 #define TP_CHAN_VBAT 2
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
17 #define TP_CHAN_Z1 3
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
18 #define TP_CHAN_Z2 4
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
19 #define TP_CHAN_X 5
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
20 #define TP_CHAN_AUX 6
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
21 #define TP_CHAN_TEMP1 7
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
22
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
23 /* Mode select */
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
24 #define TP_MODE_12 0
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
25 #define TP_MODE_8 1
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
26
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
27 /* Reference type */
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
28 #define TP_REF_DIFF 0
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
29 #define TP_REF_SER 1
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
30
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
31 /* Power down mode */
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
32 #define TP_PD_AUTO 0
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
33 #define TP_PD_REF_OFF 1
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
34 #define TP_PD_REF_ON 2
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
35 #define TP_PD_ON 3
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
36
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
37 uint16_t TPRead(uint8_t type);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
38
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
39 uint16_t FlashReadID(void);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
40 uint8_t FlashReadStatus(void);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
41
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
42 #define FL_BP0 (1<<2)
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
43 #define FL_BP1 (1<<3)
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
44 #define FL_BP2 (1<<4)
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
45 #define FL_BP3 (1<<5)
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
46 #define FL_BPL (1<<7)
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
47 void FlashWriteStatus(uint8_t status);
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
48
2c87e30c982d Add LCD init, touch screen writing etc..
Daniel O'Connor <darius@dons.net.au>
parents: 3
diff changeset
49 void FlashWriteCtl(int enable);
3
74e9b3baac1e Jumbo commit to make things work.
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
50
5
efa2c22266e3 PWM control LED backlight.
Daniel O'Connor <darius@dons.net.au>
parents: 4
diff changeset
51 void lcd_setpwm(uint16_t val);
efa2c22266e3 PWM control LED backlight.
Daniel O'Connor <darius@dons.net.au>
parents: 4
diff changeset
52
3
74e9b3baac1e Jumbo commit to make things work.
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
53 #endif
74e9b3baac1e Jumbo commit to make things work.
Daniel O'Connor <darius@dons.net.au>
parents:
diff changeset
54