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

📄 mmi.h

📁 GSM手机设计软件代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* 
+----------------------------------------------------------------------------- 
|  Project :  GSM-PS (6147)
|  Modul   :  MMI
+----------------------------------------------------------------------------- 
|  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 MMI_H
#define MMI_H

/*==== TEST =====================================================*/
/*
 * 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'

/*
 * Dynamic Configuration Numbers
 */
#define MMI_RESET                 0
#define TIMER_SET                 1
#define TIMER_RESET               2
#define TIMER_SPEED_UP            3
#define TIMER_SLOW_DOWN           4
#define TIMER_SUPPRESS            5
#define KEY_SEQUENCE              6
#define EXT_DISPLAY               7

/*
 * Configuration Parameter
 */
#define TBACKLIGHT                0
#define TSLIDER                   2
#define TSHIFTKEY                 3

/*
 * 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

/*
 * service types (substate) of the MMI
 */

#define SRV_NONE        0  /* out of service                          */
#define SRV_LIMITED     1  /* limited service (registered but no sim
                              or sim but no authentification)       */
#define SRV_NORMAL      2  /* normal service: SIM inserted and
                              authorized                            */

#define CT_MOC             0
#define CT_MTC             1

#define ON_HOOK            0
#define OFF_HOOK           1



/*
 * States of the Man Machine Interface
 */
#define MMI_OFF                      0
#define MMI_ON                       1
#define MMI_WAIT_FOR_PIN             2
#define MMI_WAIT_SYNC_SIM            3
#define MMI_IDLE                     4

/*
 * States of a Call
 */
#define FREE_ENTRY          0xff        /* T_CALL_TABLE.state      */              

#define CALL_IDLE           0
#define CALL_HANDLE         1
#define CALL_ACTIVE_REQ     2
#define CALL_ACTIVE         3
#define CALL_HELD           4
#define CALL_HOLD_REQ       5
#define CALL_WAITING        6
#define CALL_DISC_REQ       7

#define CALL_NO_AUX        10           /* auxiliary call states   */

#define AUX_SEL_1          0
#define AUX_SEL_2          1

/*
 * maximum number of simultanous calls
 */
#define MAX_CALLS 16

/*
 * ------------------------------------------------------------------
 * UI dependent constants
 * ------------------------------------------------------------------
 */

/*
 * 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  SCREEN_DX
#define MAX_OUTPUT_SIZE SCREEN_DX

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

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

typedef struct
{
  UBYTE                 state;
  UBYTE                 serviceType;
  BOOL                  simActivated;
  UBYTE                 chanAssigned;
  BOOL                  extDisplay;
} T_MMI_DATA;

typedef struct
{
  UBYTE  state;
  USHORT auxState[2];
  UBYTE  callId;
  BOOL   inbandTone;
  UBYTE  direction;
  UBYTE  callType;
  UBYTE  serv1;
  UBYTE  serv2;
  char   calledNum[20];
  UBYTE  alert_send;
} T_CALL_TABLE;

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;


#define MMI_STATE mmi_data->state

#define TIMERSTART(i,v,h) csf_alloc_timer(i,v,&h)
#define TIMERSTOP(h) csf_free_timer(h); h = VSI_ERROR;

/*==== EXPORT =====================================================*/


/*
 * Prototypes Timer Modul
 */
/*
 * If all entities are linked into one module this definitions
 * prefixes all this functions with the enity name
 */
#ifdef OPTION_MULTITHREAD
  #define tim_init_timer       _ENTITY_PREFIXED(tim_init_timer)
  #define tim_set_timeout_flag _ENTITY_PREFIXED(tim_set_timeout_flag)
  #define tim_handle_timeout   _ENTITY_PREFIXED(tim_handle_timeout)
  #define tim_config_timer     _ENTITY_PREFIXED(tim_config_timer)
  #define tim_get_config_timer _ENTITY_PREFIXED(tim_get_config_timer)
  #define tim_start_timer      _ENTITY_PREFIXED(tim_start_timer)
  #define tim_flush_fifo       _ENTITY_PREFIXED(tim_flush_fifo)
#endif
EXTERN BOOL tim_init_timer              (void);
EXTERN void tim_set_timeout_flag        (T_VSI_THANDLE       handle,
                                         USHORT              *t_flag);
EXTERN void tim_handle_timeout          (USHORT              *t_flag);
EXTERN void tim_config_timer            (UBYTE               t_num,
                                         UBYTE               t_mod,
                                         ULONG               t_val);
EXTERN void tim_get_config_timer        (char                *outString,
                                         UBYTE               t_num,
                                         KW_DATA             *t_name);
EXTERN void tim_start_timer             (UBYTE               id,
                                         T_VSI_THANDLE       handle,
                                         T_VSI_TVALUE        value);
EXTERN void tim_flush_fifo              (T_VSI_THANDLE       handle);

/*
 * Prototypes MMI
 */

/*
 * primitives
 */

EXTERN       void     mmi_init_mm_data          (T_MMI_DATA *mm_data);


/*
 * MMI global data declarations
 */

EXTERN T_MMI_DATA *mmi_data;
EXTERN USHORT screensize_x, screensize_y;

/*
 * If all entities are linked into one module this definitions
 * prefixes the global data with the enity name
 */
#ifdef OPTION_MULTITHREAD
  #define hCommSIM        _ENTITY_PREFIXED(hCommSIM)
  #define hCommMM         _ENTITY_PREFIXED(hCommMM)
  #define hCommCC         _ENTITY_PREFIXED(hCommCC)
  #define hCommSS         _ENTITY_PREFIXED(hCommSS)
  #define hCommSMS        _ENTITY_PREFIXED(hCommSMS)
  #define hCommPL         _ENTITY_PREFIXED(hCommPL)
#endif

//EXTERN T_VSI_CHANDLE  hCommMMI;        /* MMI  Communication       */
EXTERN T_VSI_CHANDLE  hCommSIM;        /* SIM  Communication       */
EXTERN T_VSI_CHANDLE  hCommMM;         /* MM   Communication       */
EXTERN T_VSI_CHANDLE  hCommCC;         /* CC   Communication       */
EXTERN T_VSI_CHANDLE  hCommSS;         /* SS   Communication       */
EXTERN T_VSI_CHANDLE  hCommSMS;        /* SMS  Communication       */
EXTERN T_VSI_CHANDLE  hCommPL;         /* PL   Communication       */
EXTERN T_VSI_THANDLE  mmi_act_handle;

#ifdef OPTION_TIMER
  /*
   * If all entities are linked into one module this definitions
   * prefixes the global data with the entity name
   */
  #ifdef OPTION_MULTITHREAD
    #define partab    _ENTITY_PREFIXED(partab)
  #endif

  EXTERN KW_DATA       partab[];
#endif

#define WAITING_CALL 0x00010000L
#define ACTIVE_CALL  0x00020000L
#define HOLD_CALL    0x00030000L
#define ALL_CALLS    0x0000ffffL

/*
 * signals send from PSA->UI
 */
#define UI_SIG_ENTER_PIN       0
#define UI_SIG_KEY_PRESSED     1
#define UI_SIG_KEY_RELEASED    2
#define UI_SIG_CARD_BLOCKED    3
#define UI_SIG_POWER_DOWN      4
#define UI_SIG_POWER_UP        5
#define UI_SIG_PLMN            6
#define UI_SIG_ABBR_DIAL       7
#define UI_SIG_CONNECTED       8  
#define UI_SIG_BUSY            9
#define UI_SIG_DISCONNECT      10
#define UI_SIG_LIMITED_SERVICE 12
#define UI_SIG_NO_CELL         13
#define UI_SIG_ALARMED         14
#define UI_SIG_CALL_HELD       15
#define UI_SIG_INCOMMING_CALL  16
#define UI_SIG_OUTGOING_CALL   17
#define UI_SIG_RXLEV           18
#define UI_SIG_BATLEV          19
#define UI_SIG_FOUND_PLMN      20
#define UI_SIG_SS              21
#define UI_SIG_CBCH            23
/****** SMS Signals ************/
#define UI_SIG_SMS_REPORT      50
#define UI_SIG_SMS_ALERT       51
#define UI_SIG_SMS_MO          52
#define UI_SIG_SMS_MT          53
#define UI_SIG_SMS_CB          54
/*
 * signals send from UI->PSA
 */
#define PSA_SIG_KEYSEQUENCE    0
#define PSA_SIG_PININPUT       1
#define PSA_SIG_POWER_ON       2
#define PSA_SIG_POWER_OFF      3
#define PSA_SIG_DIAL_NUMBER    4
#define PSA_SIG_ACCEPT         5
#define PSA_SIG_RELEASE        6
#define PSA_SIG_SEND_DTMF      7
#define PSA_SIG_VOLUME         8
#define PSA_SIG_BACKLIGHT      9

⌨️ 快捷键说明

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