| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /********************************************************************************
- * File Name: MainTask.h
- * Function Describe: Header file for MainTask.c
- * Explain:
- * Writer: ShiLiangWen
- * Date: 2015-1-30
- #define PC_Q_NUM 5
- #define PC_MSG_BUF_LEN 300
- extern unsigned char PcMsgBuf[PC_Q_NUM][PC_MSG_BUF_LEN];
- extern int GpsMsgBufIndex;
- extern OS_EVENT *GpsQ;
- *******************************************************************************/
- #ifndef __MAIN_TASK_H
- #define __MAIN_TASK_H
- /************************************file begin*******************************/
- //#define SLW_DEBUG
- //#define HS110C_MB_B
- #define SOFTWARE_VER "HS110C_V2.4"
- #define MCU_VER 204
- #define HARDWARE_VER 0x02
- #define ONOFF_CK_PIN GPIO_Pin_12
- #define ONOFF_CK_PORT GPIOA
- #define PWR_EN_PIN GPIO_Pin_15
- #define PWR_EN_PORT GPIOA
- #define PWR_EN_HIGH PWR_EN_PORT->BSRR = PWR_EN_PIN
- #define PWR_EN_LOW PWR_EN_PORT->BRR = PWR_EN_PIN
- #define FLASH_PAGE_ADDR_PARA 0x0801FF00
- //#define FLASH_ADDR_PSN 0x0801FF00 //占 0x0801FF00~0x0801FF03 4个字节
- //#define FLASH_ADDR_GPS_PORT 0x0801FF04 //占 0x0801FF04~0x0801FF05 2个字节
- //#define FLASH_ADDR_GPS_IP 0x0801FF06 //占 0x0801FF06~0x0801FF2D 40个字节
- typedef struct SUTDL
- {
- union {
- struct { unsigned char b1,b2,b3,b4; }ucData;
- unsigned long ulData;
- }Data;
- }SUTDL;
- typedef struct SUTDS
- {
- union {
- struct { unsigned char b1,b2; }ucData;
- unsigned short usData;
- }Data;
- }SUTDS;
- #define MSG_SEC 1
- #define PC_Q_NUM 3
- #define PC_MSG_BUF_LEN UART1_RX_BUFFER_SIZE
- extern OS_EVENT *PcQ;
- extern char PcMsgBuf[PC_Q_NUM][PC_MSG_BUF_LEN];
- extern int PCMsgBufIndex;
- void PowerCtrlInit(void);
- void UC2UL(unsigned char *pUC,u32_t *pUL);
- void UL2UC(u32_t UL, unsigned char *pUC);
- void MainTaskCreate(void);
- void SysParaInit(void);
- void SystemReset(void);
- void ADCInit(void);
- int GetVbat(void);
- void CheckVbat(int Vbat);
- void ReportVbat(int Vbat);
- void ReportCSQ(int CSQ);
- int GetParaFromStr(char *Str,char *Para,char *Value);
- unsigned long ReadPsnFromFlash(void);
- void SavePsnToFlash(unsigned long PSN);
- void SaveParaToFlash(void);
- void ReadParaFromFlash(void);
- void IWDG_Configuration(void);
- void DelayMs(unsigned long ms);
- void ReportMcuVer(int ver);
- void ReportModemVer(int ver);
- /************************************file end ******************************************/
- #endif
|