MainTask.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /********************************************************************************
  2. * File Name: MainTask.h
  3. * Function Describe: Header file for MainTask.c
  4. * Explain:
  5. * Writer: ShiLiangWen
  6. * Date: 2015-1-30
  7. #define PC_Q_NUM 5
  8. #define PC_MSG_BUF_LEN 300
  9. extern unsigned char PcMsgBuf[PC_Q_NUM][PC_MSG_BUF_LEN];
  10. extern int GpsMsgBufIndex;
  11. extern OS_EVENT *GpsQ;
  12. *******************************************************************************/
  13. #ifndef __MAIN_TASK_H
  14. #define __MAIN_TASK_H
  15. /************************************file begin*******************************/
  16. //#define SLW_DEBUG
  17. //#define HS110C_MB_B
  18. #define SOFTWARE_VER "HS110C_V2.4"
  19. #define MCU_VER 204
  20. #define HARDWARE_VER 0x02
  21. #define ONOFF_CK_PIN GPIO_Pin_12
  22. #define ONOFF_CK_PORT GPIOA
  23. #define PWR_EN_PIN GPIO_Pin_15
  24. #define PWR_EN_PORT GPIOA
  25. #define PWR_EN_HIGH PWR_EN_PORT->BSRR = PWR_EN_PIN
  26. #define PWR_EN_LOW PWR_EN_PORT->BRR = PWR_EN_PIN
  27. #define FLASH_PAGE_ADDR_PARA 0x0801FF00
  28. //#define FLASH_ADDR_PSN 0x0801FF00 //占 0x0801FF00~0x0801FF03 4个字节
  29. //#define FLASH_ADDR_GPS_PORT 0x0801FF04 //占 0x0801FF04~0x0801FF05 2个字节
  30. //#define FLASH_ADDR_GPS_IP 0x0801FF06 //占 0x0801FF06~0x0801FF2D 40个字节
  31. typedef struct SUTDL
  32. {
  33. union {
  34. struct { unsigned char b1,b2,b3,b4; }ucData;
  35. unsigned long ulData;
  36. }Data;
  37. }SUTDL;
  38. typedef struct SUTDS
  39. {
  40. union {
  41. struct { unsigned char b1,b2; }ucData;
  42. unsigned short usData;
  43. }Data;
  44. }SUTDS;
  45. #define MSG_SEC 1
  46. #define PC_Q_NUM 3
  47. #define PC_MSG_BUF_LEN UART1_RX_BUFFER_SIZE
  48. extern OS_EVENT *PcQ;
  49. extern char PcMsgBuf[PC_Q_NUM][PC_MSG_BUF_LEN];
  50. extern int PCMsgBufIndex;
  51. void PowerCtrlInit(void);
  52. void UC2UL(unsigned char *pUC,u32_t *pUL);
  53. void UL2UC(u32_t UL, unsigned char *pUC);
  54. void MainTaskCreate(void);
  55. void SysParaInit(void);
  56. void SystemReset(void);
  57. void ADCInit(void);
  58. int GetVbat(void);
  59. void CheckVbat(int Vbat);
  60. void ReportVbat(int Vbat);
  61. void ReportCSQ(int CSQ);
  62. int GetParaFromStr(char *Str,char *Para,char *Value);
  63. unsigned long ReadPsnFromFlash(void);
  64. void SavePsnToFlash(unsigned long PSN);
  65. void SaveParaToFlash(void);
  66. void ReadParaFromFlash(void);
  67. void IWDG_Configuration(void);
  68. void DelayMs(unsigned long ms);
  69. void ReportMcuVer(int ver);
  70. void ReportModemVer(int ver);
  71. /************************************file end ******************************************/
  72. #endif