Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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
();
46
lcddogmCmdMode
();
47
lcd_spi_tx
(command);
48
}
49
50
void
lcd_data
(
uint8_t
data
)
51
{
52
uint32_t
i;
53
for
(i = 0; i < 100000; i++);
54
lcddogmSelect
();
55
lcddogmDataMode
();
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++);
64
lcd_dogm_init_hw
();
65
66
/* Write configuration */
67
lcd_cmd
(
DOGM_FUN_SET_1
);
68
lcd_cmd
(
DOGM_BIAS_SET
);
69
lcd_cmd
(
DOGM_PWR_CTRL
);
70
lcd_cmd
(
DOGM_FOLLOWER
);
71
lcd_cmd
(
DOGM_CONTRAST
);
72
lcd_cmd
(
DOGM_DISP_ON
);
73
lcd_cmd
(
DOGM_CLEAR
);
74
lcd_cmd
(
DOGM_ENTRY_MODE
);
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
lcd_cmd
void lcd_cmd(uint8_t command)
Definition:
lcd_dogm.c:41
DOGM_PWR_CTRL
#define DOGM_PWR_CTRL
Definition:
lcd_dogm.h:12
lcd_dogm.h
lcddogmCmdMode
#define lcddogmCmdMode()
Definition:
lcd_dogm_hw.h:35
uint32_t
unsigned long uint32_t
Definition:
types.h:18
lcddogmSelect
#define lcddogmSelect()
Definition:
lcd_dogm_hw.h:27
DOGM_DISP_ON
#define DOGM_DISP_ON
Definition:
lcd_dogm.h:16
lcd_data
void lcd_data(uint8_t data)
Definition:
lcd_dogm.c:50
lcd_dogm_hw.h
DOGM_CLEAR
#define DOGM_CLEAR
Definition:
lcd_dogm.h:17
DOGM_FUN_SET_1
#define DOGM_FUN_SET_1
Definition:
lcd_dogm.h:10
lcd_spi_tx
void lcd_spi_tx(uint8_t data)
Definition:
lcd_dogm_hw.c:57
uint8_t
unsigned char uint8_t
Definition:
types.h:14
lcddogmDataMode
#define lcddogmDataMode()
Definition:
lcd_dogm_hw.h:39
lcd_dogm_init
void lcd_dogm_init(void)
Definition:
lcd_dogm.c:59
lcd_dogm_init_hw
void lcd_dogm_init_hw(void)
Definition:
lcd_dogm_hw.c:65
DOGM_ENTRY_MODE
#define DOGM_ENTRY_MODE
Definition:
lcd_dogm.h:18
DOGM_CONTRAST
#define DOGM_CONTRAST
Definition:
lcd_dogm.h:14
mora_status_union::data
struct mora_status_union::mora_status_struct data
DOGM_FOLLOWER
#define DOGM_FOLLOWER
Definition:
lcd_dogm.h:13
DOGM_BIAS_SET
#define DOGM_BIAS_SET
Definition:
lcd_dogm.h:11
sw
airborne
modules
display
lcd_dogm.c
Generated on Tue Feb 1 2022 13:51:15 for Paparazzi UAS by
1.8.17