⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 Ȧ-

📁 基于Luminary的JPEG图片浏览器
💻
字号:
/******************************************************************************
**
** formike240x320x16_ili9320.h - Prototypes for the Formike Electronic
**                               KWH028Q02-F03 display driver with an ILI9320
**                               controller.
**
** Copyright (c) 2008 Luminary Micro, Inc.  All rights reserved.
** 
** Software License Agreement
** 
** Luminary Micro, Inc. (LMI) is supplying this software for use solely and
** exclusively on LMI's microcontroller products.
** 
** The software is owned by LMI and/or its suppliers, and is protected under
** applicable copyright laws.  All rights are reserved.  You may not combine
** this software with "viral" open-source software in order to form a larger
** program.  Any use in violation of the foregoing restrictions may subject
** the user to criminal sanctions under applicable laws, as well as to civil
** liability for the breach of the terms and conditions of this license.
** 
** THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
** OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
** LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
** CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
** 
** This is part of revision 2293 of the Stellaris Peripheral Driver Library.
**
******************************************************************************/

#ifndef __FORMIKE240X320X16_ILI9320_H__
#define __FORMIKE240X320X16_ILI9320_H__


/******************************************************************************
** 包含必要的头文件
******************************************************************************/
#include "..\HeadFile\hw_gpio.h"
#include "..\HeadFile\hw_memmap.h"
#include "..\HeadFile\hw_types.h"
#include "..\HeadFile\gpio.h"
#include "..\HeadFile\sysctl.h"
#include "..\HeadFile\grlib.h"



/*
** 定义LCM像素数宏                 
*/
#define  GUI_LCM_XMAX		240							/* 定义液晶x轴的点数 */
#define  GUI_LCM_YMAX		320							/* 定义液晶y轴的点数 */

/*
** 设置颜色宏定义
*/
#define   BLACK		0x0000      /* 黑色:    0,   0,   0 */
#define   NAVY		0x000F      /* 深蓝色:  0,   0, 128 */
#define   DGREEN	0x03E0		/* 深绿色:  0, 128,   0 */
#define   DCYAN		0x03EF		/* 深青色:  0, 128, 128 */
#define   MAROON	0x7800		/* 深红色:128,   0,   0 */
#define   PURPLE	0x780F		/* 紫色:  128,   0, 128 */
#define   OLIVE		0x7BE0 	    /* 橄榄绿:128, 128,   0 */
#define   LGRAY		0xC618	    /* 灰白色:192, 192, 192 */
#define   DGRAY		0x7BEF		/* 深灰色:128, 128, 128 */
#define   BLUE		0x001F		/* 蓝色:    0,   0, 255 */
#define   GREEN		0x07E0		/* 绿色:    0, 255,   0 */
#define   CYAN	        0x07FF 		/* 青色:    0, 255, 255 */
#define   RED		0xF800		/* 红色:  255,   0,   0 */
#define   MAGENTA	0xF81F		/* 品红:  255,   0, 255 */
#define   YELLOW	0xFFE0		/* 黄色:  255, 255, 0   */
#define   WHITE		0xFFFF      /* 白色:  255, 255, 255 */

#define   IDMCOLOR(color) (((color & 0x001F) << 11) | ((color & 0xF800) >> 11) | (color & 0x07E0))
/*
** 定义清屏色
*/
#define  GUIBACKCOLOR         BLACK


extern void Formike240x320x16_ILI9320Init(void);
extern void Formike240x320x16_ILI9320BacklightOn(void);
extern void Formike240x320x16_ILI9320BacklightOff(void);
//extern const tDisplay g_sFormike240x320x16_ILI9320;

/******************************************************************************
**
** Writes a command to the ILI9320.
**
******************************************************************************/
extern void WriteCommand(unsigned char ucData);

/*****************************************************************************
**
** Writes a data word to the ILI9320.
**
******************************************************************************/
extern void WriteData(unsigned short usData);

/*****************************************************************************
**
** Draws a pixel on the screen.
**
** \param pvDisplayData is a pointer to the driver-specific data for this
** display driver.
** \param lX is the X coordinate of the pixel.
** \param lY is the Y coordinate of the pixel.
** \param ulValue is the color of the pixel.
**
** This function sets the given pixel to a particular color.  The coordinates
** of the pixel are assumed to be within the extents of the display.
**
** \return None.
**
******************************************************************************/
extern void Formike240x320x16_ILI9320PixelDraw(void *pvDisplayData, long lX, long lY,
                                   unsigned long ulValue);

/*****************************************************************************
**
** Draws a horizontal sequence of pixels on the screen.
**
** \param pvDisplayData is a pointer to the driver-specific data for this
** display driver.
** \param lX is the X coordinate of the first pixel.
** \param lY is the Y coordinate of the first pixel.
** \param lX0 is sub-pixel offset within the pixel data, which is valid for 1
** or 4 bit per pixel formats.
** \param lCount is the number of pixels to draw.
** \param lBPP is the number of bits per pixel; must be 1, 4, or 8.
** \param pucData is a pointer to the pixel data.  For 1 and 4 bit per pixel
** formats, the most significant bit(s) represent the left-most pixel.
** \param pucPalette is a pointer to the palette used to draw the pixels.
**
** This function draws a horizontal sequence of pixels on the screen, using
** the supplied palette.  For 1 bit per pixel format, the palette contains
** pre-translated colors; for 4 and 8 bit per pixel formats, the palette
** contains 24-bit RGB values that must be translated before being written to
** the display.
**
** \return None.
**
******************************************************************************/
extern void Formike240x320x16_ILI9320PixelDrawMultiple(void *pvDisplayData, long lX,
                                           long lY, long lX0, long lCount,
                                           long lBPP,
                                           const unsigned char *pucData,
                                           const unsigned char *pucPalette);

/*****************************************************************************
**
** Draws a horizontal line.
**
** \param pvDisplayData is a pointer to the driver-specific data for this
** display driver.
** \param lX1 is the X coordinate of the start of the line.
** \param lX2 is the X coordinate of the end of the line.
** \param lY is the Y coordinate of the line.
** \param ulValue is the color of the line.
**
** This function draws a horizontal line on the display.  The coordinates of
** the line are assumed to be within the extents of the display.
**
** \return None.
**
******************************************************************************/
extern void Formike240x320x16_ILI9320LineDrawH(void *pvDisplayData, long lX1, long lX2,
                                   long lY, unsigned long ulValue);

/*****************************************************************************
**
** Draws a vertical line.
**
** \param pvDisplayData is a pointer to the driver-specific data for this
** display driver.
** \param lX is the X coordinate of the line.
** \param lY1 is the Y coordinate of the start of the line.
** \param lY2 is the Y coordinate of the end of the line.
** \param ulValue is the color of the line.
**
** This function draws a vertical line on the display.  The coordinates of the
** line are assumed to be within the extents of the display.
**
** \return None.
**
******************************************************************************/
extern void Formike240x320x16_ILI9320LineDrawV(void *pvDisplayData, long lX, long lY1,
                                   long lY2, unsigned long ulValue);


/*****************************************************************************
**
** Fills a rectangle.
**
** \param pvDisplayData is a pointer to the driver-specific data for this
** display driver.
** \param pRect is a pointer to the structure describing the rectangle.
** \param ulValue is the color of the rectangle.
**
** This function fills a rectangle on the display.  The coordinates of the
** rectangle are assumed to be within the extents of the display, and the
** rectangle specification is fully inclusive (in other words, both sXMin and
** sXMax are drawn, along with sYMin and sYMax).
**
** \return None.
**
******************************************************************************/
extern void Formike240x320x16_ILI9320RectFill(void *pvDisplayData, const tRectangle *pRect,
                                  unsigned long ulValue);

//*****************************************************************************
//
//! Fills a rectangle by a picture data which in the format of 16 bitRGB.
//!
//! \param pvDisplayData is a pointer to the driver-specific data for this
//! display driver.
//! \param pRect is a pointer to the structure describing the rectangle.
//! \param puiValue is a pointer to the color data of the rectangle.
//!
//! This function fills a rectangle on the display.  The coordinates of the
//! rectangle are assumed to be within the extents of the display, and the
//! rectangle specification is fully inclusive (in other words, both sXMin and
//! sXMax are drawn, along with sYMin and sYMax).
//!
//! \return None.
//
//*****************************************************************************
extern void Formike240x320x16_ILI9320PictureFill(tRectangle *psZone, unsigned short *puiValue, unsigned long ulCounter);

/*****************************************************************************
**
** Translates a 24-bit RGB color to a display driver-specific color.
**
** \param pvDisplayData is a pointer to the driver-specific data for this
** display driver.
** \param ulValue is the 24-bit RGB color.  The least-significant byte is the
** blue channel, the next byte is the green channel, and the third byte is the
** red channel.
**
** This function translates a 24-bit RGB color into a value that can be
** written into the display's frame buffer in order to reproduce that color,
** or the closest possible approximation of that color.
**
** \return Returns the display-driver specific color.
** 16bit/像素的RGB颜色数据 B:b15--b11 G:d10--d5 R:d4--d0
******************************************************************************/
extern unsigned long Formike240x320x16_ILI9320ColorTranslate(unsigned long ulValue);


/*********************************************************************************************************
** 函数名称: WriteString
** 功能描述: 显示一个字符串
** 输   入: StrAdr     字符串地址
**       x0     垂直线起点所在列的位置
**       y0     垂直线起点所在行的位置
**       color    显示颜色  
** 输   出: 无   
** 全局变量: 无
** 调用模块: WriteOneChar 向显示缓存区写一个字符
** 作   者: 张展威
** 日   期: 2008年7月22日
**-------------------------------------------------------------------------------------------------------
** 修 改 人:
** 日   期:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
extern void writeString(unsigned char *pcStr, unsigned short x0, unsigned short y0, unsigned short color);

#endif // __FORMIKE240X320X16_ILI9320_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -