#ifndef _DATA_AverageSpeed_H_
#define _DATA_AverageSpeed_H_



#define DATA_AVG_SPEED_TOTAL_KM 50


typedef struct 
{
    uint32_t Mileage; //100m
    uint32_t DrTime; //100ms
    uint32_t MileageBackUp;
    uint32_t Val;
    uint32_t Dis;
    uint8_t Valid;
    uint32_t Safety_Belt_DrTime;
    uint32_t Speed;
}_AvgSpeed_Struct;
extern _AvgSpeed_Struct AvgSpeed;


typedef struct 
{
    uint16_t Value;
    uint8_t Valid;
}_AvgPower_Struct;

extern _AvgPower_Struct AvgPower;


typedef struct 
{
    uint32_t Hour; 
    uint32_t Minute; 

}_DriverTime;


uint8_t Get_OFF_AvgSpeed_Time(void);
extern void AvgSpeed_DriTime_Add(uint32_t Inc);
extern void Data_Avg_Speed_Processing(void);
void AvgSpeed_Milleage_Add(uint32_t Inc);
uint32_t GetDriverTime(void);
uint32_t GetDriverMilleage(void);
uint16_t GetAvgSpeed(void);
uint8_t GetAvgSpeed_Valid(void);
void Data_Avg_Speed_Reset(void);
uint16_t Get_AvgPower_Value(void);
uint8_t Get_AvgPower_Valid(void);
void Clear_DriverTime(uint8_t Set);
void Clear_AvgSpeed(uint8_t Set);
void Set_AvgSpeedDisTime(uint8_t Set);
void Data_AverageSpeed_KL30_Init(void);
//void Data_AverageSpeed_KL15_Init(void);
void Safety_Belt_DriTime_Add(uint32_t Inc);
uint8_t Get_EngSpeed_Start_Flag(void);
void AvgSpeed_Speed_Add(uint32_t Inc);
#endif
