Mstar系列画OSD工具说明
- 格式:pdf
- 大小:223.34 KB
- 文档页数:6
ZUI Framework GuidelineEngin Lee 2008/3/7ZUI Framework Guideline (1)Introduction (3)ZUI and State Machine (3)ZUI state transitions (4)Calling Sequence (5)ZUI public functions: (5)State machine body: (8)UI control window procedures: (8)ZUI drawing functions: (10)Layers (Subsystems) (11)UI Controls (For MStar UI style) (12)MainFrame: (EN_ZUI_MAINFRAMEWINPROC) (12)Default Window: (EN_ZUI_DEFAULTWINPROC) (12)Top Icon (EN_ZUI_TOPICON_WINPROC) (13)Transparent Background Rectangle: (EN_ZUI_BGTRANSPARENT_WINPROC) 14 Dynamic List: (EN_ZUI_DYNAMICLIST2_WINPROC) (14)Dynamic Text: (EN_ZUI_DYNAMICTEXT_WINPROC) (14)Ball Progress Bar: (EN_ZUI_BALLPROGRESSBAR_WINPROC) (15)OSD Pages (For MStar UI style) (16)Restrictions (19)Basic Rules (19)Coding rules (19)Working flow (20)UI design tool (SkinTool) (21)SkinTool setup: (23)Create new OSD page: (23)Create new UI action (24)Create customized UI control (24)Create customized transition effect (24)File Folder Structure (24)ZUI data structures (26)enum E_OSD_ID (26)enum ZUI_STATE (26)enum EN_ZUI_WNDPROC_ENUM (26)enum MESSAGE_ENUM (27)Enum DRAWCOMPONENT (27)enum DRAWSTYLE_TYPE (27)enum KEYWNDNAV (28)Structure MSG (28)Structure DOUBLE_BUFFER (28)Constant: (28)ZUI functions (29)ZUI public functions (29)Message management functions (31)General Window Operations: (33)Window Position/Size management: (35)Timer operations: (37)Focus management function: (38)GDI functions: (39)Drawing functions: (42)Global handler: (43)Main Menu handler: (47)References (50)IntroductionThis document is the design guideline for UI development for MStar DVB-T project. Include the UI framework structure and the UI design tool.ZUI and State MachineIn this project, there is a “top state machine” for controlling all the state machines. For each state machine, it stands for a specific function/application.Some applications (like Teletext, MHEG5 and subtitle), they directly use GE/GOP functions in order to display some information.For other applications (like Menu, Input Source, EPG), they are UI applications. Four items they only handle with ZUI:1.Startup OSD page2.Process key3.Execute window actions4.Shutdown OSD pageZUI service is an independent state from top state machine, because most of the state machines need to operate UI.Some state (ex: Menu state) create more than one OSD page. It is better to separate the OSD into individual pages for reusing and simplify the UI layout.There is a message/event queue maintained by ZUI internally, some UI operation will post message into the queue, and wait for next time dispatcher to different window procedure.ZUI service has its own state machine. When system boot up, it is “unknown ” state. And then enter “Standby ” state after initialization.There will be nothing to execute in “Standby ” state, only wait for request of OSD page.ZUI serviceTop State MachineSubtitleMenuInstall GuideMHEG5 Teletext Channel List EPGGE / GOPZUI API/CTL functions ZUI ACT osd pages Key event / actionFlow control Input SourceZUI_MainDispatchWinProc API StateStateStateIf a specific OSD pages requested, it will setup the data structure for that page, and enter “running”state to process/dispatch messages in the message queue.Transition effect scheme is considered in the flow. We can do some simple animation during “Transition effect doing” state. After the duration, the state goes to “Transition effect end” state and wait for termination.ZUI service stateUnknownStandbyRunningTransition Effect DoingTransition Effect EndTerminateCalling SequenceZUI public functions:Initialization: (called when system is booting up)Post Key Event: (called when IR/keypad event occurred, this function will put this event into the message queue, and wait for ZUI_Main to process/dispatch it.)Startup OSD Page: (called when state machine flow request to change to a specific OSD page. This function will shutdown previous OSD page and then setup current page for displaying. ) Shutdown OSD Page (called when state machine flow request to close current OSD page. This function will notify the terminate function in the OSD page, and then destroy the GWIN and data structures for the OSD page. ):Execute Action: (called when state machine flow request to execute a specific UI action for the current OSD page. For example: recheck the status and repaint the result.)ZUI Main Task: (called after returning from state machine. This is the entrance of ZUI framework. In this function, it dispatches the message to current OSD page (in “running” state). If there is no message to dispatch, it will start to repaint dirty/invalidate region of the screen (please reference function _MApp_ZUI_CTL_MainFramePaint). And then check the registered timer for sending timer event.State machine body:Main Menu state machine: (called in Menu state in Top state machine. Basically, a state machine only controls the flow of the machine, show/hide OSD pages, and post the key event into ZUI framework. )Other UI application state machines will be very similar as Menu state.UI control window procedures:Default Window Procedure: (called by message/event dispatcher. Default window procedure has basic behaviors: (1) Paint static background and text. (2) Execute action. (3) NavigationUp/Down/Left/Right. )MainFrame Window Procedure: (On Paint) (called by ZUI main task. MainFrame is a special UI control. It prepares an off-screen buffer, and send paint message for each UI control. After all, it update the dirty/invalidate region to on-screen buffer.Dynamic Text control window procedure: (called by message/event dispatcher. This UI control overrides the paint message for displaying dynamic text. )ZUI drawing functions:Draw Style list: (called from Default window procedure. Style list is collection of drawing component. This function will draw the components one by one.)Draw Component: (the same as Draw Dynamic Component) (based on different UI component: bitmap, fill rectangle, text, calling msAPI_OSD level functions for drawing. )Layers (Subsystems)We separate ZUI source codes into three parts:1. MApp_ZUI_API: providing the operations of UI controls. For example: show window, movewindow, invalidate window. These functions should be stable and not for special purposes.)2. MApp_ZUI_CTL: providing different kinds of UI controls. By overriding paint message and keydown message in window procedures, we can change the looking or behavior. These window procedures should be stable and not for special purposes.)3. MApp_ZUI_ACT: used for customization. We can write some code for specified UI skin or flow.For example: OSD page handler, transition effects and customized UI controls.GE / GOP API level functionsTimer APIsMemory MIU APIs MApp_ZUI_APIMApp_ZUI_CTLMApp_ZUI_ACTUI Controls (For MStar UI style)For each kind of UI controls, it map to its-own window procedure function. All the UI message will be notified into window procedure. Like the following example:For this window procedure, paint message will be overridden, and execute some update while timer notified. We can choose to keep original behavior or not (by calling default window procedure)MainFrame: (EN_ZUI_MAINFRAMEWINPROC)This UI control is a special UI control. It controls the flow of the GWIN updating. It prepares anoff-screen buffer, and send paint message for each UI control. After all, it update the dirty/invalidate region to on-screen buffer.Default Window: (EN_ZUI_DEFAULTWINPROC)Default window procedure has basic behaviors: (1) Paint static background and text. (2) Execute action. (3) Navigation Up/Down/Left/Right. )All the drawing and behavior of default window are defined in table, for example:DRAWSTYLE _MP_TBLSEG_Zui_Full_Epg_Info_Page_Timerview_Icon_Normal_DrawStyle[] ={{ CP_FILL_RECT, CP_ZUI_FILL_RECT_INDEX_31 },{ CP_RECT_BORDER, CP_ZUI_RECT_BORDER_INDEX_16 }, { CP_TEXT_OUT, CP_ZUI_TEXT_OUT_INDEX_163 }, { CP_NOON, NULL }, };Above draw style structure composed by three part of UI component: (1) Fill rectangle background. (2) Rectangle border. (3) A text on the foreground.static const KEYEVENT _ZUI_TBLSEG _MENU_PICTURE_BACKLIGHT_KEY[] = {{VK_UP, EN_EXE_NOTIFY_PARENT_KEY_UP},{VK_DOWN, EN_EXE_NOTIFY_PARENT_KEY_DOWN}, {VK_RIGHT, EN_EXE_GOTO_ADJUST_BACKLIGHT}, {VK_SELECT, EN_EXE_GOTO_ADJUST_BACKLIGHT}, {VK_NULL, 0}, };Above example shown we bind some key with specific actionsHWND _MP_TBLSEG _MENU_ICON_PICTURENavigation[] = {HWND_MENU_ICON_APPLICATION, HWND_MENU_ICON_SOUND, HWND_MENU_ICON_PICTURE, HWND_MENU_PICTURE_PAGE};Above navigation structure composed by up/down/left/right direction navigation:Top Icon (EN_ZUI_TOPICON_WINPROC)For the icons of main menu, they can be rotatedd by left/right key and changed to bigger size when it got focus. So we wrote customized window procedure for this behavior.Application Icon Picture IconSound IconPicture PageTimer ViewingTransparent Background Rectangle: (EN_ZUI_BGTRANSPARENT_WINPROC)When the frame buffer created, we will fill the transparent color on it. But if the UI control position is changed, we need to fill up the transparent region. For example:Transparent Transparent Transparent1.Original2.Circle is appeared.3.Circle is disappeared, so we need to put a transparent rectangle behind the circle. In order to fill thebackground as transparent color.Dynamic List: (EN_ZUI_DYNAMICLIST2_WINPROC)In some pages, item will be hide or disabled on the list. So we create a container UI control to maintain the status of items. This UI control assume the first child is the focused position, and query the status of items by calling function MApp_ZUI_ACT_QueryDynamicListItemStatus()Dynamic Text: (EN_ZUI_DYNAMICTEXT_WINPROC)In the OSD page, some of the texts are static (that is, the text content will not be changed). But othertexts are dynamic. That means, we can change the content in the source code. This UI control query the string content by calling function MApp_ZUI_ACT_GetDynamicText()Ball Progress Bar: (EN_ZUI_BALLPROGRESSBAR_WINPROC)This UI control override paint message of default window procedure. It composed by round rectangle and bitmaps with different colors.Normal:Focused:DisabledOSD Pages (For MStar UI style)OSD Page Name Preview DescriptionMain Menu(E_OSD_MAIN_MENU) Main menu OSD pressed by menu key. It includes 6 icons and 7 dynamic page lists (include PC Mode). And also some common dialogs.Screen Saver:(E_OSD_SCREEN_SAVER) A moving dynamic text in order to notify user when video signal is disabled.Channel Info:(E_OSD_CHANNEL_INFO) When user change the channel or input source, there are top banner and bottom banner for displayingchannel/source/program information.Program Edit:(E_OSD_PROGRAM_EDIT) User canmove/delete/rename/hide channels by program edit.Auto Tuning:(E_OSD_AUTO_TUNING) Enter from main menu or install guide. It includes the scanning text and scan result text.Input Source:(E_OSD_INPUT_SOURCE) Enter by “source” key. User can select different kinds of sources.Channel List:(E_OSD_CHANNEL_LIST) A list of DTV/ATV/Radio channels, enter by “list”key.Audio Language:(E_OSD_AUDIO_LANGUAGE) Select audio types and languages; enter by “MTS” key.Subtitle Language:(E_OSD_SUBTITLE_LANGUAGE) Select subtitle languages; enter by “subcode” key.Install Guide:(E_OSD_INSTALL_GUIDE) Enter from main menu or first installation. Select language and country.Audio Volume:(E_OSD_AUDIO_VOLUME) Enter by pressing mute and vol+/- key inTV/MHEG5/Subtitle states.Hotkey:(E_OSD_HOTKEY_OPTION) Enter by pressingscale/audio/… inTV/MHEG5/subtitle statesMessage Box:(E_OSD_MESSAGE_BOX) General message from the system. For example: Waiting for MHEG5, No teletext, …EPG: (E_OSD_EPG) Enter by pressing “EPG”key.Factory Mode: (not yet implement) Enter by special IR keys. CI information: (not yet implement) Enter from main menu.RestrictionsCurrently, we use 8051 as our house keeping processor. Because of the limitation of CPU, we need to be careful for these cases:1.Keil C overlay option is enabled. So we cannot call the function recursively. And we cannot usefunction pointer, either.2.All the static variables are placed in XDATA segment, so does the variables inside the functions.So we need to minimize the usage.Basic RulesTo minimize the XDATA segment usage:1.Total count of UI controls are static, dynamic creation of UI control is not allowed. So in the UIdesign tool, we need to consider all visible UI controls.2.Basic fields of the UI controls: {X, Y, Width, Height, Normal Style, Focus Style, Disabled Style,Normal Alpha, Focus Alpha, Disabled Alpha, Parent, Initial State, Window Proc ID, Private Data, Navigations (Up, Down, Left, Right), Current Visible, Current Disable}. All of them are read only, except Current Visible, Current Disable and Position and Sizes. These attributes can be modified by API level functions, ex: MApp_ZUI_API_ShowWindow()To avoiding recursive call:1.GUI public functions, ex: MApp_ZUI_API_ShowWindow() cannot callMApp_ZUI_API_SendMessage() or call window procedure, can onlyMApp_ZUI_API_PostMessage()Avoiding function pointer:1.Add event handlers in the switch cases: ex: MApp_ZUI_ACT_ExecuteWndProc()Simplify the GWIN operations:e only one hardware GWIN for OSD. And create two frame buffers with the same sizes. It isbetter for GWIN management.Coding rules1.Separate ZUI source code into three parts: API, CTL and ACT. API providing the operations of theUI controls. CTL providing different kinds of drawing and behavior of UI controls. ACT is for customization. So please don’t write any special conditions in API and CTL part. Keep API and CTL region stable and generic.2.File name prefix is MApp_ZUI_3.The public interface of ZUI is MApp_ZUI_Main.h, providing necessary public function fromoutsize of ZUI. UI operation outside the ZUI is not allowed.4.To reduce the message queue usage, please add message filter in functionMApp_Menu_ACT_PostMessageFilter()5.All drawing flow is controlled by ZUI main task, so drawing is not allowed outside the windowprocedure. We can only draw something in paint message handler.6.For a single OSD page, we need to create an individual source file for handling it. Don’t access theUI controls belong to other pages.7.Editing generated INL files is not allowed, except three items: key events, window data, windowprocedure ID. All UI layout and settings should be based on SkinTool project file.8.Don’t hard code the position and size of UI controls, please use GetWindowRect for query windowposition.9.Don’t use any kind of delay in ZUI part. Please use timer register functions.10.Don’t assume any order relation of HWND. Please use the relation of parent/child11.Don’t call msAPI_OSD and other lower level drawing function. Please use the drawing functionsin MApp_ZUI_APIdraw.h12.Don’t maintain U32 timer inside UI source code. Please use timer management functions.Working flowIn this project, we use a UI design tool to speed up the development time. We can preview and edit the OSD pages on PC, and then generate all necessary files. Some of generated files will become a part of source code. (Read only table structures in code segment). And other files will become binary files and will be packed into a single file after linking.Here is the flow chart of development.UI design tool (SkinTool)The following is the UI design tool. We can import the bitmap and strings, and then add the UIcontrols into OSD pages. We can modify the attributes like background color, text color, text font and the border. By using this tool, we can roughly preview the UI result.GUIProject (*.xml)GWIN1 GWIN2 GWIN3Skin ToolPreview and Edit the layout and attributes*.INLConstant tableUsed for define UI layout, attributes and default behaviorBitmaps (*.bmp)Strings (*.est)Bitmap.bin Strings.bin Palette.binPalette (*.pal) (for I8 mode)Generate1. Create initial skin tool project3. Generate INL files4. Binding functions2. Modify UI layout5. Compile and testingHere is the property window. There are some common attributes we can modify, ex: positions, sizes, navigation, background and display text.Build Project Project Setting … Import Image Import String …Preview ModeStyle/TemplatePreview ResultUI control listCurrent OSD pageSkinTool setup:1.Execute Skintool.exe2.Open OSD_Resouce\SkinTool\res1366x768\ZUI.xml3.Select Library->Image Library->Relink to current bitmap folder4.Select Build->Build Table Option->Output path to current OSD setting folderCreate new OSD page:1.Execute SkinTool and then create new logic GWIN2.Put necessary UI controls on MAINFRAME3.Select “Build->Compile Table” for generating INL automatically.4.Include INL file in tables.h and table.c5.Add new enumeration ID in E_OSD_ID, ex: E_OSD_AUTO_TUNING6.Create source file for handling the OSD page, ex: MApp_ZUI_ACTautotuning.c7.Add switch-case inside MApp_ZUI_ACTglobal.c, ex: show, terminate, execute action… thesehandler8.Display and hide the page by calling StartupOSD and ShutdownOSDCreate new UI action1.Add new action ID in ZUI_exefunc.h (and also comments), ex:EN_EXE_GOTO_AUTO_TUNING2.Add the key binding in key map region of Tables_c.inl, ex: { VK_SELECT,EN_EXE_GOTO_AUTO_TUNING},3.Add handler for this action in necessary OSD page, ex:MApp_ZUI_ACT_ExecuteMainMenuAction()Create customized UI control1.Add new window procedure ID in ZUI_winproc_h.inl, ex:EN_ZUI_DYNAMICTEXT_WINPROC2.Add function body in ACT layer. We can choose to create new source file or append on a existedOSD page handler.3.Add switch case in MApp_ZUI_ACT_ExecuteWndProc()4.Check necessary message type in MApp_ZUI_ACT_PostMessageFilter()5.Check and modify window procedure ID in tables_c.inlCreate customized transition effect1.Add new transition effect ID in MApp_ZUI_ACTeffect.h, ex:EN_EFFMODE_MAIN_MENU_SHOWUP2.Define necessary transition steps in MApp_ZUI_ACTeffect.c, ex:MAIN_MENU_SHOW_UP_STEP = 163.Fill the implementation of the transition in MApp_ZUI_ACTeffect.c, to three function: Begin,Doing, End, ( _u8TransitionStep variable will count down from STEP-1 to 0, and then transition to target state in End4.Call MApp_ZUI_ACT_TransitionEffectBegin() function at necessary point.File Folder StructureWe create a folder for specific resolution and pixel format, ex: Bitmap1280x1024x565String file is put in String folder in OSD_Resource.And create a skin tool project file in SkinTool folder, which will import bitmaps and string file from Bitmap and String folder. Also SkinTool project is depended on specific resolution.Generated files should be put in specific resolution and pixel format, ex: UI\DVB_M\res1280x1024x565 folder.Inside \UI\DVB_M\osdcomposer\include, we include individual resource of resolutions. Also in\UI\DVB_M\MApp_ZUI_APItables.c, we include generated INL with depending resolution. Currently, we use UI_SKIN_SEL in board.h for choosing UI skin.ZUI data structuresenum E_OSD_IDEnumerator:E_OSD_EMPTYE_OSD_MAIN_MENUE_OSD_CHANNEL_INFOE_OSD_SCREEN_SAVERE_OSD_PROGRAM_EDITE_OSD_DTV_MANUAL_TUNINGE_OSD_ATV_MANUAL_TUNINGE_OSD_AUTO_TUNINGE_OSD_INPUT_SOURCEE_OSD_CHANNEL_LISTE_OSD_AUDIO_LANGUAGEE_OSD_SUBTITLE_LANGUAGEE_OSD_INSTALL_GUIDEE_OSD_AUDIO_VOLUMEE_OSD_HOTKEY_OPTIONE_OSD_MESSAGE_BOXE_OSD_TENKEY_NUMBERE_OSD_EPGE_OSD_MAXenum ZUI_STATEEnumerator:E_ZUI_STATE_UNKNOWE_ZUI_STATE_STANDBYE_ZUI_STATE_RUNNINGE_ZUI_STATE_TRANSEFF_DOINGE_ZUI_STATE_TRANSEFF_ENDE_ZUI_STATE_TERMINATEE_ZUI_STATE_MAXenum EN_ZUI_WNDPROC_ENUM Enumerator:EN_ZUI_MAINFRAMEWINPROCEN_ZUI_DEFAULTWINPROCEN_ZUI_MENUICON_WINPROCEN_ZUI_MENUROOT_WINPROCEN_ZUI_BGTRANSPARENT_WINPROCEN_ZUI_ROTATESTATIC_WINPROCEN_ZUI_DYNAMICLIST2_WINPROCEN_ZUI_MENUSIZETEXT_WINPROCEN_ZUI_MENUSIZEDYNAMICTEXT_WINPROCEN_ZUI_DYNAMICTEXT_WINPROCEN_ZUI_BALLPROGRESSBAR_WINPROCEN_ZUI_TOOLMENUROOT_WINPROCenum MESSAGE_ENUMEnumerator:MSG_NULLMSGMSG_KEYDOWNMSG_CREATEMSG_DESTROYMSG_PAINTMSG_NOTIFYMSG_NOTIFY_SHOWMSG_NOTIFY_HIDEMSG_NOTIFY_ENABLEMSG_NOTIFY_DISABLEMSG_NOTIFY_SETFOCUSMSG_NOTIFY_KILLFOCUSMSG_NOTIFY_MOVEDMSG_NOTIFY_KEYDOWNMSG_NOTIFY_CONTENT_CHANGEDMSG_TIMEREnum DRAWCOMPONENTEnumerator:CP_NOONCP_RECT_BORDERCP_FILL_RECTCP_RECT_BORDER_EXCP_RECT_3DCP_TEXT_OUTCP_BITMAPCP_ROUND_BARCP_WINDOWCP_RECTCP_DASH_BARCP_TRIANGLECP_CIRCLECP_ROUND_BORDERCP_TEXT_OUT_DYNAMICenum DRAWSTYLE_TYPEEnumerator:DS_NORMALDS_FOCUSDS_DISABLEenum KEYWNDNAVEnumerator:NAV_UPNAV_DOWNNAV_LEFTNAV_RIGHTStructure MSGHWND_MSG::hwndthe handle to the window which receives this message. MESSAGE_ENUM_MSG::messagethe message identifier.WPARAM_MSG::wParamThe parameter of the message (32-bit integer).Structure DOUBLE_BUFFERU8 bInit: 1U8 bUsed: 1U8 bLoadPalette: 1U8 bAllowFullScreenRelease: 1GRAPHIC_DC dcMainGRAPHIC_DC dcBuffU8 u8GWinIDRECT rcGWinConstant:#define MSG_FIRSTMSG 0x00#define MSG_LASTMSG 0xFF#define MSG_FIRSTKEYMSG 10#define MSG_LASTKEYMSG 19#define MSG_FIRSTCREATEMSG 20#define MSG_LASTCREATEMSG 29#define MSG_FIRSTPAINTMSG 30#define MSG_LASTPAINTMSG 39#define MSG_FIRSTCONTROLMSG 40#define MSG_LASTCONTROLMSG 99#define MSG_FIRSTSYSTEMMSG 100#define MSG_LASTSYSTEMMSG 109#define MAKEWPARAM(hiword, loword) (WPARAM)((U32)hiword<<16|(U32)loword)#define HIWORD(dword) ((dword >> 16)&0x0000FFFF)#define LOWORD(dword) (dword & 0x0000FFFF)#define WS_NONE 0x00None style.#define WS_VISIBLE BIT0Creates a window initially visible.#define WS_FOCUSABLE BIT1Creates a window can be focused.#define WS_DISABLED BIT2Creates a window initially disabled.#define HWND_MAINFRAME 0#define HWND_INVALID 0xFFFF#define SW_HIDE 0x00#define SW_SHOW 0x01typedef unsigned int HWNDHandle to main window or control.typedef const U16* LPCTSTRtypedef U16* LPTSTRZUI functionsZUI public functionsINTERFACE BOOLEAN MApp_ZUI_ACT_ExecuteWndAction ( U16 act )global MApp_ZUI_ACT_ExecuteWndAction execute a specific action. (this will dispatch by osd page) NOTE: DO NOT MODIFY THIS FUNCTION UNLESS YOU WANT TO ADD NEW OSD PAGE HANDLER!Parameters:[in]act U16 action IDReturns:BOOLEAN true for accept, false for ignoreAuthor:MStarSemiDate:2007/1/25INTERFACE void MApp_ZUI_ACT_ShutdownOSD ( void )global MApp_ZUI_ACT_ShutdownOSD shutdown and destory current osd page. (this function will change ZUI state) NOTE: DO NOT MODIFY THIS FUNCTION UNLESS YOU WANT TO ADD NEW OSD PAGE HANDLER!Returns:no return valueAuthor:MStarSemiDate:2007/1/25INTERFACE BOOLEAN MApp_ZUI_ACT_StartupOSD ( E_OSD_ID id )global MApp_ZUI_ACT_StartupOSD startup and setup a specific osd page NOTE: DO NOT MODIFY THIS FUNCTION UNLESS YOU WANT TO ADD NEW OSD PAGE HANDLER!Parameters:[in]id E_OSD_ID osd page indexReturns:BOOLEAN success or notAuthor:MStarSemiDate:2007/1/25INTERFACE BOOLEAN MApp_ZUI_CheckNeedDrawing ( void )global MApp_ZUI_CheckNeedDrawing determine drawing (GE/GOP operation) is needed or not Returns:BOOLEAN true for neededAuthor:MStarSemiDate:2007/3/2INTERFACE E_OSD_ID MApp_ZUI_GetActiveOSD ( void )public MApp_ZUI_GetActiveOSD query for the current OSD page in ZUI systemReturns:E_OSD_ID current osd pageAuthor:MStarSemiDate:2007/3/2INTERFACE ZUI_STATE MApp_ZUI_GetState ( void )public MApp_ZUI_GetState query current state of ZUIReturns:ZUI_STATE current stateAuthor:MStarSemiDate:2007/3/2INTERFACE BOOLEAN MApp_ZUI_Init ( void )global MApp_ZUI_Init ZUI system initializeReturns:BOOLEAN TRUE for success, FALSE for failAuthor:MStarSemiDate:2007/1/25INTERFACE ZUI_RET MApp_ZUI_MainTask ( void )global MApp_Menu_MainTask ZUI task/service entryReturns:ZUI_RET latest state for ZUI taskAuthor:MStarSemiDate:2007/1/25INTERFACE void MApp_ZUI_ProcessKey ( U8 u8IRKey )public MApp_ZUI_ProcessKey send a key event into message queueParameters:[in]u8IRKey U8 key codeReturns:no return valueAuthor:MStarSemiDate:2007/3/2Message management functionsINTERFACE S32 MApp_ZUI_API_DispatchMessage ( PMSG pMsg )global MApp_ZUI_API_DispatchMessage dispatch a message to a specified window handle Parameters:[in]pMsg PMSG message pointerReturns:S32 message execute resultAuthor:MStarSemiDate:2007/1/25INTERFACE void MApp_ZUI_API_EmptyMessageQueue ( void )global MApp_ZUI_API_EmptyMessageQueue empty the message queue...Returns:nothingAuthor:MStarSemiDate:2007/1/30INTERFACE BOOLEAN MApp_ZUI_API_GetMessage ( PMSG pMsg )public MApp_ZUI_API_GetMessage query the first message in the event queueParameters:[out]pMsg MSG window messageReturns:BOOLEAN true for exist, false for empty message queueAuthor:MStarSemiDate:2007/3/2INTERFACE BOOLEAN MApp_ZUI_API_PostMessage ( HWND hWnd,MESSAGE_ENUM iMsg,WPARAM wParam)global MApp_ZUI_API_PostMessage post a message to the message queue the message won't be executed immediatlyParameters:[in]hWnd HWND window handle[in]iMsg MESSAGE_ENUM message type[in]wParam WPARAM message parameterReturns:BOOLEAN TRUE for success, FALSE for failAuthor:MStarSemiDate:2007/1/25INTERFACE S32 MApp_ZUI_API_SendMessage ( HWND hWnd,MESSAGE_ENUM iMsg,WPARAM wParam)global MApp_ZUI_API_SendMessage send a message to the message queue the message will be executed immediatlyParameters:[in]hWnd HWND window handle[in]iMsg MESSAGE_ENUM message type[in]wParam WPARAM message paramterReturns:S32 message execute resultAuthor:MStarSemiDate:2007/1/25General Window Operations:INTERFACE BOOLEAN MApp_ZUI_API_EnableWindow ( HWND hwnd,BOOLEAN fEnable)global MApp_ZUI_API_EnableWindow enable/disable a windowParameters:[in]hwnd HWND target window handle[in]fEnable BOOLEAN TRUE for enable, FALSE for disableReturns:BOOLEAN TRUE for success, FALSE for failAuthor:MStarSemiDate:2007/1/25INTERFACE HWND MApp_ZUI_API_GetParent ( HWND child )global MApp_ZUI_API_GetParent get the hwnd of parentParameters:[in]child HWND child window handleReturns:HWND hwnd of parentAuthor:MStarSemiDate:2007/1/25INTERFACE U32 MApp_ZUI_API_GetWindowData ( HWND hwnd )INTERFACE void MApp_ZUI_API_InvalidateAllSuccessors ( HWND hwnd )global MApp_ZUI_API_InvalidateAllSuccessors mark a specified window (and its successors) as invalidatedParameters:[in]hwnd HWND window handleReturns:voidAuthor:MStarSemiDate:2007/1/25INTERFACE void MApp_ZUI_API_InvalidateRect ( const RECT * prc )global MApp_ZUI_API_InvalidateRect mark the rectangle region as invalidatedParameters:[in]prc const RECT * rectangle regionReturns:voidAuthor:MStarSemiDate:。
新买回来的计算机显示器,在默认参数作用下,一般很难会达到最佳的显示效果; 而且对于长期“服役”的显示器来说,由于受工作环境以及电磁干扰的长期影响,因此它也很难保证一直拥有不错的显示效果。
为了确保显示器始终处于最佳的显示状态,我们必须及时合理地对其进行调节控制。
那么我们该怎样根据计算机显示器自身的显示模式,来对其有针对性地掌控呢? 其实只要你能够善用OSD 菜单( 屏幕视控系统菜单) ,就可以很方便地掌控好显示器的显示效果了!多种方式,打开OSD 菜单一般情况下,不同生产厂家开发设计出来的OSD 菜单功能以及打开方式都是不一样的,但主要包含两种打开方式,一种是复合按键打开方式,另外一种就是单键飞梭打开方式; 此外,还有一些生产厂商为了增强本产品特色,而特意开发了其他独特的打开方式,例如快捷切换按钮方式等。
复合按键打开方式通常把各个显示功能按键,按照一定的顺序逐一排列在显示器下方,对于某些产品的显示器来说,只要你按下任意一个显示功能按键,就能轻松把OSD 菜单打开,也有一些显示器需要通过“ Menu ”功能按键才能打开OSD 菜单。
正常情况下,复合按键打开方式主要用于显示器生产厂商提供较多控制选项的场合,以便于能快速地选择调试选项,提高显示调节效率。
单键飞梭打开方式通常是借助显示器中的一个飞梭调节旋转按钮,来打开OSD 菜单的,显示器外壳上除了这个飞梭调节旋转按钮外,通常还有一个电源开关按钮。
一般情况下,单键飞梭打开的OSD 菜单通常都被设计成环状菜单框,这样用户只要通过旋转飞梭按钮,就能轻松、方便地选择调试选项了,因此这种打开方式具有调节容易、控制简单的优势; 但不可否认的是,由于所有功能选项选项的调用方式仅集中在一个按钮上,一旦该按钮失灵的话,那么整个OSD 控制系统就会统统失效,而且这种打开方式的开发设计成本也比较高。
善用OSD 菜单,调节亮度、对比度大家知道,显示器的亮度一般不能调节得太高,不然不但会影响显示器的使用寿命,而且还会对人眼的视力产生影响。
/// A panel struct type used to specify the panel attributes, and settings from Board layout1:const char *m_pPanelName;PanelName 屏的名称2:MS_U8 m_bPanelDither :1;Sub BK VOP_36, bPanelDither =1→0X2D05, bPanelDither =0→0X2D00 3: APIPNL_LINK_TYPE m_ePanelLinkType :4;Sub BK VOP_44 , LVDS =0x11, RSDS =0x004: m_bPanelDualPort :1;Sub VOP_43[0], MOD_94[1],5: MS_U8 m_bPanelSwapPort :1;Sub MOD_94[0]6: MS_U8 m_bPanelSwapOdd_ML :1;Sub MOD_92[12],蒙上灰7: MS_U8 m_bPanelSwapEven_ML :1;Sub MOD_92[14],蒙上灰8 : MS_U8 m_bPanelSwapOdd_RB :1;Sub MOD_92[11],缺色9: MS_U8 m_bPanelSwapEven_RB :1;Sub MOD_92[13],缺色11: MS_U8 m_bPanelSwapLVDS_POL :1;Sub MOD_80[5],正负极性切换12: MS_U8 m_bPanelSwapLVDS_CH :1;Sub MOD_80[6],双通道切换13: MS_U8 m_bPanelPDP10BIT :1;Sub MOD_80[3]14: MS_U8 m_bPanelLVDS_TI_MODE :1;Sub MOD_80[2], 说明当前的panel是不是TI mode15: MS_U8 m_ucPanelDCLKDelay;Sub MOD_94[8:11],16: MS_U8 m_bPanelInvDCLK :1;Sub MOD_94[4],17: MS_U8 m_bPanelInvDE :1;Sub MOD_94[2],18: MS_U8 m_bPanelInvHSync :1;Sub MOD_94[12]19: MS_U8 m_bPanelInvVSync :1;Sub MOD_94[3],20: MS_U8 m_ucPanelDCKLCurrent;Sub VOP_8E[6:7],21: MS_U8 m_ucPanelDECurrent;Sub VOP_8E[4:5],22: MS_U8 m_ucPanelODDDataCurrent;Sub VOP_8E[2:3]23:MS_U8 m_ucPanelEvenDataCurrent;Sub VOP_8E[0:1]24: MS_U16 m_wPanelOnTiming1;time between panel & data while turn on power25: MS_U16 m_wPanelOnTiming2;time between data & back light while turn on power26: MS_U16 m_wPanelOffTiming1;time between back light & data while turn off power27: MS_U16 m_wPanelOffTiming2;time between data & panel while turn off power28: MS_U8 m_ucPanelHSyncWidth;Sub VOP_02[7:0]29: MS_U8 m_ucPanelHSyncBackPorch;no register setting, provide value for query only, not support Manuel VSync Start/End nowVOP_04[10:0] VSync start = Vtt - VBackPorch –VsyncWidth, VOP_06[10:0] VSync end = Vtt – VbackPorch30: MS_U8 m_ucPanelVSyncWidth;MS_U8 m_ucPanelVBackPorch;31: MS_U16 m_wPanelHStart;Sub VOP_08[11:0],DE H Start (PANEL_HSYNC_WIDTH + PANEL_HSYNC_BACK_PORCH) 32: MS_U16 m_wPanelVStart;Sub VOP_0C[11:0]33: MS_U16 m_wPanelWidth;DE width (VOP_0A[11:0] = HEnd = HStart + Width - 1)34 :MS_U16 m_wPanelHeight;DE height (VOP_0E[11:0]= Vend = VStart + Height - 1)35: MS_U16 m_wPanelMaxHTotal;Reserved for future using.36: MS_U16 m_wPanelHTotal;Sub VOP_18[11:0]37: MS_U16 m_wPanelMinHTotal;Reserved for future using.38: MS_U16 m_wPanelMaxVTotal;Reserved for future using.39: MS_U16 m_wPanelVTotal;Sub VOP_1A[11:0]40: MS_U16 m_wPanelMinVTotal;Reserved for future using.41: MS_U8 m_dwPanelMaxDCLK;Reserved for future using.42: MS_U8 m_dwPanelDCLK;Sub LPLL_0F[23:0] ,{0x3100_10[7:0], 0x3100_0F[15:0]}43: MS_U8 m_dwPanelMinDCLK;Reserved for future using.44: MS_U16 m_wSpreadSpectrumStep;MS_U16 m_wSpreadSpectrumSpan;move to board define, no use now.45: MS_U8 m_ucDimmingCtl;MS_U8 m_ucMaxPWMVal;MS_U8 m_ucMinPWMVal;Initial Dimming Value/ Max Dimming Value/ Min Dimming Value46: MS_U8 m_bPanelDeinterMode :1;no use now47: E_PNL_ASPECT_RATIO m_ucPanelAspectRatio;Panel Aspect Ratio, provide information to upper layer application for aspect ratio setting.48: MS_U16 m_u16LVDSTxSwapValue;Sub MOD_E6[0:15],49: APIPNL_TIBITMODE m_ucTiBitMode;Sub MOD_96[1:0],当颜色不对的时候,就可以调整这个设定来试验。
MSTAR软件工具的使用方法精讲一、硬件环境准备在使用MSTAR软件工具前,需要准备以下硬件设备:1. 一台已安装好Windows系统的PC机。
2. 一个安装了MSTAR驱动程序的DisplayPort/HDMI/USB转换器,用于连接显示器和PC机。
具体的转换器型号和连接接口根据实际情况而定。
二、软件安装2.双击安装包,按照提示完成安装过程。
三、界面介绍1.打开MSTAR软件工具后,会出现主界面。
主界面分为左侧和中间两个部分。
-左侧显示屏选择区域,用于选择调试的显示器。
-中间显示屏操作区域,用于显示和调整显示器相关设置。
四、常用功能1.显示屏连接与选择- 将DisplayPort/HDMI/USB转换器插入PC机的对应接口。
-在左侧的显示屏选择区域中,点击“”按钮来并显示已连接的显示屏。
-在显示屏列表中选择需要调试的显示屏。
2.分辨率和刷新率调整-在中间的显示屏操作区域中,选择“分辨率”和“刷新率”的选项卡。
-选择合适的分辨率和刷新率组合,点击“应用”按钮保存设置。
3.亮度、对比度和颜色调整-在中间的显示屏操作区域中,选择“图像”选项卡。
-调整滑动条来改变亮度和对比度,并选择颜色模式。
-点击“应用”按钮保存设置。
4.OSD调整-在中间的显示屏操作区域中,选择“OSD”选项卡。
-可以调整与显示器相关的OSD设置,如显示模式、亮度、对比度等。
-点击“应用”按钮保存设置。
5.温度、电压和电流监测-在中间的显示屏操作区域中,选择“信息”选项卡。
-可以查看与显示器相关的温度、电压和电流信息。
八、总结通过以上介绍,我们对MSTAR软件工具的使用方法有了更加详细的了解。
通过简单的硬件环境准备和软件安装,我们可以在PC机上进行对显示器的调试和研发工作,并可以通过调整分辨率、刷新率、亮度、对比度等参数来达到预期的效果。
此外,还可以通过OSD功能进行显示模式的调整,以及通过信息功能监测显示器的温度、电压和电流等信息。
1、目前市场上的屏的分类目前数字p anel 按接口类型可分为T TL,LVDS,RSDS 接口,TTL 分为带T CON 信号和不带TCON 的接口。
按接口数量分,分为:signel port + 6bit/8bit,double port + 6bit/8bit/10bit的panel2、如何区分屏的接口类型很多初学者对于如何区分屏的接口类型很是头疼,是LVDS 屏,TTL屏还是RSDS屏?总是很难搞清出。
如何快速识别出液晶屏的接口类型则需要一些经验的,下面从屏的屏线接口的样式来对接口类型做出分类的介绍,帮助大家快速识别屏的接口类型。
以下方法是个人认识,不足之处请大家谅解。
(1)TTL屏接口样式:D6T(单6位TTL):31扣针,41扣针。
对应屏的尺寸主要为笔记本液晶屏(8寸,10寸,11寸,12寸),还有部分台式机屏15寸为41扣针接口。
S6T(双6位TTL):30+45针软排线,60扣针,70扣针,80扣针。
主要为台式机的14寸,15寸液晶屏。
D8T(单8位TTL):很少见S8T(双8位TTL):有,很少见80扣针(14寸,15寸)(2)LVDS屏接口样式:D6L(单6位LVDS):14插针,20插针,14片插,30片插(屏显基板100欧姆电阻的数量为4个)主要为笔记本液晶屏(12寸,13寸,14寸,15寸)D8L(单8位LVDS):20插针(5个100欧姆)(15寸)S6L(双6位LVDS):20插针,30插针,30片插(8个100欧姆)(14寸,15寸,17寸)S8L(双8位LVDS):30插针,30片插(10个100欧姆电阻)(17寸,18寸,19寸,20寸,21寸)S10L(双10位LVDS): 34插针,34片插(3)RSDS屏接口样式:50排线,双40排线,30+50排线。
主要为(15寸,17寸)液晶屏。
3、点屏四要素确保不烧屏:(1)将线材都连接好后,测量板卡以及屏的电源与地是否短路(2)测量屏线两组数据线之间电阻是否有100欧左右(3)看下板卡上面跳冒是否与屏电压一至(4)以上确认无误后,拔掉屏端的屏线,上电开机后,测量下板卡屏线的电压是否与你调的跳冒一致,若一致则断电后插上屏线,再次上电开机即可,否则板卡硬件有差异找硬件工程师协助处理。
⏹ 技术原理讲解⏹技术案例分析拟制:时间:TSUM56AWL 技术说明一、概述:TSUM56AWL芯片是MSTAR方案的一种支持高端宽屏液晶显示器芯片,支持VGA,SVGA,WXGA+等多种显示方式。
它支持第7代最新PANEL。
该方案显示器为调频技术,亮度,对比度,色彩更加均匀。
显示响应速度更快。
本机采用微处理器智能控制,数字调节,电可擦除存储器记忆调节参数。
关机后参数不丢失,可同时记忆多种不同显示参数。
该机心板设计可以支持15、17、19宽屏等液晶显示器,只需要更换部分IC和MCU软件;二、技术参数:2.1 输入电源电压范围: 90--264Vac, 50/60Hz2.2 输入信号:视频R, G, B模拟量输入, 0.7Vp-p/TTL 75Ω+/-10%DVI差分数字信号2.3 同步范围:行: 30~80KHZ场: 60~75HZ2.4最佳分辨率: 1440*900 60HZ2.3视频带宽: 106.5MHZ2.4电源电压范围:100~240VAC 50/60HZ2.5工耗: <40WSTANDBY&SUSPEND:P≤3W;OFF: P≤3W2.7PANEL:三星PI190M2L01 Panel2.8 点距: 408.24(H)*255.15(V)MM mm2.9对比度: 700:1; 亮度:300CD/M22,10 可视角度:左右140度,上下130度。
2.12工作温度: 0—40°储存温度: -20--60°工作湿度: 20—80%储存湿度: 5--80%2.13响应时间:8MS三、工作原理:本机电路结果分两块。
主板,与高压板。
按功能区分的整机方框图见下图。
以下我们对各部分电路分别进行介绍。
3.1 主板电路3.1.1 视频信号输入VGA端口同步信号以及RGB模拟信号通过匹配电阻、偶合电容,进入SCALER,进行信号放大数模转换。
DVI数字信号,直接进入SCALER 芯片进行图像处理。
以 ‘Mstar Genrator V1.250’工具版本为准说明描述
一、 说明描述‘Font Editor'模块界面功能如图:(做字体工具界面介绍)
画(看)字体 的 原始 尺寸 框
每一小格代表一个像素
字库所用颜色表的显示
(图1)
图1注:1.*.msf 文件是‘Mstar Genrator’工具产生的格式文件。
2.如果打开*.c 文件必须是数组格式文件,例如:code BYTE tCompressMonoFontData[] ={………………0x21(字体文件)…………………}。
(图2)
图2注:1.Chip 一般情况下选择第二项(MST 5151/5151A)。
2.‘B’切换字体着色的方式有两种:一种是前景色和背景色着色的方式;另一种表示鼠标左键和右键着什么色的方式。
(图3) 图3注:1.按‘C’键所产生的*.c 和*.h 文件就是程序中需要的字库文件。
(图4)
二、 说明描述‘Icon Converter'模块界面功能如图:(做位图工具界面介绍)
(图5)
图5注:1. Brower Mode1和Mode2功能上没有区别。
图6注:1.位图的宽度必须是12像素的倍素,高度必须是18像素的倍素。
2.两个颜色表针对颜色的对象是不一样的。
(图7)
图7注:1.位图导出的颜色表用的是第一个颜色表,也就是说第一个颜色表就是程序中此位图所用颜色的颜色表。
三、 说明描述‘List Edito'模块界面功能如图:
(图8)。