Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces 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 {
43  uint32_t i;
44  for (i = 0; i < 20000; i++);
45  lcddogmSelect();
47  lcd_spi_tx(command);
48 }
49 
51 {
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 {
61  uint32_t i;
62 
63  for (i = 0; i < 100000; i++);
65 
66  /* Write configuration */
75 
76  /* sample data */
77  lcd_data('C');
78  lcd_data('i');
79  lcd_data('r');
80  lcd_data('c');
81  lcd_data('l');
82  lcd_data('e');
83  lcd_data('C');
84  lcd_data('W');
85  lcd_data(' ');
86  lcd_data('9');
87  lcd_data('9');
88  lcd_data(' ');
89  lcd_data('1');
90  lcd_data('0');
91  lcd_data('.');
92  lcd_data('3');
93 
94  lcd_data('1');
95  lcd_data('2');
96  lcd_data('.');
97  lcd_data('6');
98  lcd_data(' ');
99  lcd_data('M');
100  lcd_data(' ');
101  lcd_data('1');
102  lcd_data('2');
103  lcd_data('+');
104  lcd_data('3');
105  lcd_data(' ');
106  lcd_data('1');
107  lcd_data('4');
108  lcd_data('9');
109  lcd_data('3');
110 
111  lcd_data('o');
112  lcd_data('k');
113  lcd_data(' ');
114  lcd_data('3');
115  lcd_data(' ');
116  lcd_data('0');
117  lcd_data('2');
118  lcd_data('1');
119  lcd_data(':');
120  lcd_data('3');
121  lcd_data('4');
122  lcd_data(' ');
123  lcd_data('1');
124  lcd_data('5');
125  lcd_data('0');
126  lcd_data('0');
127 }
128 
void lcd_data(uint8_t data)
Definition: lcd_dogm.c:50
#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:65
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:59
#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
struct mora_status_union::mora_status_struct data
#define DOGM_BIAS_SET
Definition: lcd_dogm.h:11