#ifndef CAN_DRV_H
#define CAN_DRV_H

/******************************************************************************
Macro definitions
******************************************************************************/
#define R_CAN_GRAMINIT_ON  (0x8UL)
#define R_CAN_GSLPSTS_ON   (0x4UL)
#define R_CAN_GRSTSTS_ON   (0x1UL)
#define R_CAN_CSLPSTS_ON   (0x4UL)
#define R_CAN_CHLTSTS_ON   (0x2UL)
#define R_CAN_CRSTSTS_ON   (0x1UL)
#define R_CAN_TMTRM_ON     (0x8U)
#define R_CAN_TMTR_ON      (0x1U)
#define R_CAN_AFLDAE_ON    (0x100UL)
#define R_CAN_GSLPR_MASK   (0x4UL)
#define R_CAN_GMDC_MASK    (0x3UL)
#define R_CAN_CSLPR_MASK   (0x4UL)
#define R_CAN_CHMDC_MASK   (0x3UL)

/******************************************************************************
Exported global variables and functions (to be accessed by other files)
******************************************************************************/
//void    R_CAN_Init( void );
//bool    R_CAN_Send_TxBuf0(uint32_t can_id, uint8_t dlc, uint8_t msg[8]);
//bool    R_CAN_Receive_RxBuf0(uint32_t * p_can_id, uint8_t * p_dlc, uint8_t msg[8]);

/***************************************************/
/***	    Compressor CAN0 signals  			****/
/*****         RX                              *****/


/*****         TX                              *****/



/***************************************************/
/***	    MAIN CAN signals  			****/
/*****         TX                              *****/




/*****         RX                              *****/
typedef struct
{		
	unsigned int RcvId:11;
	unsigned int RcvDLC:4;
	
	unsigned int VCU_AC_EnableCommand:1;
}VCU_DisplayInfo_t;

typedef struct
{	
	unsigned int RcvId:11;
	unsigned int RcvDLC:4;
	
	unsigned int HMI_AcKeyState:3;
	unsigned int HMI_BlowerLevelKey:2;
	unsigned int HMI_IntakeAirKey:1;
}HMI_ControlCommand_t;

typedef struct
{	
	unsigned int RcvId:11;
	unsigned int RcvDLC:4;
	
	unsigned char Data[8];
}TEST_AC_DiagReq_t;

typedef struct
{
	unsigned int RcvId:11;
	unsigned int RcvDLC:4;
	
	unsigned char Data[8];
}TEST_Func_DiagReq_t;


typedef struct {
	unsigned int lword[4];
}can_cre_type;

#define CAN_RX_RULE_NUM 5
#define CAN_PAGE_RX_RULE_IDX_MASK           0xfU
#define CAN_RX_RULE_PAGE_IDX_BIT_POS        4U
/***************************************************/
/**********************CAN FRAME********************/
typedef struct
{
	unsigned int ID;
	unsigned int * addr;
}Can_Frame_Format;



#define COMP_Information_ID		0x300
#define AC_CurrentStatus_ID		0x32B
#define AC_COMP_Information_ID	0x35B



#define VCU_DisplayInfo_ID		0x310
#define HMI_ControlCommand_ID	0x348
#define TEST_AC_DiagReq_ID		0x787//0x7C6
#define TEST_Func_DiagReq_ID	0x7DF




extern volatile VCU_DisplayInfo_t		VCU_DisplayInfo		;
extern volatile HMI_ControlCommand_t	HMI_ControlCommand	;
extern volatile TEST_AC_DiagReq_t		TEST_AC_DiagReq		;
extern volatile TEST_Func_DiagReq_t	TEST_Func_DiagReq	;
extern const Can_Frame_Format CanBufDsc[];

#endif
