📄 osd.h
字号:
/* **********************************************************************
Copyright (c) 2002-2006 Beyond Innovation Technology Co., Ltd
All rights are reserved. Reproduction in whole or in parts is
prohibited without the prior written consent of the copyright owner.
----------------------------------------------------------------------
Module: OSD.H
Purpose: Interface of OSD.
Version: 0.01 11:02AM 2005/11/17
Compiler: Keil 8051 C Compiler v8.01
Reference:
[1] BIT1611B Datasheet Version 1.0, 2005-11-10, Beyond Innovation Technology
[2] MTV121 Super On-Screen-Display for LCD Monitor, Revision 5.0
06/29/1999 Myson Technology
----------------------------------------------------------------------
Modification:
R0.01 09:49AM 2005/11/17 Jeffrey Chang
Reason:
1. Original.
Solution:
********************************************************************** */
#ifndef _OSD_H_
#define _OSD_H_
/* ------------------------------------
Header Files
------------------------------------ */
#include "common.h"
#include "platform.h"
/* ------------------------------------
Macro Definitions
------------------------------------ */
#undef EXTERN
#ifdef _OSD_C_
#define EXTERN
#else
#define EXTERN extern
#endif
/* ::::::::::::::::::::::::::::::::::::
OSD Configuration
:::::::::::::::::::::::::::::::::::: */
#define OSD_WINDOW1 0x01
#define OSD_WINDOW2 0x02
#define OSD_WINDOW3 0x04
#define OSD_WINDOW_ALL (OSD_WINDOW1 | OSD_WINDOW2 | OSD_WINDOW3)
#define OSD_MESSAGE OSD_WINDOW1
#define OSD_MAINMENU OSD_WINDOW2
#define OSD_SUBMENU OSD_WINDOW3
/* .....................................
[2]49 OSD Windows Configuration
..................................... */
#define OSD_WINDOW1_WIDTH 9 // [1]115 X: in characters
#define OSD_WINDOW1_HEIGHT 2 // [1]115 Y: in rows
#define OSD_WINDOW2_WIDTH 12 // [1]115 X: in characters
#define OSD_WINDOW2_HEIGHT 5 // [1]115 Y: in rows
#define OSD_WINDOW3_WIDTH 25 // [1]115 X: in characters
#define OSD_WINDOW3_HEIGHT 2 // [1]115 Y: in rows
#define OSD_MESSAGE_WIDTH OSD_WINDOW1_WIDTH // [1]115 X: in characters
#define OSD_MESSAGE_HEIGHT OSD_WINDOW1_HEIGHT // [1]115 Y: in rows
#define OSD_MAINMENU_WIDTH OSD_WINDOW2_WIDTH // [1]115 X: in characters
#define OSD_MAINMENU_HEIGHT OSD_WINDOW2_HEIGHT // [1]115 Y: in rows
#define OSD_SUBMENU_WIDTH OSD_WINDOW3_WIDTH // [1]115 X: in characters
#define OSD_SUBMENU_HEIGHT OSD_WINDOW3_HEIGHT // [1]115 Y: in rows
#define OSD_WINDOW1_AREA (OSD_WINDOW1_WIDTH * OSD_WINDOW1_HEIGHT)
#define OSD_WINDOW2_AREA (OSD_WINDOW2_WIDTH * OSD_WINDOW2_HEIGHT)
#define OSD_WINDOW3_AREA (OSD_WINDOW3_WIDTH * OSD_WINDOW3_HEIGHT)
#define OSD_WINDOW1_BASE 0
#define OSD_WINDOW2_BASE (OSD_WINDOW1_BASE + OSD_WINDOW1_AREA)
#define OSD_WINDOW3_BASE (OSD_WINDOW2_BASE + OSD_WINDOW2_AREA)
#define OSD_LAST_BASE (OSD_WINDOW3_BASE + OSD_WINDOW3_AREA)
#define OSD_BAR_WIDTH (OSD_WINDOW3_WIDTH - 2)
#if (OSD_LAST_BASE > 128)
#error OSD.H - OSD Display RAM Overflow !
#endif
#define OSD_MAD VP_MAD
/* .....................................
[1]116 OSD Palette Attribute Configuration
..................................... */
#define OSD_ATTR_NONE 0x00
#define OSD_BG_BLINK 0x01 // Background Blink
#define OSD_FG_FADE 0x02 // Foreground Fade
#define OSD_BG_LIMPIDITY 0x04 // Background Limpidity
#define OSD_FG_LIMPIDITY 0x08 // Foreground Limpidity
#define OSD_BORDER 0x10 // Border
/* .....................................
[1]116 OSD Palette Foreground Color Configuration
..................................... */
#define OSD_FG_NONE 0x00 // None
// R G B
#define OSD_FG_BLACK_RG 0x00 // Black RG 0+0 0 0 0
#define OSD_FG_BLACK_B 0x00 // Black B 0
#define OSD_FG_BLUE_RG 0x00 // Blue RG 0+0 0 0 1
#define OSD_FG_BLUE_B 0x38 // Blue B 7
#define OSD_FG_GREEN_RG 0x07 // Green RG 0+7 0 1 0
#define OSD_FG_GREEN_B 0x00 // Green B 0
#define OSD_FG_CYAN_RG 0x07 // Cyan RG 0+7 0 1 1
#define OSD_FG_CYAN_B 0x38 // Cyan B 7
#define OSD_FG_RED_RG 0x38 // Red RG 7+0 1 0 0
#define OSD_FG_RED_B 0x00 // Red B 0
#define OSD_FG_MAGENTA_RG 0x38 // Magenta RG 7+0 1 0 1
#define OSD_FG_MAGENTA_B 0x38 // Magenta B 7
#define OSD_FG_YELLOW_RG 0x3F // Yellow RG 7+7 1 1 0
#define OSD_FG_YELLOW_B 0x00 // Yellow B 0
#define OSD_FG_WHITE_RG 0x3F // White RG 7+7 1 1 1
#define OSD_FG_WHITE_B 0x38 // White B 7
#define OSD_FG_DARK_GREEN_RG 0x03 // Green RG 0+3 0 1 0
#define OSD_FG_DARK_GREEN_B 0x00 // Green B 0
/* .....................................
[1]116 OSD Palette Background Color Configuration
..................................... */
#define OSD_BG_NONE 0x00 // None
// R G B
#define OSD_BG_BLACK_R 0x00 // Black R 0 0 0 0
#define OSD_BG_BLACK_GB 0x00 // Black GB 0+0
#define OSD_BG_BLUE_R 0x00 // Blue R 0 0 0 1
#define OSD_BG_BLUE_GB 0x07 // Blue GB 0+7
#define OSD_BG_GREEN_R 0x00 // Green R 0 0 1 0
#define OSD_BG_GREEN_GB 0x38 // Green GB 7+0
#define OSD_BG_CYAN_R 0x00 // Cyan R 0 0 1 1
#define OSD_BG_CYAN_GB 0x3F // Cyan GB 7+7
#define OSD_BG_RED_R 0x07 // Red R 7 1 0 0
#define OSD_BG_RED_GB 0x00 // Red GB 0+0
#define OSD_BG_MAGENTA_R 0x07 // Magenta R 7 1 0 1
#define OSD_BG_MAGENTA_GB 0x07 // Magenta GB 0+7
#define OSD_BG_YELLOW_R 0x07 // Yellow R 7 1 1 0
#define OSD_BG_YELLOW_GB 0x38 // Yellow GB 7+0
#define OSD_BG_WHITE_R 0x07 // White R 7 1 1 1
#define OSD_BG_WHITE_GB 0x3F // White GB 7+7
/* .....................................
[1]116 OSD Palette RAM
..................................... */
// Palette 0 : OSD1_COLOR_NORMAL (FG: Green (G), BG: Black ())
#define OSD1_NM_ATTR (OSD_BORDER )
#define OSD1_NM_1 (OSD_FG_GREEN_RG )
#define OSD1_NM_2 (OSD_FG_GREEN_B | OSD_BG_BLACK_R )
#define OSD1_NM_3 (OSD_BG_BLACK_GB )
// Palette 1 : OSD1_COLOR_HILIGHT (FG: Yellow (R+G), BG: Black ())
#define OSD1_HL_ATTR (OSD_BORDER )
#define OSD1_HL_1 (OSD_FG_YELLOW_RG )
#define OSD1_HL_2 (OSD_FG_YELLOW_B | OSD_BG_BLACK_R )
#define OSD1_HL_3 (OSD_BG_BLACK_GB )
// Palette 2 : OSD2_COLOR_NORMAL (FG: Green (G), BG: Black ())
#define OSD2_NM_ATTR (OSD_BORDER )
#define OSD2_NM_1 (OSD_FG_GREEN_RG )
#define OSD2_NM_2 (OSD_FG_GREEN_B | OSD_BG_BLACK_R )
#define OSD2_NM_3 (OSD_BG_BLACK_GB )
// Palette 3 : OSD2_COLOR_HILIGHT (FG: Yellow (R+G), BG: Red)
#define OSD2_HL_ATTR (OSD_BORDER )
#define OSD2_HL_1 (OSD_FG_YELLOW_RG )
#define OSD2_HL_2 (OSD_FG_YELLOW_B | OSD_BG_RED_R )
#define OSD2_HL_3 (OSD_BG_RED_GB )
// Palette 4 : OSD3_COLOR_NORMAL (FG: Magenta (R+B), BG: White (R+B+G))
#define OSD3_NM_ATTR (OSD_ATTR_NONE )
#define OSD3_NM_1 (OSD_FG_MAGENTA_RG )
#define OSD3_NM_2 (OSD_FG_MAGENTA_B | OSD_BG_WHITE_R )
#define OSD3_NM_3 (OSD_BG_WHITE_GB )
// Palette 5 : OSD3_COLOR_HILIGHT (FG: Black (), BG: Yellow (R+G))
#define OSD3_HL_ATTR (OSD_ATTR_NONE )
#define OSD3_HL_1 (OSD_FG_BLACK_RG )
#define OSD3_HL_2 (OSD_FG_BLACK_B | OSD_BG_YELLOW_R )
#define OSD3_HL_3 (OSD_BG_YELLOW_GB )
// Palette 6 : OSD3_COLOR_ICON (FG: Red (R), BG: Yellow (R+G))
#define OSD3_IC_ATTR (OSD_ATTR_NONE )
#define OSD3_IC_1 (OSD_FG_RED_RG )
#define OSD3_IC_2 (OSD_FG_RED_B | OSD_BG_YELLOW_R )
#define OSD3_IC_3 (OSD_BG_YELLOW_GB )
// Palette 7 : OSD2_COLOR_LOGO (FG: White (R+G+B), BG: Black ())
#define OSD2_LG_ATTR (OSD_FG_FADE )
#define OSD2_LG_1 (OSD_FG_WHITE_RG )
#define OSD2_LG_2 (OSD_FG_WHITE_B | OSD_BG_BLACK_R )
#define OSD2_LG_3 (OSD_BG_BLACK_GB )
/* .....................................
[1]116 OSD Attribute Configuration
..................................... */
#define OSD_PALETTE_INDEX 0x0F
#define OSD_BANK0 0x00
#define OSD_BANK1 0x10
#define OSD_USER_FONT 0x10
#define OSD_FG_BLINK 0x20
#define OSD_BG_FADE 0x40
#define OSD1_COLOR_NORMAL (0 | OSD_BG_FADE )
#define OSD1_COLOR_HILIGHT (1 | OSD_BG_FADE )
#define OSD2_COLOR_NORMAL (2 | OSD_BG_FADE )
#define OSD2_COLOR_HILIGHT (3 | OSD_BANK0 )
#define OSD2_COLOR_LOGO (7 | OSD_BANK0 )
#define OSD3_COLOR_NORMAL (4 | OSD_BG_FADE )
#define OSD3_COLOR_HILIGHT (5 | OSD_BANK0 )
#define OSD3_COLOR_ICON (6 | OSD_BANK0 )
#define OSD3_COLOR_ICON_USER (6 | OSD_BANK1 )
#define OSD3_COLOR_USER (5 | OSD_BANK1 )
/* .....................................
[1]118 OSD Windows FADE Attribute
..................................... */
#define MAX_OSD_FADE_LEVEL 15 // OSD Transparent Level
#define MIN_OSD_FADE_LEVEL 0 // OSD Transparent Level
#define OSD1_FADE_LEVEL 0x02 // OSD Fade Level
#define OSD2_FADE_LEVEL 0x03 // OSD Fade Level
#define OSD3_FADE_LEVEL 0x08 // OSD Fade Level
/* .....................................
[1]118 OSD Windows BORDER Attribute
..................................... */
#define OSD_BORDER_RD 0x01 // Right Down
#define OSD_BORDER__D 0x02 // Down
#define OSD_BORDER_LD 0x04 // Left Down
#define OSD_BORDER_R_ 0x08 // Right
#define OSD_BORDER_L_ 0x10 // Left
#define OSD_BORDER_RU 0x20 // Right Up
#define OSD_BORDER__U 0x40 // Up
#define OSD_BORDER_LU 0x80 // Left Up
#define OSD_BORDER_ALL 0xFF
#define OSD1_BORDER (OSD_BORDER_RD | OSD_BORDER__D | OSD_BORDER_R_)
#define OSD2_BORDER OSD_BORDER_ALL
#define OSD3_BORDER OSD_BORDER_ALL
/* .....................................
[1]118 OSD Windows BORDER Width
..................................... */
#define OSD_BORDER_1PIXEL 0x00
#define OSD_BORDER_2PIXEL 0x01
#define OSD_BORDER_3PIXEL 0x02
#define OSD_BORDER_4PIXEL 0x03
#define OSD1_BORDER_HW OSD_BORDER_1PIXEL
#define OSD2_BORDER_HW OSD_BORDER_1PIXEL
#define OSD3_BORDER_HW OSD_BORDER_1PIXEL
#define OSD1_BORDER_VW OSD_BORDER_1PIXEL
#define OSD2_BORDER_VW OSD_BORDER_1PIXEL
#define OSD3_BORDER_VW OSD_BORDER_1PIXEL
/* .....................................
[1]118 OSD Windows BORDER COLOR
..................................... */
#define OSD_BORDER_COLOR_R 0x04
#define OSD_BORDER_COLOR_G 0x02
#define OSD_BORDER_COLOR_B 0x01
#define OSD_BORDER_COLOR_BLACK 0x00
#define OSD1_BORDER_COLOR OSD_BORDER_COLOR_BLACK
#define OSD2_BORDER_COLOR OSD_BORDER_COLOR_BLACK
#define OSD3_BORDER_COLOR OSD_BORDER_COLOR_BLACK
#define OSD1_BORDER_ATTR (OSD1_BORDER_COLOR << 4) | (OSD1_BORDER_VW << 2) | OSD1_BORDER_HW
#define OSD2_BORDER_ATTR (OSD2_BORDER_COLOR << 4) | (OSD2_BORDER_VW << 2) | OSD2_BORDER_HW
#define OSD3_BORDER_ATTR (OSD3_BORDER_COLOR << 4) | (OSD3_BORDER_VW << 2) | OSD3_BORDER_HW
/* .....................................
[1]118 OSD Windows Blink Period
..................................... */
#define OSD_BLINK_1VS 0x00
#define OSD_BLINK_2VS 0x01
#define OSD_BLINK_4VS 0x02
#define OSD_BLINK_8VS 0x03
#define OSD_BLINK_16VS 0x04
#define OSD_BLINK_32VS 0x05
#define OSD_BLINK_64VS 0x06
#define OSD_BLINK_128VS 0x07
/* .....................................
[1]118 OSD Windows Line Space
..................................... */
#define OSD1_LINE_SPACE 0
#define OSD2_LINE_SPACE 0
#define OSD3_LINE_SPACE 0
#define OSD1_LINE_BLINK (OSD1_LINE_SPACE << 4) | (OSD_BLINK_64VS << 1)
#define OSD2_LINE_BLINK (OSD2_LINE_SPACE << 4) | (OSD_BLINK_64VS << 1)
#define OSD3_LINE_BLINK (OSD3_LINE_SPACE << 4) | (OSD_BLINK_64VS << 1)
/* .....................................
[1]118 OSD Character Size
..................................... */
#define OSD_CHAR_SIZE_1X 0x00
#define OSD_CHAR_SIZE_2X 0x01
#define OSD_CHAR_SIZE_3X 0x02
#define OSD_CHAR_SIZE_4X 0x03
#define OSD_CHAR_SIZE_0X5ODD 0x04
#define OSD_CHAR_SIZE_0X5EVEN 0x05
#define OSD_CHAR_SIZE_0X5FIELD 0x06
// OSD1: 1H1V
#define OSD1_CHAR_SIZE_H OSD_CHAR_SIZE_1X
#define OSD1_CHAR_SIZE_V OSD_CHAR_SIZE_1X
// OSD2: 1H1V
#define OSD2_CHAR_SIZE_H OSD_CHAR_SIZE_1X
#define OSD2_CHAR_SIZE_V OSD_CHAR_SIZE_1X
// OSD3: 1H1V
#define OSD3_CHAR_SIZE_H OSD_CHAR_SIZE_1X
#define OSD3_CHAR_SIZE_V OSD_CHAR_SIZE_1X
#define OSD1_CHAR_SIZE (OSD1_CHAR_SIZE_V << 4) | OSD1_CHAR_SIZE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -