Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:22:44

0001 /* ---------------------------------------------------------------------------- */
0002 /*                  Atmel Microcontroller Software Support                      */
0003 /*                       SAM Software Package License                           */
0004 /* ---------------------------------------------------------------------------- */
0005 /* Copyright (c) 2015, Atmel Corporation                                        */
0006 /*                                                                              */
0007 /* All rights reserved.                                                         */
0008 /*                                                                              */
0009 /* Redistribution and use in source and binary forms, with or without           */
0010 /* modification, are permitted provided that the following condition is met:    */
0011 /*                                                                              */
0012 /* - Redistributions of source code must retain the above copyright notice,     */
0013 /* this list of conditions and the disclaimer below.                            */
0014 /*                                                                              */
0015 /* Atmel's name may not be used to endorse or promote products derived from     */
0016 /* this software without specific prior written permission.                     */
0017 /*                                                                              */
0018 /* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR   */
0019 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
0020 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
0021 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,      */
0022 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
0023 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
0024 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
0025 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
0026 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
0027 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
0028 /* ---------------------------------------------------------------------------- */
0029 
0030 /**
0031  * \file
0032  *
0033  * Interface for draw font on LCD.
0034  *
0035  */
0036 
0037 /**
0038  *
0039  * \section Purpose
0040  *
0041  * The font.h files declares a font structure and a LCDD_DrawChar function
0042  * that must be implemented by a font definition file to be used with the
0043  * LCDD_DrawString method of draw.h.
0044  *
0045  * The font10x14.c implements the necessary variable and function for a 10x14
0046  * font.
0047  *
0048  * \section Usage
0049  *
0050  * -# Declare a gFont global variable with the necessary Font information.
0051  * -# Implement an LCDD_DrawChar function which displays the specified
0052  *    character on the LCD.
0053  * -# Use the LCDD_DrawString method defined in draw.h to display a complete
0054  *    string.
0055  */
0056 
0057 #ifndef _LCD_FONT_
0058 #define _LCD_FONT_
0059 
0060 /*----------------------------------------------------------------------------
0061  *        Headers
0062  *----------------------------------------------------------------------------*/
0063 
0064 #include <stdint.h>
0065 
0066 /*----------------------------------------------------------------------------
0067  *        Types
0068  *----------------------------------------------------------------------------*/
0069 
0070 
0071 /** \brief Describes the font (width, height, supported characters, etc.) used by
0072  * the LCD driver draw API.
0073  */
0074 typedef struct _Font {
0075     /* Font width in pixels. */
0076     uint8_t width;
0077     /* Font height in pixels. */
0078     uint8_t height;
0079 } Font;
0080 
0081 /*----------------------------------------------------------------------------
0082  *        Variables
0083  *----------------------------------------------------------------------------*/
0084 
0085 /** Global variable describing the font being instanced. */
0086 extern const Font gFont;
0087 
0088 /*----------------------------------------------------------------------------
0089  *        Exported functions
0090  *----------------------------------------------------------------------------*/
0091 
0092 extern void LCDD_DrawChar(
0093     uint16_t *pCanvasBuffer,
0094     uint32_t x,
0095     uint32_t y,
0096     uint8_t c,
0097     uint32_t color);
0098 
0099 extern void LCD_DrawString(
0100     uint16_t *pCanvasBuffer,
0101     uint32_t dwX,
0102     uint32_t dwY,
0103     const uint8_t *pString,
0104     uint32_t color);
0105 
0106 
0107 #endif /* #ifndef LCD_FONT_ */
0108