00001 /* ---------------------------------------------------------------------------- 00002 * SAM Software Package License 00003 * ---------------------------------------------------------------------------- 00004 * Copyright (c) 2011, Atmel Corporation 00005 * 00006 * All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions are met: 00010 * 00011 * - Redistributions of source code must retain the above copyright notice, 00012 * this list of conditions and the disclaimer below. 00013 * 00014 * Atmel's name may not be used to endorse or promote products derived from 00015 * this software without specific prior written permission. 00016 * 00017 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00019 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00020 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00023 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00024 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00025 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00026 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 * ---------------------------------------------------------------------------- 00028 */ 00029 00030 /** 00031 * \file 00032 * 00033 * Interface for draw font on LCD. 00034 * 00035 */ 00036 00037 /** 00038 * 00039 * \section Purpose 00040 * 00041 * The font.h files declares a font structure and a LCDD_DrawChar function 00042 * that must be implemented by a font definition file to be used with the 00043 * LCDD_DrawString method of draw.h. 00044 * 00045 * The font10x14.c implements the necessary variable and function for a 10x14 00046 * font. 00047 * 00048 * \section Usage 00049 * 00050 * -# Declare a gFont global variable with the necessary Font information. 00051 * -# Implement an LCDD_DrawChar function which displays the specified 00052 * character on the LCD. 00053 * -# Use the LCDD_DrawString method defined in draw.h to display a complete 00054 * string. 00055 */ 00056 00057 #ifndef _LCD_FONT_ 00058 #define _LCD_FONT_ 00059 00060 /*---------------------------------------------------------------------------- 00061 * Headers 00062 *----------------------------------------------------------------------------*/ 00063 00064 #include <stdint.h> 00065 00066 /*---------------------------------------------------------------------------- 00067 * Types 00068 *----------------------------------------------------------------------------*/ 00069 00070 00071 /** \brief Describes the font (width, height, supported characters, etc.) used by 00072 * the LCD driver draw API. 00073 */ 00074 typedef struct _Font { 00075 /* Font width in pixels. */ 00076 uint8_t width; 00077 /* Font height in pixels. */ 00078 uint8_t height; 00079 } Font; 00080 00081 /*---------------------------------------------------------------------------- 00082 * Variables 00083 *----------------------------------------------------------------------------*/ 00084 00085 /** Global variable describing the font being instanced. */ 00086 extern const Font gFont; 00087 00088 /*---------------------------------------------------------------------------- 00089 * Exported functions 00090 *----------------------------------------------------------------------------*/ 00091 00092 extern void LCDD_DrawChar( 00093 uint16_t* pCanvasBuffer, 00094 uint32_t x, 00095 uint32_t y, 00096 uint8_t c, 00097 uint32_t color ); 00098 00099 extern void LCD_DrawString( 00100 uint16_t* pCanvasBuffer, 00101 uint32_t dwX, 00102 uint32_t dwY, 00103 const uint8_t *pString, 00104 uint32_t color ); 00105 00106 00107 #endif /* #ifndef LCD_FONT_ */ 00108