GUI_Display.c 5.57 KB
Newer Older
李俭双's avatar
李俭双 committed
1 2 3
#include "GUI_Display\GUI_Display.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h" 
#include "Application.h"
李俭双's avatar
李俭双 committed
4

李俭双's avatar
李俭双 committed
5 6 7 8 9 10 11
void Gauge_Clock_Display(void)
{
    uint8_t PageType_DIS = 0;
    if (Common_Get_IG_Sts( ) == COMMON_POWER_ON)
    {
        PageType_DIS = Get_Current_PageType();

李俭双's avatar
李俭双 committed
12
        LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_ON);
李俭双's avatar
李俭双 committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
        
        if ( PageType_DIS == 1 )
        {
            if(FLASH_SYNC_1Hz)
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 1);
            }
            else
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 0, 1);
            }
            
        }
        else if ( PageType_DIS == 2 )
        {
            if(FLASH_SYNC_1Hz)
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 1);
            }
            else
            {
                SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 0);
            }
        }
        else 
        {
            SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), FLASH_SYNC_1Hz, 1, 1);
        }
    }
    else
    {
        SEG_SET_Clock(0, 0, 0, 0, 0);
李俭双's avatar
李俭双 committed
45
        LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_OFF);
李俭双's avatar
李俭双 committed
46 47 48 49
    }
}


李俭双's avatar
李俭双 committed
50 51 52



李俭双's avatar
李俭双 committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67


void Clear_Bu98(void)
{
    uint8_t i = 0;
    for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
    {
        BU98R10Chip0DDRAM.Byte[i] = 0;
        BU98R10Chip1DDRAM.Byte[i] = 0;
    }
}


void Gauge_Service(void)
{
李俭双's avatar
李俭双 committed
68
    static uint16_t VSpeed_Count = 0u;    
69
    uint8_t k = 0;
李俭双's avatar
李俭双 committed
70 71 72 73
    if (ClearODO_Flag == 1)
    {
        if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
        {
74 75 76
            Check_SEG_Display();    
            for(k = 0; k < LampCh0_MAX; k ++)     
            {
77
                if (k == 24 || k == 21 || k == 13 || k == 26)
78
                {
79
                    //k ++;
80 81 82 83 84 85 86 87
                }
                else
                {
                    LED_Driver_Channel_Set(LampChannel_0, k, LED_ON); 
                }
                
            }
            
李俭双's avatar
李俭双 committed
88 89 90
        }
        else
        {
91 92 93 94 95 96 97 98 99 100
            Clear_Bu98();  
            for(k = 0; k < LampCh0_MAX; k ++)     
            {
                LED_Driver_Channel_Set(LampChannel_0, k, LED_OFF); 
            }
            //LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_OFF);
            //LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
            //LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_OFF);
            //LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_KMH, LED_OFF);
            //LED_Driver_Channel_Set(LampChannel_0, LampCh0_09_MPH, LED_OFF);         
李俭双's avatar
李俭双 committed
101 102 103 104 105 106 107 108
        }
    }
    else
    {
        if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
        {
            if (Common_GetIgnOnTime() >= 3000)
            {
李俭双's avatar
李俭双 committed
109 110
                //for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
                //{
李俭双's avatar
李俭双 committed
111 112
                //    BU98R10Chip0DDRAM.Byte[i] = 0x77;
                //    BU98R10Chip1DDRAM.Byte[i] = 0x77;
李俭双's avatar
李俭双 committed
113
                //}
李俭双's avatar
李俭双 committed
114
                
115 116
                
                SEG_SET_VSpeed_NUM(1u, Get_DispVechileSpeed( ) / 10u,Get_Dis_KM_Unit());
李俭双's avatar
李俭双 committed
117

李俭双's avatar
李俭双 committed
118 119 120 121 122 123
                SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(Get_Dis_KM_Unit(), Get_ODO_Value() / 10u, Get_Trip_Value());
                Gauge_Clock_Display();                
                SEG_SET_FuelDial(1, Get_CurFuelSetp());
                SEG_SET_EspeedDial(1,  Get_DispEngineSpeed()/500);
                SEG_SET_CoolantDial(1, GET_DataCoolantTempSegDisp(), GET_DataCoolantTempValueDisp(), GET_DataCollantTempSegValid());
                SEG_SET_Voltage_NUM(1, Get_Battery_Voltage());
124
            #if(IC_Current == TY200_080000b_ty) 
125 126 127
                SEG_SET_TPMS_DISPLAY(1, Get_Front_TPMS_Sig_Value(), Get_Rear_TPMS_Sig_Value(), 0 ,Get_Front_TPMS_Sig_Vaild(), Get_Rear_TPMS_Sig_Vaild());    
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_03, LED_ON);   
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_04, LED_ON); 
128
            #endif    
129
                SEG_SET_Navigation_STS(Get_Navigation_St_Dis(),Get_Navigation_Code_Dis(),Get_Navigation_Mileage_Dis());
130
          
李俭双's avatar
李俭双 committed
131 132 133
            }
            else
            {            
134 135
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_03, LED_ON);   
                LED_Driver_Channel_Set(LampChannel_0, LampCh0_04, LED_ON); 
李俭双's avatar
李俭双 committed
136 137 138 139 140 141
                Checkself_SEG_Display();                
            }
        }
        else
        {
            Clear_Bu98();
142 143 144

            LED_Driver_Channel_Set(LampChannel_0, LampCh0_03, LED_OFF);   
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_04, LED_OFF); 
145 146 147 148 149 150
           
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_KMH, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_09_MPH, LED_OFF);
151 152 153 154
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_Navigator1, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_19_Navigator2, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_17_Length2, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_18_Length1, LED_OFF);
155
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_ARRIVED_SERVICE_AREA, LED_OFF);
156 157
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_ARRIVED_TOLLGATE, LED_OFF);
            LED_Driver_Channel_Set(LampChannel_0, LampCh0_16_ARRIVED_TUNNEL, LED_OFF);
李俭双's avatar
李俭双 committed
158 159 160 161 162
        }
    }    
        
}