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

📄 smi.h

📁 GSM手机设计软件代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* 
+----------------------------------------------------------------------------- 
|  Project :  GSM-PS (6147)
|  Modul   :  SMI
+----------------------------------------------------------------------------- 
|  Copyright 2002 Texas Instruments Berlin, AG 
|                 All rights reserved. 
| 
|                 This file is confidential and a trade secret of Texas 
|                 Instruments Berlin, AG 
|                 The receipt of or possession of this file does not convey 
|                 any rights to reproduce or disclose its contents or to 
|                 manufacture, use, or sell anything it may describe, in 
|                 whole, or in part, without the specific written consent of 
|                 Texas Instruments Berlin, AG. 
+----------------------------------------------------------------------------- 
|  Purpose :  Definitions for the Protocol Stack Entity
|             Man Machine Interface
+----------------------------------------------------------------------------- 
*/ 

#ifndef SMI_H
#define SMI_H

#include "gdi.h"

#ifdef BT_ADAPTER
#include "p_btp.h"
#endif /* BT_ADAPTER */

/*==== CONSTANTS ==================================================*/

#define ENCODE_OFFSET 0

/*
 * Dynamic Configuration Numbers
 */
#define RESET                     0
#define KEY_SEQUENCE              6
#define EXT_DISPLAY               7
#define START_SS                  8
#ifdef BT_ADAPTER
#define BT_PRIM                   9
#endif /* BT_ADAPTER */
#define EXT_TEST_ENABLE           10

/*
 * Timer Names
 */
#define TBACKLIGHT                "TBACK"
#define TSLIDER                   "TSLID"
#define TSHIFTKEY                 "TSHIF"
#define TUNIVERSAL                "TUNIV"


#ifdef OPTION_TIMER
#define SMI_TSTART(i,h,v) _tim_start_timer(i,h,v)
#else
#define SMI_TSTART(i,h,v) vsi_t_start(VSI_CALLER h,v)
#endif

/*
 * instance management
 */
#ifdef OPTION_MULTI_INSTANCE
#define GET_INSTANCE(p)       &mmi_data_base[p->custom.route.inst_no]
#define SMI_INSTANCES         MAX_INSTANCES
#else
#define GET_INSTANCE(p)       &mmi_data_base[0]
#define SMI_INSTANCES         1
#endif

#define CR        0x0D /* carriage return    */
#define LF        0x0A /* line feed          */
#define SPACE     ' '  /* space              */
#define NULL_TERM '\0' /* string termination */

/*
 * definitions of the keycodes
 */
#define NONE_KEY      0xff
#define OK_KEY        'a'
#define CLEAR_KEY     'b'
#define ON_HOOK_KEY   'c'
#define OFF_HOOK_KEY  'd'
#define UP_KEY        'e'
#define DOWN_KEY      'f'
#define SHIFT_KEY     'g'
#define F1_KEY        'h'
#define F2_KEY        'i'
#define POWER_KEY     'j'
#define INC_KEY       'k'
#define DEC_KEY       'l'
#define EMERGENCY_KEY '\177'

/*
 * numer for emergency call
 */
#define EMERGENCY_SEQUENCE "112"

/*
 * types of input
 */
#define IT_NUMERIC     1
#define IT_ALPHA       2
#define IT_ECHO        4
#define IT_HIDDEN      8

/*
 * states of an area
 */
#define AREA_HIDDEN    0
#define AREA_DISPLAYED 1

/*
 * functions of an area
 */
#define FN_NONE        0
#define FN_INPUT       1
#define FN_MENU        2
#define FN_SLIDER      3

/*
 * dimensions of the used LCD
 */
#define SCREEN_DX  20
#define SCREEN_DY  4

#define MAX_INPUT_SIZE  (MAX_SM_LEN + 10)
#define MAX_OUTPUT_SIZE SCREEN_DX

/*
 * security related constants
 */
/*#define MAX_PIN_LEN 8 /* maximum length of PIN (defined in SAP SIM) */
#define MAX_PUK_LEN (MAX_PIN_LEN) /* maximum length of PUK */

/*==== TYPES ======================================================*/

typedef struct
{
  T_VERSION * version;
} T_MONITOR;

typedef struct
{
  UBYTE                 t_mode;
  ULONG                 t_val;
} T_TIMER_CONFIG;

typedef struct
{
  BOOL    free;
  UBYTE   state;
  UBYTE   funcType;
  UBYTE   func;
  USHORT  x, y;
  USHORT  dx, dy;
  USHORT  cursx, cursy;
  BOOL    cursActive;
  CHAR    screen[SCREEN_DX*SCREEN_DY];
}
T_AREA;

typedef struct
{
  BOOL    free;
  USHORT  aktInputIdx;
  USHORT  maxInputLen;
  USHORT  aktInputRow;
  USHORT  aktInputCol;
  UBYTE   aktInputType;
  CHAR    aktInput[MAX_INPUT_SIZE+1];
}
T_INPUT;

typedef struct
{
  BOOL    free;
  CHAR    title[MAX_OUTPUT_SIZE+1];
  USHORT  aktMenuIdx;
  USHORT  numEntries;
  CHAR  **menEntries;
  USHORT  numVisible;
}
T_MENU;

typedef struct
{
  BOOL    free;
  USHORT  minValue;
  USHORT  maxValue;
  USHORT  aktValue;
  USHORT  stepValue;
  USHORT  sliderPos;
}
T_SLID;

typedef struct
{
  SHORT           index;
  T_ACI_CAL_STAT  status;
}
T_CTB_INFO;

/*
 * NUM_OF_VTS / T_volType
 *
 * Description :  Defines the number of different volumes and an
 *                enumeration type to select the volume type for
 *                calling the csf_set/getVolume functions.
 */
#define NUM_OF_VTS 5

typedef enum
{
  VT_AUDIO_IN  = 0,
  VT_AUDIO_OUT = 1,
  VT_KEY_BEEP  = 2,
  VT_DTMF_TONE = 3,
  VT_RINGER    = 4
}
T_volType;

#if defined (NEW_FRAME)
#define TIMERSTART(v,h) vsi_t_start (VSI_CALLER h, v);
#define TIMERSTOP(h) vsi_t_stop(VSI_CALLER h);
#else
#define TIMERSTART(v,h) vsi_t_start (VSI_CALLER h, v);
#define TIMERSTOP(h) vsi_t_stop(VSI_CALLER h); aci_flush_fifo (h);
#endif

/*==== EXPORT =====================================================*/
/*
 * only necessary for external display
 */
#ifdef OPTION_MULTITHREAD
  #define hCommPL         _ENTITY_PREFIXED(hCommPL)
  #define hCommACI        _ENTITY_PREFIXED(hCommACI)
  #define hCommSS         _ENTITY_PREFIXED(hCommSS)
#endif

#if defined (NEW_FRAME)
EXTERN T_HANDLE  hCommPL;         /* PL   Communication       */
EXTERN T_HANDLE  hCommACI;        /* MMI  Communication       */
EXTERN T_HANDLE  hCommSS;         /* SS   Communication       */
#else
EXTERN T_VSI_CHANDLE  hCommPL;         /* PL   Communication       */
EXTERN T_VSI_CHANDLE  hCommACI;        /* MMI  Communication       */
EXTERN T_VSI_CHANDLE  hCommSS;         /* SS   Communication       */
#endif
/*
 * MMI global data declarations
 */
EXTERN USHORT screensize_x, screensize_y;
#if defined (NEW_FRAME)
EXTERN T_HANDLE t_slider_running,
                t_backlight_running,
                t_shiftkey_running,
                t_universal_running;
#else
EXTERN T_VSI_THANDLE t_slider_handle,
                     t_backlight_handle,
                     t_shiftkey_handle,
                     t_universal_handle;
#endif
/*
 * no in-band tones
 */
#define NIBT_OFF   (UBYTE)0x00
#define NIBT_ALERT (UBYTE)0x01
#define NIBT_DISC  (UBYTE)0x02
#define NIBT_BUSY  (UBYTE)0x03

/*
 * signals send from ACA->UI
 */
#define UI_SIG_ENTER_PIN                0
#define UI_SIG_ENTER_PUK                1
#define UI_SIG_SIM_NOT_INSERT           2
#define UI_SIG_SIM_WRONG                3
#define UI_SIG_POWER_DOWN               4
#define UI_SIG_POWER_UP                 5
#define UI_SIG_PLMN                     6
#define UI_SIG_SELECT_PLMN              7
#define UI_SIG_CONNECTED                8
#define UI_SIG_BUSY                     9
#define UI_SIG_DISCONNECT               10
#define UI_SIG_ILLEGAL_MS               11
#define UI_SIG_LIMITED_SERVICE          12
#define UI_SIG_NO_CELL                  13
#define UI_SIG_CALL_HELD                14
#define UI_SIG_WAITING_CALL             15
#define UI_SIG_INCOMMING_CALL           16
#define UI_SIG_OUTGOING_CALL            17
#define UI_SIG_RXLEV                    18
#define UI_SIG_BATLEV                   19

⌨️ 快捷键说明

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