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