Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lcd_dogm.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2010 Martin Mueller
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
24 
25 /*
26  initial version, needs polishing!
27 
28  3 line LCD at 3.3V
29 
30  EA DOGM163 <-> LPC2148 SPI1
31 
32  SI MOSI
33  CLK SCK
34  RS DRDY (used to switch cmd/data)
35  CSB SSEL
36 
37 */
38 
39 #include "display/lcd_dogm_hw.h"
40 #include "lcd_dogm.h"
41 
42 
43 void lcd_cmd(uint8_t command) {
44  uint32_t i;
45  for (i=0;i<20000;i++);
46  lcddogmSelect();
48  lcd_spi_tx(command);
49 }
50 
51 void lcd_data(uint8_t data) {
52  uint32_t i;
53  for (i=0;i<100000;i++);
54  lcddogmSelect();
56  lcd_spi_tx(data);
57 }
58 
59 void lcd_dogm_init( void ) {
60  uint32_t i;
61 
62  for (i=0;i<100000;i++);
64 
65  /* Write configuration */
74 
75  /* sample data */
76  lcd_data('C');
77  lcd_data('i');
78  lcd_data('r');
79  lcd_data('c');
80  lcd_data('l');
81  lcd_data('e');
82  lcd_data('C');
83  lcd_data('W');
84  lcd_data(' ');
85  lcd_data('9');
86  lcd_data('9');
87  lcd_data(' ');
88  lcd_data('1');
89  lcd_data('0');
90  lcd_data('.');
91  lcd_data('3');
92 
93  lcd_data('1');
94  lcd_data('2');
95  lcd_data('.');
96  lcd_data('6');
97  lcd_data(' ');
98  lcd_data('M');
99  lcd_data(' ');
100  lcd_data('1');
101  lcd_data('2');
102  lcd_data('+');
103  lcd_data('3');
104  lcd_data(' ');
105  lcd_data('1');
106  lcd_data('4');
107  lcd_data('9');
108  lcd_data('3');
109 
110  lcd_data('o');
111  lcd_data('k');
112  lcd_data(' ');
113  lcd_data('3');
114  lcd_data(' ');
115  lcd_data('0');
116  lcd_data('2');
117  lcd_data('1');
118  lcd_data(':');
119  lcd_data('3');
120  lcd_data('4');
121  lcd_data(' ');
122  lcd_data('1');
123  lcd_data('5');
124  lcd_data('0');
125  lcd_data('0');
126 }
127 
void lcd_data(uint8_t data)
Definition: lcd_dogm.c:51
#define lcddogmCmdMode()
Definition: lcd_dogm_hw.h:35
#define DOGM_FOLLOWER
Definition: lcd_dogm.h:13
#define DOGM_PWR_CTRL
Definition: lcd_dogm.h:12
#define DOGM_FUN_SET_1
Definition: lcd_dogm.h:10
#define lcddogmSelect()
Definition: lcd_dogm_hw.h:27
void lcd_cmd(uint8_t command)
Definition: lcd_dogm.c:43
void lcd_dogm_init_hw(void)
Definition: lcd_dogm_hw.c:61
unsigned long uint32_t
Definition: types.h:18
#define DOGM_ENTRY_MODE
Definition: lcd_dogm.h:18
void lcd_dogm_init(void)
Definition: lcd_dogm.c:59
void lcd_spi_tx(uint8_t data)
#define DOGM_DISP_ON
Definition: lcd_dogm.h:16
#define lcddogmDataMode()
Definition: lcd_dogm_hw.h:39
#define DOGM_CLEAR
Definition: lcd_dogm.h:17
unsigned char uint8_t
Definition: types.h:14
#define DOGM_CONTRAST
Definition: lcd_dogm.h:14
#define DOGM_BIAS_SET
Definition: lcd_dogm.h:11