1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/drivers/device/LCD.h Fri Aug 13 10:41:29 2010 +0100 1.3 @@ -0,0 +1,113 @@ 1.4 +/**************************************************************************** 1.5 +** 1.6 +** Name: LCD.h 1.7 +** 1.8 +** Description: 1.9 +** Declares user-callable functions for manipulating 1.10 +** dot-matrix LCD displays 1.11 +** 1.12 +** $Revision: $ 1.13 +** 1.14 +** Disclaimer: 1.15 +** 1.16 +** This source code is intended as a design reference which 1.17 +** illustrates how these types of functions can be implemented. It 1.18 +** is the user's responsibility to verify their design for 1.19 +** consistency and functionality through the use of formal 1.20 +** verification methods. Lattice Semiconductor provides no warranty 1.21 +** regarding the use or functionality of this code. 1.22 +** 1.23 +** -------------------------------------------------------------------- 1.24 +** 1.25 +** Lattice Semiconductor Corporation 1.26 +** 5555 NE Moore Court 1.27 +** Hillsboro, OR 97214 1.28 +** U.S.A 1.29 +** 1.30 +** TEL: 1-800-Lattice (USA and Canada) 1.31 +** (503)268-8001 (other locations) 1.32 +** 1.33 +** web: http://www.latticesemi.com 1.34 +** email: techsupport@latticesemi.com 1.35 +** 1.36 +** -------------------------------------------------------------------------- 1.37 +** 1.38 +** Change History (Latest changes on top) 1.39 +** 1.40 +** Ver Date Description 1.41 +** -------------------------------------------------------------------------- 1.42 +** 1.43 +** 3.0 Mar-25-2008 Added Header 1.44 +** 1.45 +**--------------------------------------------------------------------------- 1.46 +*****************************************************************************/ 1.47 + 1.48 +#ifndef LCD_H_ 1.49 +#define LCD_H_ 1.50 + 1.51 +#include "DDStructs.h" 1.52 + 1.53 +#ifdef __cplusplus 1.54 +extern "C" { 1.55 +#endif /* __cplusplus */ 1.56 + 1.57 + 1.58 +/* for direct read/write to the LCD */ 1.59 +void LCD_WriteData(volatile unsigned int * pAddress, unsigned int data); 1.60 + 1.61 + 1.62 +/* turns display on/off */ 1.63 +void LCD_DisplayOnOff(MicoGPIOCtx_t *pLCD, unsigned int bOn); 1.64 + 1.65 + 1.66 +/* turns cursor on/off */ 1.67 +void LCD_CursorOnOff(MicoGPIOCtx_t *pLCD, unsigned int bOn); 1.68 + 1.69 + 1.70 +/* turns blinking on/off */ 1.71 +void LCD_BlinkOnOff(MicoGPIOCtx_t *pLCD, unsigned int bOn); 1.72 + 1.73 + 1.74 +/* clears display */ 1.75 +void LCD_ClearDisplay(MicoGPIOCtx_t *pLCD); 1.76 + 1.77 + 1.78 +/* sets function */ 1.79 +void LCD_SetFunction(MicoGPIOCtx_t *pLCD, unsigned int iNumLines); 1.80 + 1.81 + 1.82 +/* sets cursor move mode */ 1.83 +void LCD_SetCursorMoveMode(MicoGPIOCtx_t *pLCD, unsigned int bIncrement); 1.84 + 1.85 + 1.86 +/* shifts display left or right by 1 */ 1.87 +void LCD_ShiftDisplay(MicoGPIOCtx_t *pLCD, unsigned int bLeft); 1.88 + 1.89 + 1.90 +/* shifts cursor left or right by 1 */ 1.91 +void LCD_ShiftCursor(MicoGPIOCtx_t *pLCD, unsigned int bLeft); 1.92 + 1.93 + 1.94 +/* writes a character to the display */ 1.95 +void LCD_WriteChar(MicoGPIOCtx_t *pLCD, unsigned char character); 1.96 + 1.97 + 1.98 +/* sets write-position (i.e. cursor position) */ 1.99 +void LCD_SetCursorPos(MicoGPIOCtx_t *pLCD, unsigned int iLine, unsigned int iCol); 1.100 + 1.101 + 1.102 +/* Initializes the LCD */ 1.103 +void LCD_Init(MicoGPIOCtx_t *pLCD, unsigned int iLines); 1.104 + 1.105 + 1.106 +/* writes a line to the LCD at the cursor position */ 1.107 +void LCD_WriteLine(MicoGPIOCtx_t *pLCD, const char *pLine); 1.108 + 1.109 + 1.110 +#ifdef __cplusplus 1.111 +} 1.112 +#endif /* __cplusplus */ 1.113 + 1.114 + 1.115 +#endif /*LCD_H_*/ 1.116 +