ZNY_Pakistan/Anjiehui7_ZNY/User/uart_dtu.h

66 lines
1.6 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
*********************************************************************************************************
* IAR Development Kits
* on the
*
* M451
*
* Filename : uart_dtu.h
* Version : V1.00
* Programmer(s) : Qian Xianghong
*********************************************************************************************************
*/
#ifndef USER_UART_DTU_PRESENT
#define USER_UART_DTU_PRESENT
#include "type.h"
// 初始化引脚
void DTU_Init(void);
// 打开设备和允许中断
void DTU_Open(void);
// 任务主体
void DTU_Task0(uint8_t c);
void DTU_Task(void *p_arg);
// 从服务器获取当前时间
void DTU_setOffsetSecondsFromServer();
// 信号量,用于通知执行任务
extern volatile uint8_t DTU_semGPS;
extern volatile uint8_t DTU_semGPRS;
extern volatile uint8_t DTU_semSync;
// 是否GPS定位
extern volatile uint8_t GPS_Locate;
extern volatile uint8_t GPS_Located;
// 定位等待时间
extern volatile uint32_t GPS_waitTick;
extern volatile uint8_t GPS_Waiting;
// GPS发送数据
extern volatile uint32_t GPS_tranTick;
// 强制上传数据
extern volatile uint8_t DTU_dataConn;
// 强制连接维护平台
extern volatile uint8_t DTU_ldmsConn;
// 发送成功时间
extern volatile uint32_t DTU_succTime;
extern loopbuff_t DTU_TaskM;
// 这个缓冲区比较大不放在stack里面
#define DTU_GPSDATA_SIZE 120
extern char DTU_gpsData[2][DTU_GPSDATA_SIZE]; // 扩展内存
#define DTU_RECVBUFF_SIZE 200
extern char DTU_recvBuff[DTU_RECVBUFF_SIZE]; // 扩展内存
// 计算2个坐标之间的距离
double GetDistance(int32_t lat1, int32_t lng1, int32_t lat2, int32_t lng2);
#endif