app(5162).h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef __APP_H_
  2. #define __APP_H_
  3. #include "lsapi_os.h"
  4. #define APP_TASK_SLEEP_TIME 10
  5. #define APP_SUB_DIV_TIME (APP_TASK_SLEEP_TIME*2) //暂时未明白
  6. typedef enum{
  7. ENCODE_USER_GBK=1,
  8. ENCODE_USER_UNICODE_BE=2,
  9. ENCODE_USER_ASCII=3,
  10. }ENCODE_USER_ENUM;
  11. typedef enum{
  12. ASLEEP_POC,//POC是否休眠
  13. ASLEEP_ADC,//音量旋钮是否忙
  14. ASLEEP_KEY,//普通KEY是否可以休眠,无按键可以休眠(持续按下不休眠)
  15. ASLEEP_MKEY,//矩阵KEY
  16. ASLEEP_PWR,//电源是否执行了关闭
  17. ASLEEP_LCD,//LCD是否休眠
  18. ASLEEP_GGROUP,//用于获取群组列表时不要休眠
  19. ASLEEP_GUSER,//用于获取成员列表时不要休眠
  20. }ASLEEP_ENUM;
  21. #pragma pack(push)
  22. #pragma pack(1)
  23. typedef struct{
  24. unsigned int psn;
  25. char password[30];
  26. unsigned char tnet;//4 显示4G,5 显示5G
  27. }ACCOUNT_DEF;
  28. typedef struct{
  29. unsigned char guiStatus:1;//gui是否初始化完成
  30. unsigned char pocInitStatus:1;//poc是否启动完成
  31. unsigned char appStatus:1;//app是否休眠
  32. unsigned char pocParaDone:2;//poc参数是否检测完成
  33. unsigned char cardStatus:1;//
  34. unsigned char gtMode:1;//GT模式
  35. unsigned char gtTMode:1;//TM模式
  36. unsigned char pocPpp:1;
  37. unsigned char pwrLock:1;//电源是否锁定,只有在电源未锁定时,开机了才关机
  38. unsigned char enableKey:1;//延时界面是否完成,用于阻止延时期间禁止按键操作
  39. unsigned char keyLock:1;//键盘是否被锁了
  40. unsigned char lockShow:1;//显示一下解锁提示信息
  41. unsigned char groupTTSEnable:1;//收到86可以播放
  42. unsigned char earLev:1;
  43. unsigned char earPttReady:1;
  44. unsigned char lowPwrWarn:1;
  45. unsigned char lowPwrMsg:1;
  46. unsigned char forceUiFlash:1;//休眠醒来是,强制UI更新一下
  47. unsigned char authReady:1;
  48. unsigned char lcdDlyLightUp:1;//LCD唤醒后,初始化完再点亮
  49. unsigned char reloginTts:1;
  50. unsigned char reloginStatus:1;
  51. unsigned char waitEscReleased:1;//进入关机页面要等释放关机键再次按下才能退出关机键
  52. unsigned char chargeStatus:1;
  53. unsigned char updateStatusBar:1;//重新刷新状态栏
  54. unsigned char pttReq:1;//是否发了请麦指令
  55. unsigned char voluemUpdate;
  56. unsigned int lowPwrCnt;
  57. unsigned char earCnt;
  58. unsigned char pcant;
  59. unsigned int appSleepStatus;//APP是否可以休眠
  60. ACCOUNT_DEF account;
  61. int g_iCSQ;
  62. int g_iBAT;
  63. char fotaVersion[10];
  64. char pocVersion[10];
  65. unsigned char simSel;//卡用的是哪个:0,1
  66. char modemVer[30];
  67. unsigned char key_f1_cnt;
  68. unsigned char key_f2_cnt;
  69. int copstype;
  70. unsigned char volLev;
  71. unsigned short timeOutCnt;
  72. unsigned char fotaStatus;
  73. unsigned int mic_ana;
  74. unsigned int mic_adc;
  75. unsigned char startPoc;
  76. }APP_DEF;
  77. #pragma pack(pop)
  78. extern APP_DEF sutApp;
  79. void appRun(void);
  80. void dataInit(void);
  81. void keyCheck(unsigned short keyStatus);
  82. void threadSendEvent(LSAPI_OSI_Thread_t *threadID, unsigned int id, unsigned int param1,unsigned int param2,unsigned int param3);
  83. void usbCmdHandler(const char *data,unsigned int length);
  84. void subTask(void *param);
  85. void ttsPlay(ENCODE_USER_ENUM type, char *tts);
  86. void backLightReset(void);
  87. void backLightCb(void *param);
  88. void StrAsciiToHex(char *src, unsigned char *des);
  89. void lcdBackLightApi(char value);
  90. #define MIC_GAIN_NUM 7
  91. #define MIC_GAIN_DEFAULT 4
  92. #define SPK_GAIN_NUM 8
  93. #define SPK_GAIN_DEFAULT 4
  94. void VolSpkUpdate(void);
  95. #endif