📄 lcd.h
字号:
//////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004, Eyoka @ Microunit
// All Rights Reserved
//________________________________________________________________________
//
// FILENAME: lcd.h
// PROJECT: High-Resolution Video System On OMAP
// MODULE: MPU System
// DESCRIPTION: LCD Controller Interface.
// TARGET CPU: ARM-925T of OMAP5910
// VERSION: 0.2
//________________________________________________________________________
//
// REVISE HISTORY
// DATE VERSION AUTHOR DESCRIPTION
// 2004-11-08 0.2 Eyoka Checked.
// 2004-11-01 0.1 Eyoka Created.
//////////////////////////////////////////////////////////////////////////
#ifndef _LCD_H_
#define _LCD_H_
#include "datatypes.h"
/////////////////////////////////////////////////////////////////////
// TYPES
/////////////////////////////////////////////////////////////////////
typedef enum
{
MONO_2BPP = 0x00400002,
MONO_4BPP = 0x00400002,
MONO_8BPP = 0x00010002,
STN_2BPP = 0x00400000,
STN_4BPP = 0x00400000,
STN_8BPP = 0x00010000,
STN_12BPP = 0x00000000,
STN_16BPP = 0x01000000,
TFT_2BPP = 0x00C00080,
TFT_4BPP = 0x00C00080,
TFT_8BPP = 0x00800080,
TFT_12BPP = 0x00800080,
TFT_16BPP = 0x00000080
}
LCD_COLOR_MODE_t;
typedef struct tagLCD_PARAM
{
LCD_COLOR_MODE_t mode;
WORD width;
WORD height;
DWORD f1_addr;
DWORD f2_addr;
BYTE HBP;
BYTE HFP;
BYTE HSW;
BYTE IHS;
BYTE VBP;
BYTE VFP;
BYTE VSW;
BYTE IVS;
DWORD PCD;
}
LCD_PARAM;
/////////////////////////////////////////////////////////////////////
// LCD REGISTERS
/////////////////////////////////////////////////////////////////////
//======================================
// LCD Controller
//======================================
#define LCD_CONTROL REG32(0xFFFEC000)
#define LCD_TIMING0 REG32(0xFFFEC004)
#define LCD_TIMING1 REG32(0xFFFEC008)
#define LCD_TIMING2 REG32(0xFFFEC00C)
#define LCD_STATUS REG32(0xFFFEC010)
#define LCD_SUBPANEL REG32(0xFFFEC014)
//======================================
// LCD DMA Configuration
//======================================
#define DMA_LCD_CTRL REG16(0xFFFEDB00)
#define DMA_LCD_TOP_F1_L REG16(0xFFFEDB02)
#define DMA_LCD_TOP_F1_U REG16(0xFFFEDB04)
#define DMA_LCD_BOT_F1_L REG16(0xFFFEDB06)
#define DMA_LCD_BOT_F1_U REG16(0xFFFEDB08)
#define DMA_LCD_TOP_F2_L REG16(0xFFFEDB0A)
#define DMA_LCD_TOP_F2_U REG16(0xFFFEDB0C)
#define DMA_LCD_BOT_F2_L REG16(0xFFFEDB0E)
#define DMA_LCD_BOT_F2_U REG16(0xFFFEDB10)
/////////////////////////////////////////////////////////////////////
// LCD FUNCTIONS
/////////////////////////////////////////////////////////////////////
//___________________________________________________________________
// Function: LCD_Setup
// Usage: Setup LCD Interface.
// Parameters:
// pConfig pointer to LCD settings.
// Return Values: N/A
//___________________________________________________________________
// support TFT_16BPP, single frame buffer only.
void LCD_Setup(LCD_PARAM *pConfig);
//___________________________________________________________________
// Function: LCD_Enable
// Usage: Enable the LCD Controller.
// Parameters: N/A
// Return Values: N/A
//___________________________________________________________________
//
void LCD_Enable(BOOL bEnable);
//___________________________________________________________________
// Function: LCD_SetHBP
// Usage: Set Horizontal Back Porsh.
// Parameters:
// hbp Horizontal Back Porsh.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetHBP(int hbp);
//___________________________________________________________________
// Function: LCD_SetHFP
// Usage: Set Horizontal Front Porsh.
// Parameters:
// hfp Horizontal Front Porsh.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetHFP(int hfp);
//___________________________________________________________________
// Function: LCD_SetHSW
// Usage: Set Horizontal SynchroPulse Width.
// Parameters:
// hsw Horizontal SynchroPulse Width, 1<=hsw<=64
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetHSW(int hsw);
//___________________________________________________________________
// Function: LCD_SetWidth
// Usage: Set Pixel Per Line (LCD screen width).
// Parameters:
// width 16<=width<=1024, must be multiple of 16
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetWidth(int width);
//___________________________________________________________________
// Function: LCD_SetVBP
// Usage: Set Vertical Back Porsh.
// Parameters:
// vbp Vertical Back Porsh.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetVBP(int vbp);
//___________________________________________________________________
// Function: LCD_SetVFP
// Usage: Set Vertical Front Porsh.
// Parameters:
// vfp Vertical Front Porsh.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetVFP(int vfp);
//___________________________________________________________________
// Function: LCD_SetVSW
// Usage: Set Vertical SynchroPulse Width.
// Parameters:
// vsw Vertical SynchroPulse Width, 1<=vsw<=64
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetVSW(int vsw);
//___________________________________________________________________
// Function: LCD_SetHeight
// Usage: Set Line Per Panel (LCD screen height).
// Parameters:
// height 16<=height<=1024, must be multiple of 16
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetHeight(int height);
//___________________________________________________________________
// Function: LCD_InvertAC
// Usage: Invert output enable
// Parameters:
// bInvert TRUE: LCD.AC pin is active low.
// FALSE: LCD.AC pin is active high.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_InvertAC(BOOL bInvert);
//___________________________________________________________________
// Function: LCD_InvertPCLK
// Usage: Invert pixel clock
// Parameters:
// bInvert TRUE: driven on the falling edge of LCD.PCLK.
// FALSE: driven on the rising edge of LCD.PCLK.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_InvertPCLK(BOOL bInvert);
//___________________________________________________________________
// Function: LCD_InvertHS
// Usage: Invert HSYNC
// Parameters:
// bInvert TRUE: LCD.HS pin is active low.
// FALSE: LCD.HS pin is active high.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_InvertHS(BOOL bInvert);
//___________________________________________________________________
// Function: LCD_InvertVS
// Usage: Invert VSYNC
// Parameters:
// bInvert TRUE: LCD.VS pin is active low.
// FALSE: LCD.VS pin is active high.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_InvertVS(BOOL bInvert);
//___________________________________________________________________
// Function: LCD_SetPCD
// Usage: Set LCD pixel clock divider
// Parameters:
// divider 2<=divider<=255
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetPCD(int divider);
//___________________________________________________________________
// Function: LCD_SetColorMode
// Usage: Set LCD color mode.
// Parameters:
// mode color mode, see LCD_COLOR_MODE_t.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetColorMode(LCD_COLOR_MODE_t mode);
//___________________________________________________________________
// Function: LCD_SetF1
// Usage: Set address of frame buffer 1.
// Parameters:
// top_addr top address.
// bot_addr bottom address.
// Return Values: N/A
//___________________________________________________________________
//
void LCD_SetF1(DWORD top_addr, DWORD bot_addr);
#endif // ifndef _LCD_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -