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

📄 menu.c

📁 BITEK DRIVER IC MENU CODE
💻 C
字号:
/* **********************************************************************

         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: MENU.C

    Purpose: Implementation of MENU.

    Version: 0.01                                   11:07AM  2005/11/17

    Compiler: Keil 8051 C Compiler v8.01

    Reference:
    [1] BIT1611B Data Sheet 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 11:02AM  2005/11/17 Jeffrey Chang
    Reason:
        1. Original.
    Solution:

   ********************************************************************** */

#define _MENU_C_

/* ------------------------------------
    Header Files
   ------------------------------------ */
#include "bitek.h"
#include "eeprom.h"
#include "intrins.h"
#include "led.h"
#include "menu.h"
#include "osd.h"
#include "platform.h"
#include "timer.h"


/* ------------------------------------
    Macro Definitions
   ------------------------------------ */

/* ------------------------------------
    Type Definitions
   ------------------------------------ */


/* ------------------------------------
    Variables Definitions
   ------------------------------------ */

/* ------------------------------------
    Function Prototypes
   ------------------------------------ */

/* -------------------------------------------------------------------
    Name: MENU_ClearMenu - (OSD_BIT1611B)
    Purpose: To clear specified MENU.
    Passed:
        UB8 bMenu = menu identifier.
    Returns: None.
    Notes:
   ------------------------------------------------------------------- */
void MENU_ClearMenu (UB8 bMenu)
{
    if (bMenu & MENU_MESSAGE)
        OSD_FillCharCode(OSD_WINDOW1_BASE, OSD_WINDOW1_AREA, ' ');

    if (bMenu & MENU_MAINMENU)
        OSD_FillCharCode(OSD_WINDOW2_BASE, OSD_WINDOW2_AREA, ' ');

    if (bMenu & MENU_SUBMENU)
        OSD_FillCharCode(OSD_WINDOW3_BASE, OSD_WINDOW3_AREA, ' ');
} /* MENU_ClearMenu */


/* -------------------------------------------------------------------
    Name: MENU_EnableMenu - (OSD_BIT1611B)
    Purpose: To enable/disable MENUs.
    Passed:

    Returns: None.
    Notes:
   ------------------------------------------------------------------- */
void MENU_EnableMenu (
UB8     bMenu,
BOOL    fOn
)
{
    if (bMenu & MENU_MAINMENU)
        OSD_EnableWindow(OSD_MAINMENU, fOn);

    if (bMenu & MENU_SUBMENU)
        OSD_EnableWindow(OSD_SUBMENU, fOn);

    if (bMenu & MENU_MESSAGE)
        OSD_EnableWindow(OSD_MESSAGE, fOn);
} /* MENU_EnableMenu */


/* -------------------------------------------------------------------
    Name: MENU_Init - (OSD_BIT1611B)
    Purpose: To initialize MENU module.
    Passed: None.
    Returns: None.
    Notes:
   ------------------------------------------------------------------- */
void MENU_Init (void)
{
	bMenuBaseItem       = 0;
	bMenuCurrentItem    = 0;
	bMenuLastItem       = 0;

	MENU_ShowMainMenuItem(bMenuBaseItem);
	MENU_UpdateMainMenuCursor(bMenuBaseItem, bMenuLastItem, bMenuCurrentItem);
} /* MENU_Init */


#if (MENU_SHOW_MAINMENUITEM)
/* -------------------------------------------------------------------
    Name: MENU_ShowMainMenuItem - (OSD_BIT1611B)
    Purpose: To show main menu items.
    Passed: bBase
    Returns: None.
    Notes:
   ------------------------------------------------------------------- */
void MENU_ShowMainMenuItem (UB8 bBase)
{
    UB8     bIdx;


    for (bIdx = 0; bIdx < OSD_MAINMENU_HEIGHT; bIdx++)
    {
        OSD_ShowMsg(MENU_MAINMENU,
                    0,
                    bIdx,
                    apbMainMenu[ bBase + bIdx ]);
    }
} /* MENU_ShowMainMenuItem */
#endif


#if (MENU_UPDATE_MAINMENUCURSOR)
/* -------------------------------------------------------------------
    Name: MENU_UpdateMainMenuCursor - (OSD_BIT1611B)
    Purpose: To update the main menu cursor item.
    Passed: None.
    Returns: None.
    Notes:
   ------------------------------------------------------------------- */
void MENU_UpdateMainMenuCursor (
UB8 bBase,
UB8 bLast,
UB8 bCurrent
)
{
    OSD_FillCharAttr(OSD_WINDOW2_BASE + OSD_WINDOW2_WIDTH * (bLast - bBase),
                     OSD_WINDOW2_WIDTH,
                     OSD2_COLOR_NORMAL                                          );

    OSD_FillCharAttr(OSD_WINDOW2_BASE + OSD_WINDOW2_WIDTH * (bCurrent - bBase),
                     OSD_WINDOW2_WIDTH,
                     OSD2_COLOR_HILIGHT                                         );
} /* MENU_UpdateMainMenuCursor */
#endif


/* -------------------------------------------------------------------
    Name:  -
    Purpose: .
    Passed: None.
    Returns: None.
    Notes:
   ------------------------------------------------------------------- */


/* **********************************************************************

    Description:


   ********************************************************************** */

/* %% End Of File %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */

⌨️ 快捷键说明

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