Hanna
Sourcecode Batteriemanagementsystem
gfx.h
gehe zur Dokumentation dieser Datei
1 
45 /*
46  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
47  */
48 
49 #ifndef GFX_H_INCLUDED
50 #define GFX_H_INCLUDED
51 
52 #include <assert.h>
53 #include <compiler.h>
54 #include <stdint.h>
55 
56 
57 # include <gfx_ili9341.h>
58 # include "gfx_generic.h"
59 # define CONF_GFX_USE_CLIPPING
60 
99 #define GFX_COLOR_BLACK GFX_COLOR( 0, 0, 0)
100 #define GFX_COLOR_WHITE GFX_COLOR(255, 255, 255)
101 #define GFX_COLOR_GRAY GFX_COLOR(128, 128, 128)
102 #define GFX_COLOR_LT_GRAY GFX_COLOR(220, 220, 220)
103 #define GFX_COLOR_RED GFX_COLOR(255, 0, 0)
104 #define GFX_COLOR_DK_RED GFX_COLOR(128, 0, 0)
105 #define GFX_COLOR_GREEN GFX_COLOR( 0, 255, 0)
106 #define GFX_COLOR_DK_GREEN GFX_COLOR( 0, 128, 0)
107 #define GFX_COLOR_BLUE GFX_COLOR( 0, 0, 255)
108 #define GFX_COLOR_DK_BLUE GFX_COLOR( 0, 0, 128)
109 #define GFX_COLOR_MAGENTA GFX_COLOR(255, 0, 255)
110 #define GFX_COLOR_DK_MAGENTA GFX_COLOR(128, 0, 128)
111 #define GFX_COLOR_YELLOW GFX_COLOR(255, 255, 0)
112 #define GFX_COLOR_DK_YELLOW GFX_COLOR(128, 128, 0)
113 #define GFX_COLOR_CYAN GFX_COLOR( 0, 255, 255)
114 #define GFX_COLOR_DK_CYAN GFX_COLOR( 0, 128, 128)
115 
124 #define GFX_OCTANT0 (1 << 0)
125 
127 #define GFX_OCTANT1 (1 << 1)
128 
130 #define GFX_OCTANT2 (1 << 2)
131 
133 #define GFX_OCTANT3 (1 << 3)
134 
136 #define GFX_OCTANT4 (1 << 4)
137 
139 #define GFX_OCTANT5 (1 << 5)
140 
142 #define GFX_OCTANT6 (1 << 6)
143 
145 #define GFX_OCTANT7 (1 << 7)
146 
148 #define GFX_QUADRANT0 (GFX_OCTANT0 | GFX_OCTANT1)
149 
151 #define GFX_QUADRANT1 (GFX_OCTANT2 | GFX_OCTANT3)
152 
154 #define GFX_QUADRANT2 (GFX_OCTANT4 | GFX_OCTANT5)
155 
157 #define GFX_QUADRANT3 (GFX_OCTANT6 | GFX_OCTANT7)
158 
160 #define GFX_LEFTHALF (GFX_QUADRANT3 | GFX_QUADRANT0)
161 
163 #define GFX_TOPHALF (GFX_QUADRANT0 | GFX_QUADRANT1)
164 
166 #define GFX_RIGHTHALF (GFX_QUADRANT1 | GFX_QUADRANT2)
167 
169 #define GFX_BOTTOMHALF (GFX_QUADRANT2 | GFX_QUADRANT3)
170 
172 #define GFX_WHOLE 0xFF
173 
177 
179 #define GFX_FLIP_X 1
180 
182 #define GFX_FLIP_Y 2
183 
185 #define GFX_SWITCH_XY 4
186 
201 #if defined(CONF_GFX_USE_CLIPPING) || defined(__DOXYGEN__)
202 extern gfx_coord_t gfx_min_x;
203 extern gfx_coord_t gfx_min_y;
204 extern gfx_coord_t gfx_max_x;
205 extern gfx_coord_t gfx_max_y;
206 #endif
207 
208 extern gfx_coord_t gfx_width;
209 extern gfx_coord_t gfx_height;
212 #if defined(__DOXYGEN__)
213 
229 void gfx_draw_bitmap(const struct gfx_bitmap *bmp, gfx_coord_t x,
230  gfx_coord_t y);
231 
272 void gfx_draw_bitmap_tiled(const struct gfx_bitmap *bmp, gfx_coord_t x1,
274  gfx_coord_t tile_origin_x, gfx_coord_t tile_origin_y);
275 
302 void gfx_put_bitmap(const struct gfx_bitmap *bmp, gfx_coord_t map_x,
303  gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y,
304  gfx_coord_t width,
305  gfx_coord_t height);
306 
325 void gfx_sync(void);
326 
348 void gfx_set_orientation(uint8_t flags);
349 
358 gfx_coord_t gfx_get_width(void);
359 
368 gfx_coord_t gfx_get_height(void);
369 
412 void gfx_set_clipping(gfx_coord_t min_x, gfx_coord_t min_y,
413  gfx_coord_t max_x, gfx_coord_t max_y);
414 
425 
436 
449  gfx_coord_t x2, gfx_coord_t y2);
450 
471 gfx_color_t gfx_color(uint8_t r, uint8_t g, uint8_t b);
472 
484 
497 
508 
518 void gfx_duplicate_pixel(gfx_color_t color, uint32_t count);
519 
528 void gfx_copy_pixels_to_screen(const gfx_color_t *pixels, uint32_t count);
529 
540 void gfx_copy_progmem_pixels_to_screen(gfx_color_t PROGMEM_PTR_T pixels,
541  uint32_t count);
542 
551 void gfx_copy_pixels_from_screen(gfx_color_t *pixels, uint32_t count);
552 
562 void gfx_set_ext_handler(gfx_ext_draw_handler_t gfx_ext_draw_handler);
563 
716 #else
717  gfx_coord_t gfx_get_width(void);
718 
719  gfx_coord_t gfx_get_height(void);
720 
721  void gfx_set_clipping(gfx_coord_t min_x, gfx_coord_t min_y,
722  gfx_coord_t max_x, gfx_coord_t max_y);
723 #endif
724 
725 
726 #endif /* GFX_H_INCLUDED */
Storage structure for bitmap pixel data and metadata.
Definition: gfx_generic.h:83
Generic graphic primitive routines.
#define gfx_draw_line_pixel(x, y, color)
Definition: gfx_ili9341.h:263
#define gfx_put_bitmap(bmp, map_x, map_y, x, y, width, height)
Definition: gfx_ili9341.h:216
#define gfx_set_top_left_limit(x, y)
Definition: gfx_ili9341.h:270
gfx_coord_t gfx_width
Definition: gfx_ili9341.c:60
#define gfx_set_bottom_right_limit(x, y)
Definition: gfx_ili9341.h:276
Commonly used includes, types and macros.
#define gfx_sync()
Definition: gfx_ili9341.h:327
gfx_coord_t gfx_height
Definition: gfx_ili9341.c:60
#define gfx_draw_pixel(x, y, color)
Definition: gfx_ili9341.h:257
gfx_coord_t gfx_max_y
Definition: gfx_ili9341.c:62
#define gfx_get_pixel(x, y)
Definition: gfx_ili9341.h:251
#define gfx_set_ext_handler(ext_draw_handler)
Definition: gfx_ili9341.h:238
Graphic library configured for the SDT028ATFT LCD panel using the ILI9341 display controller...
gfx_coord_t gfx_max_x
Definition: gfx_ili9341.c:62
void(* gfx_ext_draw_handler_t)(struct gfx_bitmap const *bmp, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y)
Function pointer type for external bitmap draw handlers.
Definition: gfx_generic.h:113
#define gfx_duplicate_pixel(color, count)
Definition: gfx_ili9341.h:245
gfx_coord_t gfx_min_x
Definition: gfx_ili9341.c:61
#define gfx_copy_progmem_pixels_to_screen(pixels, count, swap)
Definition: gfx_ili9341.h:302
ili9341_coord_t gfx_coord_t
Data type representing a coordinate on the screen.
Definition: gfx_ili9341.h:58
#define gfx_copy_pixels_from_screen(pixels, count)
Definition: gfx_ili9341.h:295
#define gfx_copy_pixels_to_screen(pixels, count)
Definition: gfx_ili9341.h:288
#define gfx_set_limits(x1, y1, x2, y2)
Definition: gfx_ili9341.h:282
#define gfx_draw_bitmap(bmp, x, y)
Definition: gfx_ili9341.h:232
gfx_coord_t gfx_min_y
Definition: gfx_ili9341.c:61
#define gfx_draw_bitmap_tiled(bmp, x1, y1, x2, y2, tile_origin_x, tile_origin_y)
Definition: gfx_ili9341.h:223
ili9341_color_t gfx_color_t
Data type for color values native to the display.
Definition: gfx_ili9341.h:57
#define gfx_set_orientation(flags)
Definition: gfx_ili9341.h:315
#define gfx_color(r, g, b)
Definition: gfx_ili9341.h:309