Subversion Repositories Projects

Rev

Rev 724 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
724 woggle 1
/*****************************************************************************
2
 *   Copyright (C) 2009 Peter "woggle" Mack, mac@denich.net                  *
3
 *   - original LCD control by Thomas "thkais" Kaiser                        *
4
 *   - special number formating routines taken from C-OSD                    *
5
 *      from Claas Anders "CaScAdE" Rathje                                   *
6
 *   - some extension, ellipse and circ_line by Peter "woggle" Mack          *
7
 *                                                                           *
8
 *   This program 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 of the License.          *
11
 *                                                                           *
12
 *   This program is distributed in the hope that it will be useful,         *
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
15
 *   GNU General Public License for more details.                            *
16
 *                                                                           *
17
 *   You should have received a copy of the GNU General Public License       *
18
 *   along with this program; if not, write to the                           *
19
 *   Free Software Foundation, Inc.,                                         *
20
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.               *
21
 *                                                                           *
22
 *****************************************************************************/
23
 
24
#ifndef _LCD_H
25
#define _LCD_H
26
 
27
//*****************************************************************************
28
// 
29
extern volatile uint8_t LCD_ORIENTATION;
30
 
31
extern uint8_t lcd_xpos;
32
extern uint8_t lcd_ypos;
33
 
34
//*****************************************************************************
35
// 
36
void LCD_Init (void);
37
 
38
void lcd_putc (uint8_t x, uint8_t y, uint8_t c, uint8_t mode);
39
//void send_byte (uint8_t data);
40
void lcd_print (uint8_t *text, uint8_t mode);
41
void lcd_print_at (uint8_t x, uint8_t y, uint8_t *text, uint8_t mode);
42
void lcd_printp (const char *text, uint8_t mode);
43
void lcd_printp_at (uint8_t x, uint8_t y, const char *text, uint8_t mode);
44
void lcd_printpns (const char *text, uint8_t mode);
45
void lcd_printpns_at (uint8_t x, uint8_t y, const char *text, uint8_t mode);
46
void lcd_cls (void);
47
 
48
// Jeti
49
void lcd_putc_jeti (uint8_t x, uint8_t y, uint8_t c, uint8_t mode);
50
void lcd_printpj (const char *text, uint8_t mode);
51
void lcd_printpj_at (uint8_t x, uint8_t y, const char *text, uint8_t mode);
52
 
53
void lcd_plot (uint8_t x, uint8_t y, uint8_t mode);
54
void lcd_line (unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2, uint8_t mode);
55
void lcd_rect (uint8_t x1, uint8_t y1, uint8_t widthx, uint8_t widthy, uint8_t mode);
56
void lcd_frect (uint8_t x1, uint8_t y1, uint8_t widthx, uint8_t widthy, uint8_t mode);
57
void lcd_circle (int16_t x0, int16_t y0, int16_t radius, uint8_t mode);
58
void lcd_fcircle (int16_t x0, int16_t y0, int16_t radius);
59
void lcd_circ_line (uint8_t x, uint8_t y, uint8_t r, uint16_t deg, uint8_t mode);
60
 
61
void lcd_ellipse (int16_t x0, int16_t y0, int16_t rx, int16_t ry, uint8_t mode);
62
void lcd_ellipse_line (uint8_t x, uint8_t y, uint8_t rx, uint8_t ry, uint16_t deg, uint8_t mode);
63
 
64
void lcd_ecircle (int16_t x0, int16_t y0, int16_t radius, uint8_t mode);
65
void lcd_ecirc_line (uint8_t x, uint8_t y, uint8_t r, uint16_t deg, uint8_t mode);
66
 
67
void lcd_view_font (uint8_t page);
68
void lcd_print_hex_at (uint8_t x, uint8_t y, uint8_t h, uint8_t mode);
69
 
70
void lcd_write_number_u (uint8_t number);
71
void lcd_write_number_u_at (uint8_t x, uint8_t y, uint8_t number);
72
 
73
/**
74
 * Write only some digits of a unsigned <number> at <x>/<y>
75
 * <length> represents the length to rightbound the number
76
 * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of   7
77
 */
78
void write_ndigit_number_u (uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad);
79
 
80
/**
81
 * Write only some digits of a signed <number> at <x>/<y>
82
 * <length> represents the length to rightbound the number
83
 * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of   7
84
 */
85
void write_ndigit_number_s (uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad);
86
 
87
/**
88
 * Write only some digits of a unsigned <number> at <x>/<y> as /10th of the value
89
 * <length> represents the length to rightbound the number
90
 * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 00.7 instead of   .7
91
 */
92
void write_ndigit_number_u_10th (uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad);
93
 
94
/**
95
 * Write only some digits of a unsigned <number> at <x>/<y> as /100th of the value
96
 * <length> represents the length to rightbound the number
97
 * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 00.7 instead of   .7
98
 */
99
void write_ndigit_number_u_100th (uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad);
100
 
101
/**
102
 * Write only some digits of a signed <number> at <x>/<y> as /10th of the value
103
 * <length> represents the length to rightbound the number
104
 * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 00.7 instead of   .7
105
 */
106
void write_ndigit_number_s_10th (uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad);
107
 
108
/**
109
 *  write <seconds> as human readable time at <x>/<y>
110
 */
111
void write_time (uint8_t x, uint8_t y, uint16_t seconds);
112
 
113
/**
114
 * wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude
115
 */
116
void write_gps_pos (uint8_t x, uint8_t y, int32_t position);
117
 
118
#endif