/*
 * Global_Variable.h
 *
 *  Created on: 2024. 4. 15.
 *      Author: User
 */

#ifndef GLOBAL_VARIABLE_H_
#define GLOBAL_VARIABLE_H_
#include "stdint.h"
#include "main.h"
#include "define.h"
/*----------------------------------------Variables----------------------------------------*/
/* Variable Name : IG_Process_Status
 * Data Type : uint8
 * Description : for Debug and Check System Status
 * Value Table :
 * 0 : Key_off_Process / 1 : Key_off_Completed / 2 : Key_on_Process / 3 : Key_on_Completed
 * Requirement : Tx this Signal, CH1
 */


/*======================================== Input Data ========================================*/
/*------------------------------ CH0 ------------------------------*/
// Input_Data_Set_RC_VCU_Signal1_CH0_0x040
extern float	GV_RC_BrakeTorqueCommand;
extern float	GV_RC_BrakeTorqueCommand_Master;
extern float	GV_Master_Brake_Torque_Command;
extern float	GV_RC_RWA_RackAngleCommand;
extern float 	GV_Brake_Torque_Command;
extern uint32_t	GV_RC_Drive_ACC_Cmd;
extern uint32_t	GV_RC_Vx_Command;
extern uint32_t	GV_RC_VCU_counter1;
extern uint32_t	GV_RC_VCU_counter1_CHECK;
extern uint32_t	GV_RC_VCU_CRC1;
extern uint32_t	GV_RC_ALV_FLAG;

// Input_Data_Set_RC_VCU_Signal2_CH0_0x041
extern uint32_t	GV_RC_Drive_Mode;
extern uint32_t	GV_RC_GearSelStat;
extern uint32_t	GV_RC_ParkBrake_Cmd;
extern uint32_t	GV_RC_Emergency_Stop;
extern uint32_t	GV_RC_VCU_long_Ctl_mode;
extern uint32_t	GV_RC_VCU_ARC;
extern uint32_t	GV_RC_VCU_CRC2;
extern uint32_t	GV_RC_VX_Limit;

// Input_RC_VCU_Fault_Flag_CH0_0x042
extern uint8_t	GV_RC_VCU_ACU_Fault_Flag;
extern uint8_t	GV_RC_VCU_MCU_Actuator_Fault_Flag;
extern uint8_t	GV_RC_VCU_RWA_Actuator_Fault_Flag;

// Input_Data_Set_IMU_TX1_CH0_0x174
extern float	GV_IMU_YawRtVal;
extern uint32_t	GV_IMU_CLU_STAT;
extern uint32_t	GV_IMU_YAW_RATE_STAT;
extern uint32_t	GV_IMU_TEMP_RATE;
extern float	GV_IMU_AY_Val;
extern uint32_t	GV_IMU_MSG_TX1_CNT;
extern uint32_t	GV_IMU_AY_STAT;
extern uint32_t	GV_IMU_TX1_CRC;

// Input_Data_Set_IMU_TX1_CH0_0x178
extern float	GV_IMU_RollRtVal;
extern uint32_t	GV_IMU_CLU_STAT5;
extern uint32_t	GV_IMU_ROLL_RATE_STAT;
extern uint32_t	GV_IMU_CLU_DIAG;
extern float	GV_IMU_AX_Val;
extern uint32_t	GV_IMU_MSG_TX2_CNT;
extern uint32_t	GV_IMU_AX_STAT;
extern uint32_t	GV_IMU_TX2_CRC;

// Input_Data_Set_IMU_TX1_CH0_0x17C
extern float	GV_IMU_PitchRtVal;
extern uint32_t	GV_IMU_HW_Index;
extern uint32_t	GV_IMU_PITCH_RATE_STAT;
extern float	GV_IMU_AZ_Val;
extern uint32_t	GV_IMU_MSG_TX3_CNT;
extern uint32_t	GV_IMU_AZ_STAT;
extern uint32_t	GV_IMU_TX3_CRC;

// Input_Data_Set_EPAM_VCU_CH0_0x221
extern uint32_t	GV_EPAM_driveSensor;
extern uint32_t	GV_EPAM_parkSensor;
extern uint32_t	GV_EPAM_parkLock;
extern uint32_t	GV_EPAM_ParkRequestStatus;
extern uint32_t	GV_EPAM_Voltage;
extern uint32_t	GV_EPAM_Current;
extern uint32_t	GV_EPAM_Temperature;
extern uint32_t	GV_EPAM_HallPosition;
extern uint32_t	GV_ErrEPAM_MotStallMiddle;
extern uint32_t	GV_ErrEPAM_MotStallUnPark;
extern uint32_t	GV_ErrEPAM_MotStallPark;
extern uint32_t	GV_ErrEPAM_MotOpen;
extern uint32_t	GV_ErrEPAM_MotFail;
extern uint32_t	GV_EPAM_State;
extern uint32_t	GV_ErrEPAM_CommErr;
extern uint32_t	GV_ErrEPAM_HallSenErr;
extern uint32_t	GV_ErrEPAM_OT_ECU;
extern uint32_t	GV_ErrEPAM_CANErr;
extern uint32_t	GV_ErrEPAM_HallPaternError;
extern uint32_t	GV_ErrEPAM_HallTimeOut;
extern uint32_t	GV_ErrEPAM_DCBusUnderVoltage;
extern uint32_t	GV_ErrEPAM_DCBusOverVoltage;
extern uint32_t	GV_ErrEPAM_DCBusOverCurrent;

// Input_Data_Set_MCU_VCU_Signals1_CH0_0x300
extern uint32_t	GV_MCU_Ready;
extern uint32_t	GV_MCU_Controlable;
extern uint32_t	GV_MCU_FltSta;
extern uint32_t	GV_MCU_Interlock;
extern float	GV_MCU_CurGearSta;
extern uint32_t	GV_MCU_GearStaInv;
extern uint32_t	GV_MCU_Derating;
extern uint32_t	GV_MCU_SvrFlt;
extern float	GV_MCU_MtrTemp;
extern float	GV_MCU_InvTemp;
extern float	GV_MCU_RPM;
extern float	GV_MCU_EstTrq;

// Input_Data_Set_BCM_VCU_Signal1_CH0_0x570
extern uint8_t	GV_Lamp_Hazard_STA;
extern uint8_t	GV_Lamp_Break_STA;
extern uint8_t	GV_Lamp_HBEAM_STA;
extern uint8_t	GV_Lamp_Head_STA;
extern uint8_t	GV_Lamp_LTRN_STA;
extern uint8_t	GV_Lamp_Reverse_STA;
extern uint8_t	GV_Lamp_RTRN_STA;
extern uint8_t	GV_Lamp_Position_STA;
extern uint8_t	GV_Lamp_DRL_STA;
extern uint32_t	GV_Status_Wiper_STA;
extern uint32_t	GV_BCM_CE1_STA;
extern uint32_t	GV_BCM_CE2_STA;
extern uint32_t	GV_BCM_CE3_STA;
extern uint32_t	GV_BCM_CE4_STA;
extern uint32_t	GV_BCM_CE5_STA;
extern uint32_t	GV_BCM_MAINSW_STA;
extern float	GV_Battery_Voltage;
extern uint32_t	GV_BCM_VCU_counter1;
extern uint32_t	GV_BCM_VCU_CRC1;
extern uint32_t	GV_BCM_VCU_counter3;
extern uint32_t	GV_BCM_VCU_CRC3;
extern uint32_t	GV_BCM_Sys_Status;
extern uint8_t	GV_LDC_STA;

// Input_Data_Set_BCM_VCU_Signal2_CH0_0x580
extern uint32_t	GV_ChargingStatus;
extern uint32_t	GV_BCM_ChgeCon_DTD;
extern uint8_t	GV_BMS_HVOn_STA;
extern uint8_t	GV_OBC_Interlock;
extern uint8_t	GV_BMS_Interlock;
extern uint32_t	GV_BMS_SOC;
extern uint32_t	GV_BMS_SOH;
extern uint32_t	GV_CommSta_OBC;
extern uint32_t	GV_CommSta_VCU;
extern uint32_t	GV_CommSta_BMS;
extern uint32_t	GV_CommSta_LDC;
extern uint32_t	GV_CommSta_TMS;
extern uint32_t	GV_BMS_SOH_INV;
extern uint32_t	GV_BMS_SOC_INV;
extern uint32_t	GV_Bms_Soc_Wrng;
extern uint32_t	GV_Bms_SoH_Wrng;
extern uint32_t	GV_BCM_VCU_counter2;
extern uint32_t	GV_BCM_VCU_CRC2;

//Input_Data_Set_BCM_VCU_Signal5_CH0_0x585
extern uint8_t 	GV_BMS_FltSta;
extern uint8_t 	GV_BMS_TEMP_FAULT;
extern uint8_t 	GV_TMS_FltSta;
extern float   	GV_OBC_TEMP;
extern float   	GV_LDC_TEMP;
extern uint8_t 	GV_OBC_ACTL_CUR;
extern uint8_t	GV_OBC_TRGT_CUR;
extern uint8_t 	GV_User_SoC;
extern uint8_t 	GV_LDC_FltSta;
extern uint8_t 	GV_LDC_TEMP_FAULT;

// Input_Data_Set_BCM_VCU_Signal3_CH0_0x590
extern float 	GV_Bms_PackCur;
extern float 	GV_Bms_PackVolt;
extern uint16_t	GV_Bms_PackPwr;

// Input_Data_Set_BCM_VCU_Signal4_CH0_0x595
extern uint8_t 	GV_LDC_ACTL_VOLT;
extern uint8_t 	GV_LDC_ACTL_CUR;




/*------------------------------ CH1 ------------------------------*/
// Input_Data_Set_ACU_VCU_Signal1_CH1_0x091
extern uint32_t	GV_ACU_Vx_Command;
extern float	GV_ACU_Drive_ACC_Cmd;
extern float	GV_ACU_BrakeTorqueCommand;
extern uint32_t	GV_ACU_VCU_counter1;
extern uint32_t	GV_ACU_VCU_CRC1;

// Input_Data_Set_ACU_VCU_Signal2_CH1_0x092
extern float	GV_ACU_RWA_cmd_deg;
extern float	GV_ACU_RWS_cmd_deg;
extern uint32_t	GV_ACU_VCU_counter2;
extern uint32_t	GV_ACU_VCU_CRC2;

// Input_Data_Set_ACU_VCU_Signal3_CH1_0x093
extern uint32_t	GV_ACU_Drive_mode;
extern uint32_t	GV_ACU_long_Ctl_mode;
extern uint32_t	GV_ACU_EPAM_req;
extern uint32_t	GV_ACU_VCU_GearPos;
extern uint32_t	GV_ACU_Emergency_Stop;
extern uint32_t	GV_ACU_VCU_counter3;
extern uint32_t	GV_ACU_VCU_CRC3;

// Input_Data_Set_ACU_BCM_Signal_1_CH1_0x151
extern uint32_t GV_ACU_Lamp_BRAKE_CMD;
extern uint32_t GV_ACU_Lamp_Hazard_CMD;
extern uint32_t GV_ACU_Lamp_HBEAM_CMD;
extern uint32_t GV_ACU_Lamp_Head_CMD;
extern uint32_t GV_ACU_Lamp_LTRN_CMD;
extern uint32_t GV_ACU_Lamp_Reverse_CMD;
extern uint32_t GV_ACU_Lamp_RTRN_CMD;
extern uint32_t GV_ACU_Lamp_Position_CMD;
extern uint32_t GV_ACU_Lamp_DRL_CMD;
extern uint32_t GV_ACU_Wiper_CMD;
extern uint32_t	GV_ACU_VCU_counter;




/*------------------------------ CH2 ------------------------------*/
// Input_Data_Set_RWA_Status1_CH2_0x072
extern uint32_t	GV_RWA1_Arc;
extern uint32_t	GV_RWA1_Crc;
extern uint32_t	GV_RWA1_EcuPowerMode;
extern uint32_t	GV_RWA1_EcuRole;
extern uint32_t	GV_RWA1_EcuStatus;
extern uint32_t	GV_RWA1_MaxMotorOutputValid;
extern float	GV_RWA1_VCU_MaxMotorOutput;
extern float	GV_RWA1_VCU_RackAngleSpeedFbk;
extern uint32_t	GV_RWA1_RackAngleSpeedFbkValid;
extern uint32_t	GV_RWA1_SysInfo;
extern uint32_t	GV_RWA1_WarningLamp;

// Input_Data_Set_RWA_Status2_CH2_0x073
// extern uint32_t GV_RWA1_Arc;
// extern uint32_t GV_RWA1_Crc;
extern float	GV_RWA1_RackAngleFbk;
extern uint32_t	GV_RWA1_RackAngleFbkValid;
extern float	GV_RWA1_RackForceFbk;
extern uint32_t	GV_RWA1_RackForceFbkValid;

// Input_Data_Set_IDB_RegenTcsRequest_CH2_0x082
extern float 	GV_IDB_VCU_RbcTargetRegenTorque;
extern float 	GV_IDB_VCU_TcsTorqueCmd;

// Input_Data_Set_IDB_Status_CH2_0x092
extern uint8_t	GV_IDB_Arc;
extern float	GV_IDB_VCU_EscYawRateThreshold;

// Input_Data_Set_IDB_TireSlipStatus_CH2_0x096
extern float 	GV_IDB_VCU_FrontLeftTireSlipRatio;
extern float 	GV_IDB_VCU_FrontRightTireSlipRatio;
extern float 	GV_IDB_VCU_RearLeftTireSlipRatio;
extern float 	GV_IDB_VCU_RearRightTireSlipRatio;

// Input_Data_Set_IDB_BrakeStatus1_CH2_0x09A
extern float 	GV_IDB_VCU_EstimatedVehicleSpeed;
extern float 	GV_IDB_VCU_MasterCylinderPressure;
extern float 	GV_IDB_VCU_RoadFrictionCoefficient;

// Input_Data_Set_IDB_PressureStatus_CH2_0x0A0
extern float 	GV_IDB_VCU_FrontLeftEstimatedPressure;
extern float 	GV_IDB_VCU_FrontRightEstimatedPressure;
extern float 	GV_IDB_VCU_RearLeftEstimatedPressure;
extern float 	GV_IDB_VCU_RearRightEstimatedPressure;

// Input_Data_Set_RWA_Status3_CH2_0x0AA
extern float 	GV_RWA1_VCU_PolValue;
extern float 	GV_RWA1_VCU_SysBatteryVoltage;
extern float 	GV_RWA1_VCU_SysIqCurrent;




/*------------------------------ CH3 ------------------------------*/
// Input_Data_Set_RWA_Status1_CH3_0x072
extern uint32_t	GV_RWA2_Arc;
extern float	GV_RWA2_VCU_CH3_0x072_MaxMotorOutput;
extern float	GV_RWA2_VCU_CH3_0x072_RackAngleSpeedFbk;

// Input_Data_Set_RWA_Status2_CH3_0x073
extern float	GV_RWA2_RackAngleFbk;
extern float 	GV_RWA2_RackForceFbk;

// Input_Data_Set_RCU_BrakeStatus1_CH3_0x09B
extern float 	GV_RCU_VCU_EstimatedVehicleSpeed;
extern float	GV_RCU_VCU_RoadFrictionCoefficient;
extern uint32_t GV_VCU_RCU_Brk_Pressure_Fbk;

// Input_Data_Set_RCU_PressureStatus_CH3_0x0A1
extern float	GV_RWA2_FrontLeftEstimatedPressure;
extern float	GV_RWA2_FrontRightEstimatedPressure;

// Input_Data_Set_RWA_Status3_CH3_0x0AA
extern float 	GV_RWA2_PolValue;
extern float 	GV_RWA2_SysBatteryVoltage;
extern float	GV_RWA2_SysIqCurrent;

// Input_Data_Set_RCU_Status_CH3_0x093
extern uint8_t	GV_RCU_Arc;
extern float 	GV_EscYawRateThreshold;

// Input_Data_Set_RCU_TireSlipStatus_CH3_0x097
extern float 	GV_RCU_VCU_FrontLeftTireSlipRatio;
extern float 	GV_RCU_VCU_FrontRightTireSlipRatio;
extern float 	GV_RCU_VCU_RearLeftTireSlipRatio;
extern float 	GV_RCU_VCU_RearRightTireSlipRatio;




/*------------------------------ CH4 ------------------------------*/




/*------------------------------ CH5 ------------------------------*/




/*======================================== Output Data ========================================*/
/*------------------------------ CH0 ------------------------------*/
// Output_Data_Set_VCU_RC_Signals1_CH0_0x010
extern uint32_t	GV_VCU_MCU_EstTrq;
extern float	GV_VCU_RWA_Rack_Fbk;
extern uint32_t	GV_VCU_Brk_Pressure_Fbk;
extern float	GV_VCU_Vx_Fbk;
extern uint32_t	GV_VCU_Vx_Limit;
extern uint32_t	GV_VCU_RC_counter1;
extern uint32_t	GV_VCU_RC_CRC1;

// Output_Data_Set_VCU_RC_Signals2_CH0_0x011
extern uint32_t	GV_VCU_RC_BMS_SOC;
extern uint32_t	GV_VCU_RC_long_Ctl_mode;
extern uint32_t	GV_VCU_RC_Emergency_Stop;
extern uint32_t	GV_VCU_GearSelStat;
extern uint32_t	GV_VCU_Drive_Mode;
extern uint32_t	GV_VCU_ParkBrake_Fbk;
extern uint32_t	GV_VCU_Acc_Limit;
extern uint32_t	GV_VCU_Acc_Fbk;

// Output_Data_Set_CAR_STAT_CH0_0x012
extern uint32_t	GV_CAR_Bms_PackVolt;
extern float	GV_CAR_Bms_PackCur;
extern uint32_t	GV_CAR_Battery_Voltage;
extern uint32_t	GV_CAR_LDC_ACTL_CUR;
extern uint32_t	GV_CAR_LDC_ACTL_VOLT;
extern uint32_t	GV_CAR_ChargingStatus;
extern uint32_t	GV_CAR_BMS_HVOn_STA;
extern uint32_t	GV_CAR_ARC;

// Output_Data_Set_VCU_MCU_Fault_mode_CH0_0x013
extern uint8_t 	GV_VCU_RC_ACU_Fault_Flag;
extern uint8_t	GV_VCU_RC_MCU_Actuator_Fault_Flag;
extern uint8_t	GV_VCU_RC_IDB_ECU_Fault_Flag;
extern uint8_t	GV_VCU_RC_RCU_ECU_Fault_Flag;
extern uint8_t	GV_VCU_RC_RWA1_ECU_Fault_Flag;
extern uint8_t	GV_VCU_RC_RWA2_ECU_Fault_Flag;
extern uint8_t	GV_VCU_RC_RWA_Actuator_Fault_Flag;

// Output_Data_Set_VCU_RWA_Fault_mode_CH0_0x014
extern uint32_t GV_VCU_RWA1_CMD;
extern uint32_t GV_VCU_RWA2_CMD;
extern uint32_t GV_VCU_RWA1_WakeupCommand;
extern uint32_t GV_VCU_RWA2_WakeupCommand;
extern uint32_t GV_VCU_RWA1_2_FAULT;

// Output_Data_Set_VCU_RWS_Fault_mode_CH0_0x015
extern uint32_t GV_VCU_RWS1_CMD;
extern uint32_t GV_VCU_RWS2_CMD;
extern uint32_t GV_VCU_RWS1_WakeupCommand;
extern uint32_t GV_VCU_RWS2_WakeupCommand;
extern uint32_t GV_VCU_RWS1_2_FAULT;

// Output_Data_Set_VCU_IDB_RCU_Fault_mode_CH0_0x016
extern uint32_t GV_VCU_IDB_Fault;
extern uint32_t GV_VCU_RCU_Fault;
extern uint32_t GV_VCU_IDB_WakeupCommand;
extern uint32_t GV_VCU_RCU_WakeupCommand;

// Output_Data_Set_RWA_VCU_RC_Signal1_CH0_0x050
extern uint32_t	GV_CH0_RWA_RackAngleFbk1;
extern uint32_t	GV_CH0_RWA_RackAngleSpeedFbk1;
extern uint32_t	GV_CH0_RWA_VCU_RC_counter1;
extern uint32_t	GV_CH0_RWA_VCU_RC_CRC1;

// Output_Data_Set_RWA_VCU_RC_Signal2_CH0_0x051
extern uint32_t	GV_CH0_RWA_RackAngleFbk2;
extern uint32_t	GV_CH0_RWA_RackAngleSpeedFbk2;
extern uint32_t	GV_CH0_RWA_VCU_RC_counter2;
extern uint32_t	GV_CH0_RWA_VCU_RC_CRC2;

// Output_Data_Set_RWS_VCU_RC_Signal1_CH0_0x060
extern uint32_t	GV_CH0_RWS_RackAngleFbk1;
extern uint32_t	GV_CH0_RWS_RackAngleSpeedFbk1;
extern uint32_t	GV_CH0_RWS_VCU_RC_counter1;
extern uint32_t	GV_CH0_RWS_VCU_RC_CRC1;

// Output_Data_Set_RWS_VCU_RC_Signal2_CH0_0x061
extern uint32_t	GV_CH0_RWS_RackAngleFbk2;
extern uint32_t	GV_CH0_RWS_RackAngleSpeedFbk2;
extern uint32_t	GV_CH0_RWS_VCU_RC_counter2;
extern uint32_t	GV_CH0_RWS_VCU_RC_CRC2;

// Output_Data_Set_SW_VER_CH0_0x100
extern uint32_t	GV_YEAR;
extern uint32_t	GV_Month;
extern uint32_t	GV_Day;
extern uint32_t	GV_Ver;
extern uint32_t	GV_CAR_NUM;

// Output_Data_Set_VCU_BCM_Signal_1_CH0_0x151
extern uint32_t	GV_Lamp_BRAKE_CMD;
extern uint32_t	GV_Lamp_Hazard_CMD;
extern uint32_t	GV_Lamp_HBEAM_CMD;
extern uint32_t	GV_Lamp_Head_CMD;
extern uint32_t	GV_Lamp_LTRN_CMD;
extern uint32_t	GV_Lamp_Reverse_CMD;
extern uint32_t	GV_Lamp_RTRN_CMD;
extern uint32_t	GV_Lamp_Position_CMD;
extern uint32_t	GV_Lamp_DRL_CMD;
extern uint32_t	GV_Wiper_CMD;

// Output_Data_Set_VCU_BCM_Signal_2_CH0_0x180
extern uint8_t 	GV_HMI1_LAMP;
extern uint8_t 	GV_HMI2_LAMP;
extern uint8_t 	GV_HMI3_LAMP;
extern uint8_t 	GV_HMI4_LAMP;
extern uint8_t 	GV_HMI5_LAMP;

// Output_Data_Set_VCU_EPAM_CH0_0x220
extern uint32_t	GV_VCU_EPAM_Park_Request_to_EPC;
extern uint32_t	GV_VCU_EPAM_ErrClear_State;

// Output_Data_Set_VCU_MCU_Signals1_CH0_0x250
extern float 	GV_Motor_Torque_Cmd;
extern uint16_t GV_limit_Torq;
extern uint32_t GV_VCU_TorqueContol;
extern uint32_t GV_VCU_Ready;
extern uint32_t GV_VCU_ControlMode;
extern uint32_t GV_VCU_PwrEnable;
extern uint32_t GV_VCU_GearCmd;
extern uint32_t GV_VCU_MtrDir;
extern uint32_t GV_VCU_BmsFlt;
extern uint32_t GV_VCU_BmsHvSt;
extern uint32_t GV_VCU_PosTrqLimit;
extern float 	GV_VCU_NegTrqLimit;




/*------------------------------ CH1 ------------------------------*/
// Output_Data_Set_VCU_BCM_Signal_1_CH0_0x151
extern uint8_t	GV_CE_ON_CMD;
extern uint8_t	GV_HV_ON_CMD;
extern uint8_t	GV_LDC_ACT_CMD;
extern uint16_t	GV_LDC_TAGT_CMD;

// Output_Data_Set_VCU_ACU_Signal1_CH1_0x013
extern uint32_t	GV_VCU_ACU_MCU_EstTrq;
extern uint32_t	GV_VCU_ACU_RWA_Rack_Fbk;
extern uint32_t	GV_VCU_ACU_Brk_Pressure_Fbk;
extern uint32_t	GV_VCU_ACU_RC_BMS_SOC;
extern uint32_t	GV_VCU_ACU_long_Ctl_mode;
extern uint32_t	GV_VCU_ACU_GearPos;
extern uint32_t	GV_VCU_ACU_ParkBrake_Fbk;
extern uint32_t	GV_VCU_ACU_Emergency_Stop;
extern uint32_t	GV_VCU_ACU_ARC1;
extern uint32_t	GV_VCU_ACU_CRC1;

// Output_Data_Set_VCU_ACU_Signal2_CH1_0x014
extern uint32_t	GV_RWA_Flt;
extern uint32_t	GV_RWS_Flt;
extern uint32_t	GV_IDB_Flt;
extern uint32_t	GV_MCU_Flt;
extern uint32_t	GV_Drive_Mode;
extern uint32_t	GV_VCU_IGN_SIG;
extern uint32_t	GV_VCU_ACU_counter2;
extern uint32_t	GV_VCU_ACU_CRC2;

// Output_Data_Set_VCU_ACU_Signal3_CH1_0x015
extern uint32_t	GV_ACU_VCU_Vx_Fbk;
extern uint32_t	GV_ACU_VCU_Vx_Limit;
extern uint32_t	GV_ACU_VCU_Acc_Fbk;
extern uint32_t	GV_ACU_VCU_Acc_Limit;
extern uint32_t	GV_ACU_VCU_ACU_counter3;
extern uint32_t	GV_ACU_VCU_ACU_CRC3;

// Output_Data_Set_CH1_ACU_CAR_STAT_CH1_0x016
extern uint32_t	GV_ACU_CAR_ARC;
extern uint32_t	GV_ACU_CAR_CRC;

// Output_Data_Set_RWA_VCU_ACU_Signal1_CH1_0x050
extern uint32_t	GV_RWA_RackAngleFbk1;
extern uint32_t	GV_RWA_RackAngleSpeedFbk1;
extern uint32_t	GV_RWA_VCU_ACU_counter1;
extern uint32_t	GV_RWA_VCU_ACU_CRC1;

// Output_Data_Set_RWA_VCU_ACU_Signal2_CH1_0x051
extern uint32_t	GV_RWA_RackAngleFbk2;
extern uint32_t	GV_RWA_RackAngleSpeedFbk2;
extern uint32_t	GV_RWA_VCU_ACU_counter2;
extern uint32_t	GV_RWA_VCU_ACU_CRC2;

// Output_Data_Set_RWS_VCU_ACU_Signal1_CH1_0x060
extern uint32_t	GV_RWS_RackAngleFbk1;
extern uint32_t	GV_RWS_RackAngleSpeedFbk1;
extern uint32_t	GV_RWS_VCU_ACU_counter1;
extern uint32_t	GV_RWS_VCU_ACU_CRC1;

// Output_Data_Set_RWS_VCU_ACU_Signal2_CH1_0x061
extern uint32_t	GV_RWS_RackAngleFbk2;
extern uint32_t	GV_RWS_RackAngleSpeedFbk2;
extern uint32_t	GV_RWS_VCU_ACU_counter2;
extern uint32_t	GV_RWS_VCU_ACU_CRC2;

// RC_VCU_BCM_Signal_1_CH1_0x155
extern uint32_t	GV_RC_Lamp_BRAKE_CMD;
extern uint32_t	GV_RC_Lamp_Hazard_CMD;
extern uint32_t	GV_RC_Lamp_HBEAM_CMD;
extern uint32_t	GV_RC_Lamp_Head_CMD;
extern uint32_t	GV_RC_Lamp_LTRN_CMD;
extern uint32_t	GV_RC_Lamp_Reverse_CMD;
extern uint32_t	GV_RC_Lamp_RTRN_CMD;
extern uint32_t	GV_RC_Lamp_Position_CMD;
extern uint32_t	GV_RC_Lamp_DRL_CMD;
extern uint32_t	GV_RC_Wiper_CMD;

// Output_Data_Set_BCM_VCU_ACU_Signal1_CH1_0x570
extern uint32_t	GV_ACU_Lamp_RTRN;
extern uint32_t	GV_ACU_Lamp_Reverse;
extern uint32_t	GV_ACU_Lamp_LTRN;
extern uint32_t	GV_ACU_Lamp_Head;
extern uint32_t	GV_ACU_Lamp_HBEAM;
extern uint32_t	GV_ACU_Lamp_Hazard;
extern uint32_t	GV_ACU_Lamp_BRAKE;
extern uint32_t	GV_ACU_Status_Wiper;
extern uint32_t	GV_ACU_BCM_CE1_STA;
extern uint32_t	GV_ACU_BCM_CE2_STA;
extern uint32_t	GV_ACU_BCM_CE3_STA;
extern uint32_t	GV_ACU_BCM_CE4_STA;
extern uint32_t	GV_ACU_BCM_CE5_STA;
extern uint32_t	GV_ACU_BCM_MAINSW_STA;
extern float	GV_ACU_Battery_Voltage;
extern uint32_t	GV_ACU_Lamp_DRL;
extern uint32_t	GV_ACU_Lamp_Position;
extern uint32_t	GV_ACU_BCM_VCU_counter1;
extern uint32_t	GV_ACU_BCM_VCU_CRC1;
extern uint32_t	GV_ACU_BCM_Sys_Status;
extern uint32_t	GV_ACU_LDC_STA;

// Output_Data_Set_BCM_VCU_ACU_Signal5_CH1_0x585
extern uint32_t	GV_ACU_OBC_FltSta;
extern uint32_t	GV_ACU_BMS_FltSta;
extern uint32_t	GV_ACU_LDC_FltSta;
extern uint32_t	GV_ACU_BCM_FltSta;
extern uint32_t	GV_ACU_BMS_TEMP_FAULT;
extern uint32_t	GV_ACU_LDC_TEMP_FAULT;
extern uint32_t	GV_ACU_OBC_TEMP_FAULT;
extern uint32_t	GV_ACU_BCM_VCU_counter5;
extern uint32_t	GV_ACU_BCM_VCU_CRC5;

// Output_Data_Set_BCM_VCU_ACU_Signal3_CH1_0x590
extern uint8_t	GV_BCM_VCU_counter5;
extern uint8_t	GV_BCM_VCU_CRC5;

// Output_Data_Set_BCM_VCU_ACU_Signal4_CH1_0x595
extern uint8_t	GV_BCM_VCU_counter4;
extern uint8_t	GV_BCM_VCU_CRC4;

// Output_Data_Set_BCM_VCU_ACU_Signal3_CH1_0x590
extern uint8_t	GV_BCM_VCU_counter5;
extern uint8_t	GV_BCM_VCU_CRC5;

// Output_Data_Set_BCM_VCU_ACU_Signal4_CH1_0x595
extern uint8_t	GV_BCM_VCU_counter4;
extern uint8_t	GV_BCM_VCU_CRC4;

// Output_Data_Set_ICM_303h_CH1_0x303
extern uint16_t	GV_Speed_Combi;

// Output_Data_Set_CGW_372h_CH1_0x372
extern uint8_t	GV_WelcomeSoundCmd;
extern uint8_t	GV_GoodbyeSoundCmd;

// Output_Data_Set_VCU_3ACh_CH1_0x3AC
extern uint8_t	GV_Charging_Sts_IND;

// Output_Data_Set_CGW_588h_CH1_0x588
extern uint8_t	GV_VC_DOM;


/*------------------------------ CH2 ------------------------------*/
// Output_Data_Set_BSC_IDB_StartupCommand_CH2_0x032
extern uint32_t	GV_Arc;
extern uint32_t	GV_Crc;
extern uint32_t	GV_WakeUpCommand;

extern uint8_t	GV_IDB_032_Arc;
extern uint8_t	GV_IDB_032_Crc;
extern uint8_t	GV_IDB_032_WakeUpCommand;

// Output_Data_Set_BSC_RWA_RackCommand_CH2_0x040
extern uint32_t	GV_RWA_040_Arc;
extern uint32_t	GV_RWA_040_Crc;
extern float	GV_RWA_040_RackAngleCmd;
extern uint8_t	GV_RWA_040_RackAngleCmdValid;

// Output_Data_Set_BSC_IDB_BrakeCommand_CH2_0x064
extern uint32_t GV_BrakeHoldRequest;
extern float 	GV_IDB_BrakeTorqueCommand;
extern uint32_t GV_DriveTorqueCommand;
extern uint32_t GV_DriveTorqueCommandValid;
extern uint32_t GV_EscActivation;
extern uint32_t GV_GearPosition;
extern uint32_t GV_ParkBrakeRequest;
extern uint32_t GV_PowertrainMode;
extern uint32_t GV_RbcActivation;
extern uint32_t GV_Reserved1;
extern uint32_t GV_Reserved2;
extern uint32_t GV_RopActivation;
extern uint32_t GV_TcsActivation;
extern uint8_t 	GV_IDB_064_Crc;
extern uint8_t 	GV_IDB_064_Arc;

// Output_Data_Set_BSC_RegenCommand_CH2_0x06A
extern uint32_t	GV_BSC_06A_ActualMotorTorque;
extern uint32_t	GV_BSC_06A_ActualMotorTorqueValid;
extern uint32_t	GV_BSC_06A_Arc;
extern uint32_t	GV_BSC_06A_Crc;
extern uint32_t	GV_BSC_06A_MaxAvailableRegenTorque;
extern uint32_t	GV_BSC_06A_MaxAvailableRegenTorqueValid;
extern uint32_t	GV_BSC_06A_TractionMotorFault;

// Output_Data_Set_BSC_IMU_CH2_0x070
extern uint8_t	GV_IMU_070_Arc;
extern uint8_t	GV_IMU_070_Crc;
extern float	GV_IMU_070_LateralAcceleration;
extern uint8_t	GV_IMU_070_LateralAccelerationValid;
extern float	GV_IMU_070_LongitudinalAcceleration;
extern uint8_t	GV_IMU_070_LongitudinalAccelerationValid;
extern float	GV_IMU_070_VehicleSpeed;
extern uint8_t	GV_IMU_070_VehicleSpeedValid;
extern float	GV_IMU_070_VehicleYawRate;
extern uint8_t	GV_IMU_070_VehicleYawRateValid;

// Output_Data_Set_BSC_RWA_StartupCommand_CH2_0x310
extern uint8_t	GV_RWA_310_Arc;
extern uint8_t	GV_RWA_310_Crc;
extern uint8_t	GV_RWA_310_ModeCommand;
extern uint8_t	GV_RWA_310_WakeupCommand;

// Output_Data_Set_BSC_RWA_Sister_CH2_0x350
extern uint32_t	GV_RWA_350_Arc;
extern uint32_t	GV_RWA_350_Crc;
extern uint8_t	GV_RWA_350_EcuPowerMode;
extern uint8_t	GV_RWA_350_EcuRole;
extern uint8_t	GV_RWA_350_EcuStatus;

// Output_Data_Set_BSC_VehicleEnvironment_CH2_0x384
extern uint8_t	GV_Env_384_Arc;
extern uint8_t	GV_Env_384_Crc;
extern uint8_t	GV_Env_384_EnvironmentTemperature;
extern uint8_t	GV_Env_384_EnvironmentTemperatureValid;
extern uint8_t	GV_Env_384_TimestampDay;
extern uint8_t	GV_Env_384_TimestampHour;
extern uint8_t	GV_Env_384_TimestampMinute;
extern uint8_t	GV_Env_384_TimestampMonth;
extern uint8_t	GV_Env_384_TimestampSecond;
extern uint8_t	GV_Env_384_TimestampYear;

/*------------------------------ CH3 ------------------------------*/
// Output_Data_Set_BSC_RCU_StartupCommand_CH3_0x033
extern uint8_t	GV_RCU_033_Arc;
extern uint8_t	GV_RCU_033_Crc;
extern uint8_t	GV_RCU_033_WakeUpCommand;

// Output_Data_Set_BSC_RWA_RackCommand_CH3_0x040
extern uint32_t	GV_RWA2_040_Arc;
extern uint32_t	GV_RWA2_040_Crc;
extern float	GV_RWA2_040_RackAngleCmd;
extern uint8_t	GV_RWA2_040_RackAngleCmdValid;

// Output_Data_Set_BSC_RCU_BrakeCommand_CH3_0x065
extern uint8_t 	GV_RCU_065_Crc;
extern uint8_t 	GV_RCU_065_Arc;
extern uint32_t GV_RCU_BrakeHoldRequest;
extern float 	GV_RCU_BrakeTorqueCommand;
extern uint32_t GV_RCU_EscActivation;
extern uint32_t GV_RCU_GearPosition;
extern uint32_t GV_RCU_ParkBrakeRequest;
extern uint32_t GV_RCU_PowertrainMode;
extern uint32_t GV_RCU_Reserved1;
extern uint32_t GV_RCU_Reserved2;

// Output_Data_Set_BSC_IMU_CH3_0x071
extern uint8_t	GV_IMU_071_Arc;
extern uint8_t	GV_IMU_071_Crc;
extern float	GV_IMU_071_LateralAcceleration;
extern uint8_t	GV_IMU_071_LateralAccelerationValid;
extern float	GV_IMU_071_LongitudinalAcceleration;
extern uint8_t	GV_IMU_071_LongitudinalAccelerationValid;
extern float	GV_IMU_071_VehicleSpeed;
extern uint8_t	GV_IMU_071_VehicleSpeedValid;
extern float	GV_IMU_071_VehicleYawRate;
extern uint8_t	GV_IMU_071_VehicleYawRateValid;

// Output_Data_Set_BSC_RWA_StartupCommand_CH3_0x310
extern uint8_t	GV_RWA2_310_Arc;
extern uint8_t	GV_RWA2_310_Crc;
extern uint8_t	GV_RWA2_310_ModeCommand;
extern uint8_t	GV_RWA2_310_WakeupCommand;


// Output_Data_Set_BSC_RWA_Sister_CH3_0x350
extern uint32_t	GV_RWA2_350_Arc;
extern uint32_t	GV_RWA2_350_Crc;
extern uint8_t	GV_RWA2_350_EcuPowerMode;
extern uint8_t	GV_RWA2_350_EcuRole;
extern uint8_t	GV_RWA2_350_EcuStatus;


// Output_Data_Set_BSC_VehicleEnvironment_CH3_0x385
extern uint8_t	GV_Env_385_Arc;
extern uint8_t	GV_Env_385_Crc;
extern uint8_t	GV_Env_385_EnvironmentTemperature;
extern uint8_t	GV_Env_385_EnvironmentTemperatureValid;
extern uint8_t	GV_Env_385_TimestampDay;
extern uint8_t	GV_Env_385_TimestampHour;
extern uint8_t	GV_Env_385_TimestampMinute;
extern uint8_t	GV_Env_385_TimestampMonth;
extern uint8_t	GV_Env_385_TimestampSecond;
extern uint8_t	GV_Env_385_TimestampYear;


/*------------------------------ CH4 ------------------------------*/
// Output_Data_Set_VCU_RWS_Rack_Cmd_CH4_0x040
extern uint32_t	GV_RWS1_040_Arc;
extern uint32_t	GV_RWS1_040_Crc;
extern float	GV_RWS1_040_RackAngleCmd;
extern uint8_t	GV_RWS1_040_RackAngleCmdValid;


// Output_Data_Set_VCU_RWS_StartupCommand_CH4_0x310
extern uint8_t	GV_RWS1_310_Arc;
extern uint8_t	GV_RWS1_310_Crc;
extern uint8_t	GV_RWS1_310_ModeCommand;
extern uint8_t	GV_RWS1_310_WakeupCommand;


// Output_Data_Set_VCU_RWA_Sister_CH4_0x350
extern uint8_t	GV_RWS1_350_Arc;
extern uint8_t	GV_RWS1_350_Crc;
extern uint8_t	GV_RWS1_350_EcuPowerMode;
extern uint8_t	GV_RWS1_350_EcuRole;
extern uint8_t	GV_RWS1_350_EcuStatus;




/*------------------------------ CH5 ------------------------------*/
// Output_Data_Set_VCU_RWS_Rack_Cmd_CH5_0x040
extern uint32_t	GV_RWS2_040_Arc;
extern uint32_t	GV_RWS2_040_Crc;
extern float	GV_RWS2_040_RackAngleCmd;
extern uint8_t	GV_RWS2_040_RackAngleCmdValid;


// Output_Data_Set_VCU_RWS_StartupCommand_CH5_0x310
extern uint8_t	GV_RWS2_310_Arc;
extern uint8_t	GV_RWS2_310_Crc;
extern uint8_t	GV_RWS2_310_ModeCommand;
extern uint8_t	GV_RWS2_310_WakeupCommand;


// Output_Data_Set_VCU_RWS_Sister_CH5_0x350
extern uint32_t	GV_RWS2_350_Arc;
extern uint32_t	GV_RWS2_350_Crc;
extern uint8_t	GV_RWS2_350_EcuPowerMode;
extern uint8_t	GV_RWS2_350_EcuRole;
extern uint8_t	GV_RWS2_350_EcuStatus;




/*======================================== Etc. ========================================*/
extern uint8_t		GV_Key_Off_Level;
extern uint8_t 	GV_All_ECU_Ready_Flag;	// 시동 시퀀스 중 사용되는 변수
extern uint8_t 	GV_ALL_ECU_Off_Flag;	// 시동 시퀀스 중 사용되는 변수

extern uint8_t 	GV_Charging_Mode; // 충전상태 확인 변수

extern uint8_t 	GV_EPAM_CMD; // epam 명령 변수
extern uint8_t 	GV_EPAM_STA; // epam 확인 변수 // epam은 없음 흔적임

extern uint8_t 	GV_BCM_Init_Status; //Input_Data_Set_BCM_VCU_Signal1_CH0_0x570
extern uint8_t 	GV_BMS_Init_Status;
extern uint8_t 	GV_MCU_Init_Status;
extern uint8_t 	GV_Steer_Init_Status;
extern uint8_t 	GV_Brake_Init_Status;
extern uint8_t 	GV_ACU_Init_Status;

extern uint8_t 	GV_Gear_Position;

// Input_Data_Set_BCM_VCU_Signal1_CH0_0x570 , Output_Data_Set_BCM_VCU_ACU_Signal1_CH1_0x570
extern uint8_t 	GV_VCU_Ignition;	// Ignition
extern uint8_t 	GV_IG_Process_Status;

extern uint8_t 	GV_BMS_Fault_Check;
extern uint8_t 	GV_OBC_Fault_Check;
extern uint8_t 	GV_LDC_Fault_Check;
extern uint8_t 	GV_MCU_Fault_Check;
extern uint8_t 	GV_HV_Apply_Check;	// HV ON Status
extern uint8_t	GV_LDC_Apply_Check;
extern uint16_t Timer_t;

extern uint8_t 	GV_Emergency_Stop_SW;

// Input_Data_Set_ACU_BCM_Signal_1_CH1_0x151, Output_Data_Set_VCU_BCM_Signal_1_CH0_0x151

extern uint8_t 	GV_PWM_CH1;
extern uint8_t 	GV_PWM_CH2;
extern uint16_t GV_DIN_CH1;
extern uint16_t GV_DIN_CH2;
extern uint16_t CE_COMMAND; //CAN ON OFF

//----BMS
extern uint8_t 	GV_SOC_STAT_Flag;
extern float 	GV_SOC_Value;

extern uint16_t GV_init_M_Torq;
extern uint16_t GV_MCU_CNT_NOW;
extern uint16_t GV_MCU_CNT_PAST;
extern uint16_t GV_No_signal_CH0_0x300_CNT;
extern uint16_t GV_No_signal_CH0_0x301_CNT;
extern uint16_t GV_CH0_0x300_CNT;
extern uint16_t GV_CH0_0x301_CNT;
extern uint16_t GV_Any_Signal_MCU;
extern float 	GV_SoC_Torq_Limit;

// BCM
extern uint8_t 	GV_LAMP_ON_OFF_Flag;
extern uint8_t 	GV_WIPER_CMD;
extern uint8_t 	GV_Any_Signal_BCM;
extern uint8_t 	GV_No_signal_CH0_0x570;
extern uint8_t 	GV_No_signal_CH0_0x580;
extern uint8_t 	GV_No_signal_CH0_0x590;
extern uint8_t 	GV_No_signal_CH0_0x595;
extern uint8_t 	GV_No_signal_CH0_0x585;
extern uint8_t 	GV_BCM_CNT_PAST;
extern uint8_t 	GV_BCM_CNT_NOW;
extern uint8_t 	GV_CH0_0x570_CNT;
extern uint8_t 	GV_CH0_0x580_CNT;
extern uint8_t 	GV_CH0_0x590_CNT;
extern uint8_t 	GV_CH0_0x595_CNT;
extern uint8_t 	GV_CH0_0x585_CNT;
extern uint8_t 	GV_can_rx_ldc_v;
extern float 	GV_SoC_Torq_Gain;

// Charging_Status
extern uint8_t 	GV_Charging_Status_val;
extern uint8_t 	GV_Charging_Status_M_Torq;
extern uint8_t 	GV_Charging_Status_Steer_Angle;
extern uint16_t GV_Charging_Status_Breack_CMD;

// RWA, RWS
extern uint16_t GV_RWA_RackAngleCmd;
extern uint16_t GV_RWS_RackAngleCmd;

// dirve_mode
extern uint8_t 	GV_dirve_mode;

// Emergency
extern uint8_t 	Emergency_stop_flag;

// CNT for logic
extern uint16_t CNT_GV_HV_ON_CMD;
extern uint8_t 	CNT_LAMP_CMD;
extern uint8_t 	GV_CNT_LAMP_FLAG;

//T32  ӽ  RWA
extern float 	GV_T32_RC_RWA_RackAngleCommand;
extern float 	GV_T32_RWA_RackAngleCommand;

//T32  ӽ  RWS
extern float 	GV_RC_RWS_RackAngleCommand;
extern float 	GV_T32_RWS_RackAngleCommand;

//MCU
extern uint16_t Emergency_Switch;
extern float 	GV_T32_BrakeTorqueCommand;

// HMI
extern uint32_t GV_Lamp_HMI1_CMD;
extern uint32_t GV_Lamp_HMI2_CMD;
extern uint32_t GV_Lamp_HMI3_CMD;
extern uint32_t GV_Lamp_HMI4_CMD;
extern uint32_t GV_Lamp_HMI5_CMD;

// PWM  汤    ۵
extern uint8_t 	GV_PWM_1;
extern uint8_t 	GV_PWM_2;

//       ޱ۽  ǵ
extern float	Cur_RWA_RACK_ANGLE;
extern float    Cur_RWS_RACK_ANGLE;
extern float  	Cur_CLMAP_FORCE;
extern float  	GV_MASTER_CLMAP_FORCE;
extern float  	GV_MASTER_RWA_RackAngleCommand;
extern float  	GV_MASTER_RWS_RackAngleCommand;

// CAN_CHECK
extern uint32_t GV_CAR_RX_Arc;
extern uint8_t 	GV_CAN_ERR_TOGGLE;

// STEERING_RATE
extern uint32_t GV_Tunning_Slewrate;

//Break_Rate
extern uint32_t GV_Break_Slewrate;

extern float 	GV_VCU_Dynamics_TrqCmd;

// Hill_GOIC_VAL
extern float 	GV_Hiil_BrakeTorqueCommand;
extern float 	GV_VCU_Hill_TrqCmd;
extern uint8_t 	GV_CAN_ALV_FAULT_FALG;

// RWA Limit
extern float GV_RWA_Limit;

// FAULT INJECTION
extern uint8_t	GV_Act_Fault_Exist;
extern float	GV_Target_MCU_Out;
extern float	GV_Target_IDB_Out;
extern float	GV_Target_RWA_Out;

// ECU Fault check
extern uint16_t	GV_ACU_ECU_Arc_ErrCnt;
extern uint16_t	GV_ACU_ECU_Arc_ErrCnt1;
extern uint16_t	GV_ACU_ECU_Arc_ErrCnt2;
extern uint16_t	GV_ACU_ECU_Arc_ErrCnt3;
extern uint16_t	GV_IDB_ECU_Arc_ErrCnt;
extern uint16_t	GV_RCU_ECU_Arc_ErrCnt;
extern uint16_t	GV_RWA1_ECU_Arc_ErrCnt;
extern uint16_t	GV_RWA2_ECU_Arc_ErrCnt;
extern uint8_t	GV_prev_ACU_ECU_Arc;
extern uint8_t	GV_prev_ACU_ECU_Arc1;
extern uint8_t	GV_prev_ACU_ECU_Arc2;
extern uint8_t	GV_prev_ACU_ECU_Arc3;
extern uint8_t	GV_prev_IDB_ECU_Arc;
extern uint8_t	GV_prev_RCU_ECU_Arc;
extern uint8_t	GV_prev_RWA1_ECU_Arc;
extern uint8_t	GV_prev_RWA2_ECU_Arc;
extern uint8_t	GV_ACU_ECU_Fault_Flag;
extern uint8_t	GV_ACU_ECU_Fault_Flag1;
extern uint8_t	GV_ACU_ECU_Fault_Flag2;
extern uint8_t	GV_ACU_ECU_Fault_Flag3;
extern uint8_t	GV_ACU_ECU_Fault_Flag_Master;
#endif /* GLOBAL_VARIABLE_H_ */

