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

📄 menu.c

📁 优龙YLP270开发板 光盘自带的BIOS和实验例程源码 强烈推荐
💻 C
📖 第 1 页 / 共 5 页
字号:
/******************************************************************************
**
**  COPYRIGHT (C) 2000, 2001 Intel Corporation.
**
**  This software as well as the software described in it is furnished under
**  license and may only be used or copied in accordance with the terms of the
**  license. The information in this file is furnished for informational use
**  only, is subject to change without notice, and should not be construed as
**  a commitment by Intel Corporation. Intel Corporation assumes no
**  responsibility or liability for any errors or inaccuracies that may appear
**  in this document or any software that may be provided in association with
**  this document.
**  Except as permitted by such license, no part of this document may be
**  reproduced, stored in a retrieval system, or transmitted in any form or by
**  any means without the express written consent of Intel Corporation.
**
**  FILENAME:       menu.c
**
**  PURPOSE:       This file is a collection of the data structures to be used
**                 in the menu system of the Diagnostic Manager.
**
**  LAST MODIFIED:  $Modtime: 7/17/03 1:01p $
******************************************************************************/

/*
*******************************************************************************
*   HEADER FILES
*******************************************************************************
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "systypes.h"
#include "xsuart.h"
#include "xsffuart.h"
#include "xsbtuart.h"
#include "xsstuart.h"
#include "uarts.h"
#include "DM_SerialInOut.h"
#include "timedelays.h"
#include "DM_Test.h"
#include "menu.h"
#include "commandlist.h"
#include "boardControl.h"
#include "stdinout.h"

/*
*******************************************************************************
*   EXTERNAL DECLARATION
*******************************************************************************
*/
extern BOOL gMenuEnabled;

/*
*******************************************************************************
*   GLOBAL DEFINITIONS
*******************************************************************************
*/
DM_MenuItem_T DmCwMenuList[] =
{
    {0,  "Show All Control Bit Names",        DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.SHOWBITNAMES"},
    {1,  "Increment Controlled Bit Position", DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.INCRCURSW"},
    {2,  "Decrement Controlled Bit Position", DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.DECRCURSW"},
    {3,  "Show Enabled Debug Print Controls", DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.DEBUGPRINT.SHOW"},
    {4,  "Show Enabled Warn Print Controls",  DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.WARNPRINT.SHOW"},
    {5,  "Show Enabled Err Print Controls",   DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.ERRPRINT.SHOW"},
    {6,  "Toggle Debug Print Control",        DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.DEBUGPRINT.TOGGLE"},
    {7,  "Toggle Warn Print Control",         DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.WARNPRINT.TOGGLE"},
    {8,  "Toggle Err Print Control",          DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.ERRPRINT.TOGGLE"},
    {13, "Disable All Control Bits",          DM_TranslateMenuToCmd, PlatformCmdList, "DM.CONTROLWORDS.DISABLE.ALL"},
    {14, "Exit",                              NULL,                  NULL,            NULL},
    {0,  NULL,                                NULL,                  NULL,            NULL}
};
DM_Menu_T DmCwMenu = {"Debug Control Switches Menu", DmCwMenuList, 0};

/*---------------- Diagnostic Manager Error Log Menu List ----------------*/

DM_MenuItem_T DmErrorLogMenuList[] =
{
    {0,  "Dump Error Log",  DM_TranslateMenuToCmd, PlatformCmdList, "POST.ERRORLOG.DUMP"},
    {1,  "Clear Error Log", DM_TranslateMenuToCmd, PlatformCmdList, "POST.ERRORLOG.CLEAR"},
    {14, "Exit",            NULL,                  NULL,            NULL},
    {0,  NULL,              NULL,                  NULL,            NULL}
};
DM_Menu_T DmErrorLogMenu = {"Drivers Error Log Menu", DmErrorLogMenuList, 0};

/*---------------- Diagnostic Manager Memory Edit Menu List ----------------*/

DM_MenuItem_T MemEditMenuList[] =
{
    {0,  "Display Memory",          DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.VIEW"},
    {1,  "View Higher Addresses",   DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.HIGHER"},
    {2,  "View Lower Addresses",    DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.LOWER"},
    {3,  "Write To Memory",         DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.WRITE"},
    {4,  "Set Memory Width",        DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.WIDTH"},
    {5,  "Set the Region Length",   DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.LENGTH"},
    {6,  "Fill Memory",             DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.FILL"},
    {7,  "Copy Memory",             DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.COPY"},
    {8,  "Compare Memory",          DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.COMPARE"},
    {9,  "Search Memory",           DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.SEARCH"},
    {10, "Search Higher Addresses", DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.SEARCHHIGHER"},
    {11, "Search Lower Addresses",  DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.SEARCHLOWER"},
    {12, "Set Search Length",       DM_TranslateMenuToCmd, PlatformCmdList, "MEMEDIT.SEARCHLENGTH"},
    {14, "Exit",                    NULL,                  NULL,            NULL},
    {0,  NULL,                      NULL,                  NULL,            NULL}
};
DM_Menu_T MemEditMenu = {"Memory Edit Menu", MemEditMenuList, 0};

/*---------------- Diagnostic Manager Control Debug History Menu ----------------*/

DM_MenuItem_T DmDbgHistoryMenuList[] =
{
    {0,  "Display All Debug Controls",      DM_TranslateMenuToCmd, PlatformCmdList, "DM.DBGHISTORY.ALLCNTRL"},
    {1,  "Increment Curr. Debug Control",   DM_TranslateMenuToCmd, PlatformCmdList, "DM.DBGHISTORY.INCRCNTRL"},
    {2,  "Decrement Curr. Debug Control",   DM_TranslateMenuToCmd, PlatformCmdList, "DM.DBGHISTORY.DECRCNTRL"},
    {3,  "Toggle Curr. Debug Control",      DM_TranslateMenuToCmd, PlatformCmdList, "DM.DBGHISTORY.TOGGLECNTRL"},
    {4,  "Dump Debug History Buffer",       DM_TranslateMenuToCmd, PlatformCmdList, "DM.DBGHISTORY.DUMPBUFFER"},
    {5,  "Clear Debug History Buffer",      DM_TranslateMenuToCmd, PlatformCmdList, "DM.DBGHISTORY.CLEARBUFFER"},
    {14, "Exit",                            NULL,                  NULL,            NULL},
    {0,  NULL,                              NULL,                  NULL,            NULL}
};
DM_Menu_T DmDbgHistoryMenu = {"Control Debug History Menu", DmDbgHistoryMenuList, 0};

/*---------------- Diagnostic Manager Tools Menu ----------------*/

DM_MenuItem_T ToolsMenuList[] =
{
    {0,  "Memory Edit",             DM_DoMenu,  &MemEditMenu,       NULL},
    {1,  "Drivers Error Log",       DM_DoMenu,  &DmErrorLogMenu,    NULL},
    {2,  "Debug Control Switches",  DM_DoMenu,  &DmCwMenu,          NULL},
    {3,  "Debug History Switches",  DM_DoMenu,  &DmDbgHistoryMenu,  NULL},
    {14, "Exit",                    NULL, NULL},
    {0,  NULL,                      NULL, NULL}
};
DM_Menu_T ToolsMenu = {"Tools Menu", ToolsMenuList, 0};

/*---------- Diagnostic Manager Touch Screen Menu ---------------*/

DM_MenuItem_T TouchScreenMenuList[] =
{
    {0,  "* Calibration",   DM_TranslateMenuToCmd, PlatformCmdList, "TOUCHSCREEN.CALIBRATE"},
    {1,  "* Data Test",     DM_TranslateMenuToCmd, PlatformCmdList, "TOUCHSCREEN.TEST.DATA"},
    {2,  "* Scribble Test", DM_TranslateMenuToCmd, PlatformCmdList, "TOUCHSCREEN.TEST.SCRIBBLE"},
    {14, "Exit",          NULL,                  NULL,            NULL},
    {15, "Tools",         DM_DoMenu,             &ToolsMenu,      NULL},
    {0,  NULL,            NULL,                  NULL,            NULL}
};
DM_Menu_T TouchScreenMenu = {"Touch Screen Menu", TouchScreenMenuList, 0};

/*---------- Diagnostic Manager Audio Menu ---------------*/

DM_MenuItem_T AudioMenuList[] =
{
    {0,  "* Ac97 DMA Loop Test",           DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.DMALOOPTEST"},
    {1,  "* Ac97 DMA Loop Test QuickStop", DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.DMALOOPTESTQUICK"},
    {2,  "* Ac97 DMA Loop Tone Tx Test",   DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.TXTONEDMALOOPTEST"},
    {3,  "* Ac97 Start DMA Loop",          DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.DMALOOPSTARTTEST"},
    {4,  "* Ac97 Start DMA Loop Tone Tx",  DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.TXTONEDMALOOPSTART"},
    {5,  "* Ac97 Mix DMA Loop Tone",       DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.TXTONEDMALOOPMIXTEST"},
    {6,  "* Ac97 Stop DMA Loop",           DM_TranslateMenuToCmd, PlatformCmdList, "AC97CODEC.DMALOOPSTOPTEST"},
    {14, "Exit",                         NULL,                  NULL,            NULL},
    {15, "Tools",                        DM_DoMenu,             &ToolsMenu,      NULL},
    {0,  NULL,                           NULL,                  NULL,            NULL}
};
DM_Menu_T AudioMenu = {"Audio Menu", AudioMenuList, 0};

/*---- Diagnostic Manager Ethernet Trace Settings Menu List -----*/

DM_MenuItem_T EthernetTraceMenuList[] =
{
    {0,  "* Trace Enable",    DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.TRACE,1"},
    {1,  "* Trace Disable",   DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.TRACE,0"},
    {14, "Exit",            NULL,                  NULL,            NULL},
    {15, "Tools",           DM_DoMenu,             &ToolsMenu,      NULL},
    {0,  NULL,              NULL,                  NULL,            NULL}
};
DM_Menu_T EthernetTraceMenu = {"Ethernet Trace Settings Menu", EthernetTraceMenuList, 0};

/*------- Diagnostic Manager Ethernet MAC  Menu List -------*/

DM_MenuItem_T EthernetMACMenuList[] =
{
    {0,  "* Set EEPROM MAC Address",       DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.SETMACADDRESS,2"},
    {1,  "* Set supplied MAC Address",     DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.SETMACADDRESS,3"},
    {2,  "* Set Hard Coded MAC Address",   DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.SETMACADDRESS,1"},
    {3,  "* Set Default MAC Address",      DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.SETMACADDRESS,0"},
    {4,  "* Set Random MAC Address",       DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.SETMACADDRESS,4"},
    {5,  "Display MAC Address",          DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.GETMACADDRESS,0"},
    {6,  "Display EEPROM Address",       DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.GETMACADDRESS,1"},
    {14, "Exit",                         NULL,                  NULL,            NULL},
    {15, "Tools",                        DM_DoMenu,             &ToolsMenu,      NULL},
    {0,  NULL,                           NULL,                  NULL,            NULL}
};
DM_Menu_T EthernetMACMenu = {"Ethernet MAC Settings Menu", EthernetMACMenuList, 0};

/*--- Diagnostic Manager Ethernet Control Settings Menu List ----*/

DM_MenuItem_T EthernetControlMenuList[] =
{
    {0,  "* Enable Ethernet",          DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.HWSETUP"},
    {1,  "* Disable Ethernet",         DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.HWSHUTDOWN"},
    {2,  "Display MAC Address",      DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.GETMACADDRESS,0"},
    {3,  "Display EEPROM Address",   DM_TranslateMenuToCmd, PlatformCmdList, "ETHERNET.GETMACADDRESS,1"},
    {14, "Exit",                     NULL,                  NULL,            NULL},
    {15, "Tools",                    DM_DoMenu,             &ToolsMenu,      NULL},
    {0,  NULL,                       NULL,                  NULL,            NULL}
};
DM_Menu_T EthernetControlMenu = {"Ethernet Control Settings Menu", EthernetControlMenuList, 0};

/*------ Diagnostic Manager Ethernet Settings Menu List ---------*/

DM_MenuItem_T EthernetSettingsMenuList[] =
{
    {0,  "Trace",   DM_DoMenu, &EthernetTraceMenu,   NULL},
    {1,  "MAC",     DM_DoMenu, &EthernetMACMenu,     NULL},
    {2,  "Control", DM_DoMenu, &EthernetControlMenu, NULL},
    {14, "Exit",    NULL,      NULL,                 NULL},
    {15, "Tools",   NULL,      &ToolsMenu,           NULL},

⌨️ 快捷键说明

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