app(233).h 3.2 KB

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