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

📄 menu.lst

📁 silicon wireless开发套件F920+Si4432原理图,源码
💻 LST
📖 第 1 页 / 共 5 页
字号:
C51 COMPILER V8.00   MENU                                                                  11/17/2008 10:50:38 PAGE 1   


C51 COMPILER V8.00, COMPILATION OF MODULE MENU
OBJECT MODULE PLACED IN menu.OBJ
COMPILER INVOKED BY: C:\Program Files\Keil\C51\BIN\C51.exe menu.c DB OE BR

line level    source

   1          /*
   2          ** ============================================================================
   3          **
   4          ** FILE
   5          **  menu.c
   6          **
   7          ** DESCRIPTION
   8          **  Realize the menu operation
   9          **
  10          ** CREATED
  11          **  Silicon Laboratories Hungary Ltd
  12          **
  13          ** COPYRIGHT
  14          **  Copyright 2008 Silicon Laboratories, Inc.  
  15          **      http://www.silabs.com
  16          **
  17          ** ============================================================================
  18          */
  19          /*------------------------------------------------------------------------*/
  20          /*                                              INCLUDE                                                                                   */
  21          /*------------------------------------------------------------------------*/
  22          #include "global_definitions.h"
  23          #include "menu.h"
  24          #include "IA443x_demo.h"
  25          #include "dog_glcd.h"
  26          #include "timers.h"
  27          #include "IAI_EBID.h"
  28          
  29          /*------------------------------------------------------------------------*/
  30          /*                                              GLOBAL variables, constants                                               */
  31          /*------------------------------------------------------------------------*/
  32          uint8 CursorPosition;
  33          
  34          //menu item declarations
  35          xdata MENU_ITEM_VALUE   MenuItems;
  36          code uint8 t_system_function[2][5] = {"DEMO", "LAB "};
  37          code uint8 t_lab_mode[4][4] = {"CW ", "PN9", "BER", "PER"};
  38          code uint8 t_demo_mode[3][4] = {"TRx", "Tx ", "Rx "};
  39          code uint8 t_data_rate[NMBR_OF_GFSK_SAMPLE_SETTING][4] = {"2.4","4.8","9.6"," 10"," 20"," 40", " 50", "100
             -", "128"};
  40          code uint8 t_arib_data_rate[NMBR_OF_ARIB_SAMPLE_SETTING][5] = {"2.4","4.8"};
  41          code uint8 t_ook_data_rate[NMBR_OF_OOK_SAMPLE_SETTING][4] = {"2.4","4.8","9.6"};
  42          code uint8 t_modulation_mode[3][5] = {"GFSK","FSK ","OOK "};
  43          code uint8 t_antenna_mode[3][4] = {"A&B","A  ","B  "};
  44          code uint8 t_yes_no[2][4] = {"NO ","YES"};
  45          code uint8 t_on_off[2][4] = {"OFF","ON "};
  46          code uint16 v_max_packets[7] = {1, 10, 100, 500, 1000, 5000, 9999};
  47          
  48          //extern variables, constans
  49                  //global_constans.c
  50          extern code uint8 FirmwareVersion[5];
  51          extern code DEMO_FREQ demo_freqs[MAX_FREQ_SETTING];
  52          extern code DEMO_FREQ arib_freqs[MAX_ARIB_FREQ_SETTING];
  53                  //pictures.c
  54          extern const code no_packet11x8[];
C51 COMPILER V8.00   MENU                                                                  11/17/2008 10:50:38 PAGE 2   

  55          extern const code rssi12x8[];
  56          extern const code rssi24x8[];
  57          extern const code rssi36x8[];
  58          extern const code rssi48x8[];
  59          extern const code rssi510x8[];
  60          extern const code rssi612x8[];
  61          extern const code rssi714x8[];
  62          extern const code ant9x8[];
  63          extern const code ant1_inverted15x8[];
  64          extern const code ant2_inverted15x8[];
  65          extern const code ok_inverted16x8[];
  66          extern const code rx_inverted16x8[];
  67          extern const code start_inverted29x8[];
  68          extern const code stop_inverted24x8[];
  69          extern const code tx_inverted16x8[];
  70          extern const code txon_inverted29x8[];
  71          extern const code silabs87x40[];
  72          extern const code txoff_inverted32x8[];
  73          extern const code clear_inverted29x8[];
  74          extern const code setting_inverted48x8[];
  75          extern const code minus_inverted16x8[];
  76          extern const code plus_inverted16x8[];
  77          extern const code up_down_inverted16x8[];
  78          extern const code go_inverted16x8[];
  79                  //IAI_EBID.
  80          extern xdata EBID_DATA  TestcardData;
  81                  //dog_glcd.c
  82          extern idata uint8 lcd_data[22];
  83                  //IAI_demo.c
  84          extern xdata ANTENNA_TYPE SelectedAntennaType;
  85          
  86          
  87          /*------------------------------------------------------------------------*/
  88          /*                                              LOCAL function prototypes                                                 */
  89          /*------------------------------------------------------------------------*/
  90          void PrintRssiToLcd(void);
  91          void DecFreqCounter(void);
  92          void IncFreqCounter(void);
  93          uint8 CheckFreqBand(void);
  94          void PrintFreqDr(void);
  95          void PrintRssi(uint8 row, uint8 column, uint8 rssi);
  96          void DrawEmptySettingPage(void);
  97          BUTTON_STATES CheckPushButtons(void);
  98          
  99          /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 100            +
 101            + FUNCTION NAME:  MENU_RETURN PerformMenu(MENU_ITEM menu_item)
 102            +
 103            + DESCRIPTION:    menu handling
 104            +
 105            +     INPUT:                  next menu page
 106            +
 107            + RETURN:         
 108            +
 109            + NOTES:          
 110            +
 111            +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 112          MENU_RETURN PerformMenu(MENU_ITEM menu_item)
 113          {
 114   1              switch( menu_item )
 115   1              {
 116   2                      case sMenuStartScreen:
C51 COMPILER V8.00   MENU                                                                  11/17/2008 10:50:38 PAGE 3   

 117   2                              //clear LCD
 118   2                              LcdClearDisplay();
 119   2                              //draw startup screen
 120   2                              LcdSetPictureCursor(LCD_LINE_1,20);
 121   2                              LcdDrawPicture(silabs87x40);
 122   2                              memcpy(lcd_data,"EZRadioPRO Evaluation",21);
 123   2                              LcdWriteLine(LCD_LINE_7,lcd_data);      
 124   2                              sprintf(lcd_data,"   (Firmware: %s)  ",FirmwareVersion);
 125   2                              LcdWriteLine(LCD_LINE_8,lcd_data);      
 126   2                              //print on the USB
 127   2                              printf("\r\n\r\nSILICON Labs., Si443x Packet Error Rate Demonstration\r\n");
 128   2                              printf("Firmware: %s\r\n",FirmwareVersion);
 129   2                      break;
 130   2      
 131   2                      case sMenuXTALError:
 132   2                              LcdClearDisplay();
 133   2                              printf("\r\nERROR: XTAL startup error!");
 134   2                              printf("\r\nTry a different Testcard!\r\n");
 135   2                              memcpy(lcd_data,"ERROR: XTAL startup! ",21);
 136   2                              LcdWriteLine(LCD_LINE_2,lcd_data);
 137   2                              memcpy(lcd_data,"   Try a different   ",21);
 138   2                              LcdWriteLine(LCD_LINE_5,lcd_data);
 139   2                              memcpy(lcd_data,"      Testcard!      ",21);
 140   2                              LcdWriteLine(LCD_LINE_6,lcd_data);
 141   2                              while(1);
 142   2                      break;
 143   2      
 144   2                      case sMenuPORTimeout:
 145   2                              //clear LCD
 146   2                              LcdClearDisplay();
 147   2                              printf("\r\nERROR: POR timeout! Insert a Testcard or try a different one!\r\n");
 148   2                              memcpy(lcd_data,"ERROR: POR timeout!  ",21);
 149   2                              LcdWriteLine(LCD_LINE_2,lcd_data);
 150   2                              memcpy(lcd_data,"Insert a Testcard or ",21);
 151   2                              LcdWriteLine(LCD_LINE_5,lcd_data);
 152   2                              memcpy(lcd_data,"try a different one! ",21);
 153   2                              LcdWriteLine(LCD_LINE_6,lcd_data);
 154   2                      break;
 155   2      
 156   2                      case sMenuTestcardOrEEPROMError:
 157   2                              //clear LCD
 158   2                              LcdClearDisplay();
 159   2                              //EEPROM is empty
 160   2                              printf("\r\nERROR: no Testcard inserted, or the board identification");  
 161   2                              printf("\r\nEEPROM is missing or empty!");
 162   2                              printf("\r\nTry a different Testcard!\r\n");
 163   2                              memcpy(lcd_data,"ERROR: no Testcard or",21);
 164   2                              LcdWriteLine(LCD_LINE_1,lcd_data);
 165   2                              memcpy(lcd_data,"   the board ident.  ",21);
 166   2                              LcdWriteLine(LCD_LINE_2,lcd_data);
 167   2                              memcpy(lcd_data,"EEPROM missing/empty!",21);
 168   2                              LcdWriteLine(LCD_LINE_3,lcd_data);
 169   2                              memcpy(lcd_data,"   Try a different   ",21);
 170   2                              LcdWriteLine(LCD_LINE_5,lcd_data);
 171   2                              memcpy(lcd_data,"      Testcard!      ",21);
 172   2                              LcdWriteLine(LCD_LINE_6,lcd_data);
 173   2                      break;
 174   2      

⌨️ 快捷键说明

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