summaryrefslogtreecommitdiff
path: root/bsp/nxp/lpc/lpc178x/drivers/drv_glcd.h
blob: 5a28ceb6b39fb445a104ae078bc69916086a5934 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*************************************************************************
 *
*    Used with ICCARM and AARM.
 *
 *    (c) Copyright IAR Systems 2008
 *
 *    File name   : drv_glcd.h
 *    Description : Graphical LCD driver include file
 *
 *    History :
 *    1. Date        : 6, March 2008
 *       Author      : Stanimir Bonev
 *       Description : Create
 *
 *
 *    $Revision: 24636 $
 *
 *    @Modify: NXP MCU Application Team - NguyenCao
 *    @Date: 04. March. 2011
 **************************************************************************/
#include "lpc_types.h"

#ifndef __GLCD_DRV_H
#define __GLCD_DRV_H

#ifndef EOF
#define EOF (-1)
#endif

typedef unsigned long U32;
typedef unsigned char U8;
typedef unsigned long Boolean;
/**
 * @brief A struct for Bitmap on LCD screen
 */
typedef struct _Bmp_t
{
  U32  H_Size;
  U32  V_Size;
  U32  BitsPP;
  U32  BytesPP;
  U32 *pPalette;
  U32 *pPicStream;
  U8 *pPicDesc;
} Bmp_t, *pBmp_t;

/**
 * @brief A struct for Font Type on LCD screen
 */

typedef struct _FontType_t
{
  U32 H_Size;
  U32 V_Size;
  U32 CharacterOffset;
  U32 CharactersNuber;
  U8 *pFontStream;
  U8 *pFontDesc;
} FontType_t, *pFontType_t;

typedef U32 LdcPixel_t, *pLdcPixel_t;

#define C_GLCD_REFRESH_FREQ     (60HZ)
#define C_GLCD_H_SIZE           480
#define C_GLCD_H_PULSE          2   //
#define C_GLCD_H_FRONT_PORCH    5   //
#define C_GLCD_H_BACK_PORCH     40  //
#define C_GLCD_V_SIZE           272
#define C_GLCD_V_PULSE          2
#define C_GLCD_V_FRONT_PORCH    8
#define C_GLCD_V_BACK_PORCH     8

#define C_GLCD_PWR_ENA_DIS_DLY  10000
#define C_GLCD_ENA_DIS_DLY      10000

//Cursor 64x64 pixels
#define CURSOR_H_SIZE 64
#define CURSOR_V_SIZE 64
//
#define CIRCLE_R  18


#define CRSR_PIX_32     0
#define CRSR_PIX_64     1
#define CRSR_ASYNC      0
#define CRSR_FRAME_SYNC 2

#define TEXT_DEF_TAB_SIZE 5

#define TEXT_BEL1_FUNC()

void GLCD_Init (void* VRAMBase);
void GLCD_SetPallet (const U32 * pPallete);
void GLCD_Ctrl (Bool bEna);
void GLCD_Cursor_Cfg(int Cfg);
void GLCD_Cursor_En(int cursor);
void GLCD_Cursor_Dis(int cursor);
void GLCD_Move_Cursor(int x, int y);
void GLCD_Copy_Cursor (const U32 *pCursor, int cursor, int size);
void GLCD_SetFont(pFontType_t pFont, LdcPixel_t Color, LdcPixel_t BackgndColor);
void GLCD_SetWindow(U32 X_Left, U32 Y_Up,
                    U32 X_Right, U32 Y_Down);
void GLCD_TextSetPos(U32 X, U32 Y);
void GLCD_TextSetTabSize(U32 Size);
static void LCD_SET_WINDOW (U32 X_Left, U32 X_Right,
                            U32 Y_Up, U32 Y_Down);
static void LCD_WRITE_PIXEL (U32 Pixel);
static Bool GLCD_TextCalcWindow (U32 * pXL, U32 * pXR,
                                    U32 * pYU, U32 * pYD,
                                    U32 * pH_Size, U32 * pV_Size);
void GLCD_LoadPic (U32 X_Left, U32 Y_Up, Bmp_t * pBmp, U32 Mask);
int _putchar (int c);


#endif // __GLCD_DRV_H