]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h
Add SAMA5D2 Xplained IAR demo.
[freertos] / FreeRTOS / Demo / CORTEX_A5_SAMA5D2x_Xplained_IAR / AtmelFiles / utils / lcd_font.h
diff --git a/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h b/FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/utils/lcd_font.h
new file mode 100644 (file)
index 0000000..cfa7608
--- /dev/null
@@ -0,0 +1,112 @@
+/* ----------------------------------------------------------------------------\r
+ *         SAM Software Package License\r
+ * ----------------------------------------------------------------------------\r
+ * Copyright (c) 2015, Atmel Corporation\r
+ *\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions are met:\r
+ *\r
+ * - Redistributions of source code must retain the above copyright notice,\r
+ * this list of conditions and the disclaimer below.\r
+ *\r
+ * Atmel's name may not be used to endorse or promote products derived from\r
+ * this software without specific prior written permission.\r
+ *\r
+ * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR\r
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\r
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ * ----------------------------------------------------------------------------\r
+ */\r
+\r
+/**\r
+ * \file\r
+ *\r
+ * Interface for draw font on LCD.\r
+ *\r
+ */\r
+\r
+/**\r
+ * \addtogroup lcdd_font LCD Font Drawing\r
+ *\r
+ * \section Purpose\r
+ *\r
+ * The lcd_font.h files declares a font structure and a LCDD_DrawChar() function\r
+ * that must be implemented by a font definition file to be used with the\r
+ * lcdd_draw_string() method of draw.h.\r
+ *\r
+ * The font10x14.c implements the necessary variable and function for a 10x14\r
+ * font.\r
+ *\r
+ * \note Before drawing fonts, <b>canvas</b> should be selected via\r
+ *       LCDD_SelectCanvas(), or created by LCDD_CreateCanvas().\r
+ *\r
+ * \section Usage\r
+ *\r
+ * -# Declare a gFont global variable with the necessary Font information.\r
+ * -# Implement an LCDD_DrawChar() function which displays the specified\r
+ *    character on the LCD.\r
+ * -# Select or create canvas via LCDD_SelectCanvas() or LCDD_CreateCanvas().\r
+ * -# Use the lcdd_draw_string() method defined in draw.h to display a complete\r
+ *    string.\r
+ *\r
+ * \sa \ref lcdd_module, \ref lcdd_draw.\r
+ */\r
+\r
+#ifndef _LCD_FONT_\r
+#define _LCD_FONT_\r
+/** \addtogroup lcdd_font\r
+ *@{\r
+ */\r
+\r
+/*----------------------------------------------------------------------------\r
+ *        Headers\r
+ *----------------------------------------------------------------------------*/\r
+\r
+#include "font.h"\r
+\r
+#include <stdint.h>\r
+\r
+/*----------------------------------------------------------------------------\r
+ *        Types\r
+ *----------------------------------------------------------------------------*/\r
+\r
+/** \brief Describes the font (width, height, supported characters, etc.) used by\r
+ * the LCD driver draw API.\r
+ */\r
+struct _font {\r
+       uint8_t width;  /* Font width in pixels. */\r
+       uint8_t height; /* Font height in pixels. */\r
+};\r
+\r
+/*----------------------------------------------------------------------------\r
+ *        Variables\r
+ *----------------------------------------------------------------------------*/\r
+\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+ *        Exported functions\r
+ *----------------------------------------------------------------------------*/\r
+/** \addtogroup lcdd_font_func Font Functions */\r
+/** @{*/\r
+\r
+extern struct _font_parameters* lcdd_select_font (_FONT_enum font);\r
+\r
+extern uint8_t lcdd_get_selected_font (void);\r
+\r
+extern void lcdd_draw_char(uint32_t x, uint32_t y, uint8_t c, uint32_t color);\r
+\r
+extern void lcdd_draw_char_with_bgcolor(uint32_t x, uint32_t y, uint8_t c,\r
+                                    uint32_t fontColor, uint32_t bgColor);\r
+/** @}*/\r
+/**@}*/\r
+#endif                         /* #ifndef LCD_FONT_ */\r