Commit c9abbe84 authored by 时昊's avatar 时昊

feat:增加硬线功能

parent 2dc7eef3
......@@ -5,63 +5,156 @@
const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnLeft, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnRight, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 60U, 20U, Get_LINE_IN_HighBeam, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Turn_Left, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Turn_Right, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 60U, 20U, Get_LINE_IN_High_Beam, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Efi_Fault, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_ABS, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Oil_Pressure_Alert, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Voltage, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_Fuel_Level_Low, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_E, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_S, },
};
Linelib_uint8_t Get_LINE_IN_TurnLeft(void)
Linelib_uint8_t Get_LINE_IN_Turn_Left(void)
{
Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(LeftTurn_P_In))
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
//else
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_TurnRight(void)
Linelib_uint8_t Get_LINE_IN_Turn_Right(void)
{
Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(RightTurn_P_In))
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
//else
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_HighBeam(void)
Linelib_uint8_t Get_LINE_IN_High_Beam(void)
{
Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(HighBeam_P_In))
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
//else
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Efi_Fault(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_ABS(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void)
{
Linelib_uint8_t ret = 0U;
//if (RTE_GPIO_Get_Level(START_STOP_P_IN))
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Voltage(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_Fuel_Level_Low(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_E(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_S(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(LeftTurn_MUC_OUT))
{
ret = 1u;
}
//else
else
{
ret = 0UL;
}
......@@ -74,7 +167,7 @@ Linelib_uint8_t LINE_IN_Men[LINE_IN_MAX * LINE_IN_BLOCK_SIZE];
static Linelib_uint16_t LINE_GET_PWR(void)
{
Linelib_uint16_t Res;
//Res = Common_Get_IG_Sts() & 0x00FFu;
Res = Common_Get_IG_Sts() & 0x00FFu;
return Res;
}
......
......@@ -5,19 +5,31 @@
typedef enum
{
LINE_IN_TurnLeft = 0,
LINE_IN_TurnRight,
LINE_IN_HighBeam,
LINE_IN_Auto_Start_Stop,
LINE_IN_Turn_Left,
LINE_IN_Turn_Right,
LINE_IN_High_Beam,
LINE_IN_Efi_Fault,
LINE_IN_ABS,
LINE_IN_Auto_Start_Stop,
LINE_IN_Oil_Pressure_Alert,
LINE_IN_Voltage,
LINE_IN_Fuel_Level_Low,
LINE_IN_E,
LINE_IN_S,
LINE_IN_MAX,
} LINE_IN_Enum_t;
extern void LINE_IN_Init(void);
Linelib_uint8_t Get_LINE_IN_TurnLeft(void);
Linelib_uint8_t Get_LINE_IN_TurnRight(void);
Linelib_uint8_t Get_LINE_IN_HighBeam(void);
Linelib_uint8_t Get_LINE_IN_Turn_Left(void);
Linelib_uint8_t Get_LINE_IN_Turn_Right(void);
Linelib_uint8_t Get_LINE_IN_High_Beam(void);
Linelib_uint8_t Get_LINE_IN_Efi_Fault(void);
Linelib_uint8_t Get_LINE_IN_ABS(void);
Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void);
Linelib_uint8_t Get_LINE_IN_Oil_Pressure_Alert(void);
Linelib_uint8_t Get_LINE_IN_Voltage(void);
Linelib_uint8_t Get_LINE_IN_Fuel_Level_Low(void);
Linelib_uint8_t Get_LINE_IN_E(void);
Linelib_uint8_t Get_LINE_IN_S(void);
#endif
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