NiboRoboLib 3.6 - NIBO Library
gfx.h
gehe zur Dokumentation dieser Datei
1 /* BSD-License:
2 
3 Copyright (c) 2007 by Nils Springob, nicai-systems, Germany
4 
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10  * Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12  * Redistributions in binary form must reproduce the above copyright notice,
13  this list of conditions and the following disclaimer in the documentation
14  and/or other materials provided with the distribution.
15  * Neither the name nicai-systems nor the names of its contributors may be
16  used to endorse or promote products derived from this software without
17  specific prior written permission.
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 */
32 
44 #ifndef NIBO_GFX_H_
45 #define NIBO_GFX_H_
46 #if defined(NIBO_USE_GFX) || defined (DOXYGEN)
47 
48 #include <stdint.h>
49 #include <avr/pgmspace.h>
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 enum {
56  GFX_DM_JAM1=0,
57  GFX_DM_JAM2=1,
58  GFX_DM_COMP=2,
59  GFX_DM_JAM1_INV=4,
60  GFX_DM_JAM2_INV=5,
61  GFX_DM_COMP_INV=6
62 };
63 
68 void gfx_init();
69 
73 uint8_t gfx_get_x();
74 
78 uint8_t gfx_get_y();
79 
85 void gfx_move(uint8_t x, uint8_t y);
86 
91 void gfx_draw_mode(uint8_t mode);
92 
97 void gfx_fill(uint8_t val);
98 
104 uint8_t gfx_char_width(char ch);
105 
111 uint8_t gfx_text_width(const char *txt);
112 
118 uint8_t gfx_text_width_P(PGM_P txt);
119 
124 void gfx_print_char(char c);
125 
130 void gfx_print_text(const char *txt);
131 
136 void gfx_print_text_P(PGM_P txt);
137 
144 void gfx_draw_xbm(uint8_t width, uint8_t height, uint8_t * data);
145 
152 void gfx_draw_xbm_P(uint8_t width, uint8_t height, PGM_P data);
153 
158 void gfx_set_proportional(uint8_t prop);
159 
164 uint8_t gfx_get_proportional(void);
165 
170 void gfx_hline(uint8_t length);
171 
176 void gfx_vline(uint8_t length);
177 
183 void gfx_box(uint8_t width, uint8_t height);
184 
190 void gfx_lineTo(uint8_t x, uint8_t y);
191 
196 void gfx_pixel(uint8_t value);
197 
201 void gfx_term_clear();
202 
206 void gfx_term_clearLine();
207 
213 void gfx_term_goto(uint8_t col, uint8_t row);
214 
219 uint8_t gfx_term_getCol();
220 
225 uint8_t gfx_term_getRow();
226 
231 void gfx_term_scroll(uint8_t lines);
232 
237 void gfx_term_print(char * text);
238 
243 void gfx_term_print_P(PGM_P text);
244 
249 void gfx_term_writec(unsigned char c);
250 
256 void gfx_term_write(const unsigned char * buf, unsigned int size);
257 
258 #ifdef __cplusplus
259 } // extern "C"
260 #endif
261 
262 #endif // NIBO_USE_GFX
263 #endif // NIBO_GFX_H_
264 
void gfx_term_clearLine()
uint8_t gfx_term_getCol()
void gfx_fill(uint8_t val)
void gfx_term_goto(uint8_t col, uint8_t row)
void gfx_vline(uint8_t length)
void gfx_draw_mode(uint8_t mode)
uint8_t gfx_get_x()
void gfx_term_write(const unsigned char *buf, unsigned int size)
void gfx_pixel(uint8_t value)
void gfx_print_text_P(PGM_P txt)
void gfx_term_print_P(PGM_P text)
uint8_t gfx_text_width_P(PGM_P txt)
void gfx_lineTo(uint8_t x, uint8_t y)
void gfx_term_writec(unsigned char c)
uint8_t gfx_term_getRow()
void gfx_term_print(char *text)
void gfx_draw_xbm_P(uint8_t width, uint8_t height, PGM_P data)
void gfx_hline(uint8_t length)
void gfx_init()
void gfx_print_text(const char *txt)
uint8_t gfx_get_proportional(void)
void gfx_set_proportional(uint8_t prop)
uint8_t gfx_text_width(const char *txt)
void gfx_box(uint8_t width, uint8_t height)
void gfx_print_char(char c)
uint8_t gfx_get_y()
uint8_t gfx_char_width(char ch)
void gfx_draw_xbm(uint8_t width, uint8_t height, uint8_t *data)
void gfx_term_clear()
void gfx_move(uint8_t x, uint8_t y)
void gfx_term_scroll(uint8_t lines)