Commit f3d02bcc authored by 李梓源's avatar 李梓源

feat:增加光控大灯与转向开关电压显示

parent 46706fb5
...@@ -4411,19 +4411,24 @@ void Display_Send_ODO(uint8_t fuel) ...@@ -4411,19 +4411,24 @@ void Display_Send_ODO(uint8_t fuel)
} }
uint8_t CHECK_Value = 1; uint8_t CHECK_Value = 1;
uint8_t DIS_VALUE = 0; uint8_t DIS_VALUE = 0;
const uint16_t Volatile[] = {90,80};
void Display_Send_Vspead(uint8_t menu) void Display_Send_Vspead(uint8_t menu)
{ {
uint8_t fuel_val = 0; uint8_t fuel_val = 0;
static uint8_t Type_Clear = 0; static uint8_t Type_Clear = 0;
uint8_t VSpeed_val = 0; uint8_t VSpeed_val = 0;
uint16_t GKDD_Voltage = 0;
uint16_t ZXSW_Voltage = 0;
uint16_t Voltage_left = 0;
uint16_t Voltage_right = 0;
// static uint8_t Type_Clear_FLAG = 0; // static uint8_t Type_Clear_FLAG = 0;
if ( (Type_Clear != menu )) if ( (Type_Clear != menu ))
{ {
Type_Clear = menu; Type_Clear = menu;
Display_TFT_Clear(); Display_TFT_Clear();
} }
if(menu > 0) // if(menu > 0)
{ // {
switch (menu) switch (menu)
{ {
...@@ -4491,7 +4496,14 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4491,7 +4496,14 @@ void Display_Send_Vspead(uint8_t menu)
CHECK_Value = 1; CHECK_Value = 1;
break; break;
case 5: case 5:
if(ZXSW_AD == 1) ZXSW_Voltage = ADC_Read_Signal(ADC_CH_ZXSW_VOLTAGE);
Voltage_left = ZXSW_Voltage/1000;
Voltage_right = (ZXSW_Voltage/10)%10;
uint8_t mLRbuff [3] = {0x2E,Voltage_right,0xff};
General_Number_Disp(mLRbuff, 175, 160);
GUI_General_Digit_Display(Voltage_left, Num_15, 2, 1, ODODigitNum09PosX, 160);
TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Dyy_words_19X224_Y166); //单位:V
if(ZXSW_Voltage >= 10000)
{ {
CHECK_Value = 1; CHECK_Value = 1;
TFT_LCD_Draw_Bmp(51,261,( uint8_t * )gImage_Alarm_11_Word0X51_Y261); TFT_LCD_Draw_Bmp(51,261,( uint8_t * )gImage_Alarm_11_Word0X51_Y261);
...@@ -4502,7 +4514,14 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4502,7 +4514,14 @@ void Display_Send_Vspead(uint8_t menu)
} }
break; break;
case 6: case 6:
if(ZXSW_AD == 1) ZXSW_Voltage = ADC_Read_Signal(ADC_CH_ZXSW_VOLTAGE);
Voltage_left = ZXSW_Voltage/1000;
Voltage_right = (ZXSW_Voltage/10)%10;
uint8_t mLRbuff1 [] = {0x2E,Voltage_right,0xff};
General_Number_Disp(mLRbuff1, 175, 160);
GUI_General_Digit_Display(Voltage_left, Num_15, 2, 1, ODODigitNum09PosX, 160);
TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Dyy_words_19X224_Y166); //单位:V
if(ZXSW_Voltage >= 10000)
{ {
CHECK_Value = 1; CHECK_Value = 1;
TFT_LCD_Draw_Bmp(51,261,( uint8_t * )gImage_Alarm_11_Word0X51_Y261); TFT_LCD_Draw_Bmp(51,261,( uint8_t * )gImage_Alarm_11_Word0X51_Y261);
...@@ -4512,8 +4531,15 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4512,8 +4531,15 @@ void Display_Send_Vspead(uint8_t menu)
TFT_LCD_Draw_Box(0, 261, 239, 319, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR); TFT_LCD_Draw_Box(0, 261, 239, 319, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
} }
break; break;
case 7: case 7:
if(Light_control_headlights == 1) GKDD_Voltage = ADC_Read_Signal(ADC_CH_GKDD_VOLTAGE);
Voltage_left = GKDD_Voltage/1000;
Voltage_right = (GKDD_Voltage/10)%10;
uint8_t mLRbuff2 [] = {0x2E,Voltage_right,0xff};
General_Number_Disp(mLRbuff2, 175, 160);
GUI_General_Digit_Display(Voltage_left, Num_15, 2, 1, ODODigitNum09PosX, 160);
TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Dyy_words_19X224_Y166); //单位:V
if(GKDD_Voltage >= 10000)
{ {
CHECK_Value = 1; CHECK_Value = 1;
TFT_LCD_Draw_Bmp(51,261,( uint8_t * )gImage_Alarm_06_Word0X51_Y261); TFT_LCD_Draw_Bmp(51,261,( uint8_t * )gImage_Alarm_06_Word0X51_Y261);
...@@ -4571,7 +4597,7 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4571,7 +4597,7 @@ void Display_Send_Vspead(uint8_t menu)
} // }
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* \attention * \attention
* *
* This file is automatically generated by analog signals configuration tool. * This file is automatically generated by analog signals configuration tool.
* Date : 2022/8/3 23:21:24 * Date : 2025/3/10 11:57:37
* Cfg Tool Ver : 1.1.0 * Cfg Tool Ver : 1.1.0
* Engineer : * Engineer :
* (c) Heilongjiang TYW electronics co., LTD * (c) Heilongjiang TYW electronics co., LTD
* *
******************************************************************************/ ******************************************************************************/
...@@ -74,7 +74,7 @@ ADC_Data_st_t stADCData[ADC_SIGNAL_CH_NUMBER]; ...@@ -74,7 +74,7 @@ ADC_Data_st_t stADCData[ADC_SIGNAL_CH_NUMBER];
const uint8_t u8ADCChList[ADC_CONV_CH_NUMBER] = const uint8_t u8ADCChList[ADC_CONV_CH_NUMBER] =
{ {
9U, 15U, 14U , 9U, 15U, 12U, 13U,
}; };
const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] = const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] =
...@@ -82,13 +82,15 @@ const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] = ...@@ -82,13 +82,15 @@ const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] =
{ 0U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,}, { 0U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
{ 1U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,}, { 1U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
{ 2U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,}, { 2U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,},
{ 3U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,},
}; };
const ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] = const ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] =
{ {
{ 0U, 100000U, 0U, 0U,}, { 0U, 100000U, 0U, 0U,},
{ 0U, 100000U, 0U, 0U,}, { 0U, 100000U, 0U, 0U,},
{ 330000U, 47000U, 0U, 0U,}, { 3300000U, 1000000U, 0U, 0U,},
{ 3300000U, 1000000U, 0U, 0U,},
}; };
/* Private function prototypes ----------------------------------------------*/ /* Private function prototypes ----------------------------------------------*/
...@@ -231,7 +233,7 @@ void Analog_Signal_Conv_Service(void) ...@@ -231,7 +233,7 @@ void Analog_Signal_Conv_Service(void)
{ {
u8Valid = 0U; u8Valid = 0U;
} }
if (u8Valid) if (u8Valid)
{ {
u16Result = stADCChCfg[stADCCtrl.u8CurrentCh].pfProcFunc(u16Voltage, u16Result = stADCChCfg[stADCCtrl.u8CurrentCh].pfProcFunc(u16Voltage,
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* \attention * \attention
* *
* This file is automatically generated by analog signals configuration tool. * This file is automatically generated by analog signals configuration tool.
* Date : 2022/8/3 23:21:24 * Date : 2025/3/10 11:57:37
* Cfg Tool Ver : 1.1.0 * Cfg Tool Ver : 1.1.0
* Engineer : * Engineer :
* (c) Heilongjiang TYW electronics co., LTD * (c) Heilongjiang TYW electronics co., LTD
* *
******************************************************************************/ ******************************************************************************/
...@@ -29,12 +29,13 @@ enum ADCChName ...@@ -29,12 +29,13 @@ enum ADCChName
{ {
ADC_CH_KL15_VOLTAGE = 0, ADC_CH_KL15_VOLTAGE = 0,
ADC_CH_KL30_VOLTAGE, ADC_CH_KL30_VOLTAGE,
ADC_CH_10_VOLTAGE, ADC_CH_GKDD_VOLTAGE,
ADC_CH_ZXSW_VOLTAGE,
}; };
/* Exported macro ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/
#define ADC_TOTAL_CH_NUMBER (3U) #define ADC_TOTAL_CH_NUMBER (4U)
#define ADC_SIGNAL_CH_NUMBER (3U) #define ADC_SIGNAL_CH_NUMBER (4U)
#define ADC_REF_VOLTAGE u16ADCRefVoltage #define ADC_REF_VOLTAGE u16ADCRefVoltage
/* Exported variables --------------------------------------------------------*/ /* Exported variables --------------------------------------------------------*/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* \attention * \attention
* *
* This file is automatically generated by analog signals configuration tool. * This file is automatically generated by analog signals configuration tool.
* Date : 2025/3/5 20:42:21 * Date : 2025/3/10 11:57:37
* Cfg Tool Ver : 1.1.0 * Cfg Tool Ver : 1.1.0
* Engineer : * Engineer :
* (c) Heilongjiang TYW electronics co., LTD * (c) Heilongjiang TYW electronics co., LTD
...@@ -27,13 +27,15 @@ extern { ...@@ -27,13 +27,15 @@ extern {
/* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/
enum ADCChName enum ADCChName
{ {
ADC_CH_12_VOLTAGE = 0, ADC_CH_KL15_VOLTAGE = 0,
ADC_CH_13_VOLTAGE, ADC_CH_KL30_VOLTAGE,
ADC_CH_GKDD_VOLTAGE,
ADC_CH_ZXSW_VOLTAGE,
}; };
/* Exported macro ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/
#define ADC_TOTAL_CH_NUMBER (2U) #define ADC_TOTAL_CH_NUMBER (4U)
#define ADC_SIGNAL_CH_NUMBER (2U) #define ADC_SIGNAL_CH_NUMBER (4U)
#define ADC_REF_VOLTAGE u16ADCRefVoltage #define ADC_REF_VOLTAGE u16ADCRefVoltage
/* Exported variables --------------------------------------------------------*/ /* Exported variables --------------------------------------------------------*/
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* \attention * \attention
* *
* This file is automatically generated by analog signals configuration tool. * This file is automatically generated by analog signals configuration tool.
* Date : 2025/3/5 20:42:21 * Date : 2025/3/10 11:57:37
* Cfg Tool Ver : 1.1.0 * Cfg Tool Ver : 1.1.0
* Engineer : * Engineer :
* (c) Heilongjiang TYW electronics co., LTD * (c) Heilongjiang TYW electronics co., LTD
...@@ -74,19 +74,23 @@ ADC_Data_st_t stADCData[ADC_SIGNAL_CH_NUMBER]; ...@@ -74,19 +74,23 @@ ADC_Data_st_t stADCData[ADC_SIGNAL_CH_NUMBER];
const uint8_t u8ADCChList[ADC_CONV_CH_NUMBER] = const uint8_t u8ADCChList[ADC_CONV_CH_NUMBER] =
{ {
12U, 13U, 9U, 15U, 12U, 13U,
}; };
const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] = const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] =
{ {
{ 0U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,}, { 0U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
{ 1U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,}, { 1U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
{ 2U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,},
{ 3U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,},
}; };
const ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] = const ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] =
{ {
{ 0U, 100000U, 0U, 0U,},
{ 0U, 100000U, 0U, 0U,},
{ 3300000U, 1000000U, 0U, 0U,},
{ 3300000U, 1000000U, 0U, 0U,}, { 3300000U, 1000000U, 0U, 0U,},
{ 3300000U, 100000U, 0U, 0U,},
}; };
/* Private function prototypes ----------------------------------------------*/ /* Private function prototypes ----------------------------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment