1 /** 2 * \file 3 * 4 * \brief Monochrome graphic library NULL display device with framebuffer 5 * 6 * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. 7 * 8 * \asf_license_start 9 * 10 * \page License 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions are met: 14 * 15 * 1. Redistributions of source code must retain the above copyright notice, 16 * this list of conditions and the following disclaimer. 17 * 18 * 2. Redistributions in binary form must reproduce the above copyright notice, 19 * this list of conditions and the following disclaimer in the documentation 20 * and/or other materials provided with the distribution. 21 * 22 * 3. The name of Atmel may not be used to endorse or promote products derived 23 * from this software without specific prior written permission. 24 * 25 * 4. This software may only be redistributed and used in connection with an 26 * Atmel microcontroller product. 27 * 28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * POSSIBILITY OF SUCH DAMAGE. 39 * 40 * \asf_license_stop 41 * 42 */ 43 /* 44 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> 45 */ 46 47 #ifndef GFX_MONO_NULL_H 48 #define GFX_MONO_NULL_H 49 50 #include "gfx_mono.h" 51 #include "gfx_mono_framebuffer.h" 52 53 #ifdef __cplusplus 54 extern "C" { 55 #endif 56 57 /** 58 * \ingroup asfdoc_common2_gfx_mono 59 * \defgroup asfdoc_common2_gfx_mono_null NULL display device 60 * 61 * This module provides empty read/write functions to a null device 62 * (framebuffer in RAM), removing the need for an actual display or 63 * controller during testing, and enabling the use of most XMEGA boards. 64 * 65 * @{ 66 */ 67 68 #define GFX_MONO_LCD_WIDTH 128 69 #define GFX_MONO_LCD_HEIGHT 32 70 #define GFX_MONO_LCD_PIXELS_PER_BYTE 8 71 #define GFX_MONO_LCD_PAGES (GFX_MONO_LCD_HEIGHT / \ 72 GFX_MONO_LCD_PIXELS_PER_BYTE) 73 #define GFX_MONO_LCD_FRAMEBUFFER_SIZE ((GFX_MONO_LCD_WIDTH * \ 74 GFX_MONO_LCD_HEIGHT) / GFX_MONO_LCD_PIXELS_PER_BYTE) 75 76 #define gfx_mono_draw_horizontal_line(x, y, length, color) \ 77 gfx_mono_generic_draw_horizontal_line(x, y, length, color) 78 79 #define gfx_mono_draw_vertical_line(x, y, length, color) \ 80 gfx_mono_generic_draw_vertical_line(x, y, length, color) 81 82 #define gfx_mono_draw_line(x1, y1, x2, y2, color) \ 83 gfx_mono_generic_draw_line(x1, y1, x2, y2, color) 84 85 #define gfx_mono_draw_rect(x, y, width, height, color) \ 86 gfx_mono_generic_draw_rect(x, y, width, height, color) 87 88 #define gfx_mono_draw_filled_rect(x, y, width, height, color) \ 89 gfx_mono_generic_draw_filled_rect(x, y, width, height, \ 90 color) 91 92 #define gfx_mono_draw_circle(x, y, radius, color, octant_mask) \ 93 gfx_mono_generic_draw_circle(x, y, radius, color, \ 94 octant_mask) 95 96 #define gfx_mono_draw_filled_circle(x, y, radius, color, quadrant_mask) \ 97 gfx_mono_generic_draw_filled_circle(x, y, radius, \ 98 color, quadrant_mask) 99 100 #define gfx_mono_put_bitmap(bitmap, x, y) \ 101 gfx_mono_generic_put_bitmap(bitmap, x, y) 102 103 #define gfx_mono_draw_pixel(x, y, color) \ 104 gfx_mono_framebuffer_draw_pixel(x, y, color) 105 106 #define gfx_mono_get_pixel(x, y) \ 107 gfx_mono_framebuffer_get_pixel(x, y) 108 109 #define gfx_mono_init() \ 110 gfx_mono_null_init() 111 112 #define gfx_mono_put_page(data, page, column, width) \ 113 gfx_mono_framebuffer_put_page(data, page, column, width) 114 115 #define gfx_mono_get_page(data, page, column, width) \ 116 gfx_mono_framebuffer_get_page(data, page, column, width) 117 118 #define gfx_mono_put_byte(page, column, data) \ 119 gfx_mono_framebuffer_put_byte(page, column, data) 120 121 #define gfx_mono_get_byte(page, column) \ 122 gfx_mono_framebuffer_get_byte(page, column) 123 124 #define gfx_mono_mask_byte(page, column, pixel_mask, color) \ 125 gfx_mono_framebuffer_mask_byte(page, column, pixel_mask, color) 126 127 #define gfx_mono_put_framebuffer() \ 128 ; 129 130 void gfx_mono_null_init(void); 131 132 /** @} */ 133 134 #ifdef __cplusplus 135 } 136 #endif 137 138 #endif /* GFX_MONO_NULL_H */ 139