Gauges.h 2.47 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8
/**

* @file    Gauges.h
* @details Gauges management.
* @author     TYW_YuTian
* @date       2021-2-22
* @version A001
* @par Copyright (c):
hu's avatar
hu committed
9
*   TIANYOUWEI
hu's avatar
hu committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
* @par History:
*   version: author, date, desc\n

*/
#ifndef _GAUGES_H_
#define _GAUGES_H_

#include "TYW_stdint.h"
/* --- Data  Type Define --- */
/*#define uint8_t unsigned char */
/*#define uint16_t unsigned short//3360 324 */
/*#define uint16_t unsigned int*/ /*Freesecale */
/*#define uint32_t unsigned long*/

/*??Struct*/
typedef enum
{
    StepperMotor = 0u,
    MotorGasType,
    MotorTempType,
    LCDGasType,
    LEDOtherType,
    LEDGasType,
    LEDTempType,
    IndicatTypeTOtal,
    FreeMoveType,
hu's avatar
hu committed
36

hu's avatar
hu committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
} _GaugesType;
/**@struct _GaugesInfoInit
*this is _GaugesInfoInit
*/

typedef struct
{

    uint8_t          SectorNum;
    uint8_t          GaugesType;
    uint16_t         ReferenceDataInUp[20];
    uint16_t         ReferenceDataInDown[20];
    uint16_t         ReferenceDataInOut[20];
    uint16_t         *GaugesDataIn;
    uint16_t         GaugesStartTime;
    uint8_t          GaugesTestFlag;

} _GaugesInfoInit;
hu's avatar
hu committed
55 56 57

extern uint8_t  QuerySector(_GaugesInfoInit *GParam, uint8_t  DirecSignPara, uint8_t SubAscf, uint16_t  FunGaugesDataIn);
extern uint16_t GetGaugestargetPosSub( _GaugesInfoInit *GParam, uint8_t SubAscf, uint8_t SectorID, uint8_t DirecSignPara, uint16_t FunGaugesDataIn );
hu's avatar
hu committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
extern uint16_t GetGaugestargetPos( _GaugesInfoInit *GParam, uint8_t  DirecSignPara);
extern void GaugesForwardParaManage( _GaugesInfoInit *GParam, uint8_t DirecSignPara );
extern void GaugesInversionParaManage( _GaugesInfoInit *GParam, uint8_t DirecSignPara );
extern void GaugeMoveing(uint8_t GaugesNum);
extern void GetGaugesDisplayMode (uint8_t GaugesNum);
/*外部调用接口*/
/*仪表IGON调用*/
extern void GaugesK15Init_ON(void) ;
/*仪表IGOFF调用*/
extern void GaugesK15Init_OFF(void) ;
/*得到显示步*/
extern uint16_t GetGaugesCurrentPos(uint8_t GaugesNum) ;
/*表头处理函数*/
extern void GaugeSchedule(uint8_t GaugesNum, _GaugesInfoInit *GParam);
/*表头时间函数放在ms定时中*/
hu's avatar
hu committed
73
extern void Gauges_Time_Xms_Count(uint8_t Xms);
hu's avatar
hu committed
74 75 76 77 78 79
/*得到格的内部小步*/
extern uint16_t GetGaugesCurrentStep(uint8_t GaugesNum);
/*通过车速目标步得到实际车速*/
extern uint16_t GetVehDisVal(uint16_t VehCurPos, _GaugesInfoInit *GParam);
/*设置FreeMoveType模式仪表走动时间*/
extern void SetFreeMoveTimes(uint16_t GaugesMoveTimes);
hu's avatar
hu committed
80 81
/*得到上下行方向  返回值:1  2*/
extern uint8_t GetGaugesDirec(uint8_t GaugesNum) ;
hu's avatar
hu committed
82
#endif