#ifndef __HAL_CAN_H__
#define __HAL_CAN_H__

#include "hc32_ll_mcan.h"
#include "hc32_ll_fcg.h"
#include "hc32_ll_clk.h"
#include "hc32_ll_interrupts.h"
#include "hc32_ll_gpio.h"

#include "string.h"
#include "FreeRTOS.h"
#include "queue.h"

#define	MSG_RECEIVE_ID_UDS		 0x1C00EDEA
#define	MSG_SEND_ID_UDS			   0x1C00EAED

#define	MSG_RECEIVE_ID_EXTD		 0X18DA5541 
#define	MSG_SEND_ID_EXTD			 0X18DA4155

#define	MSG_RECEIVE_ID_STD		 0X7B0
#define	MSG_SEND_ID_STD				 0X7B8

#define VER_MAJOR_H 	0X01
#define VER_MAJOR_L 	0X00

#define VER_SLAVE_H 	0X01
#define VER_SLAVE_L		0X00 
 


typedef struct
{
	uint8_t  ide;
	uint8_t  len;
	uint32_t id;
	uint8_t  data[8];
}hc32_can_rx_msg_t;


 
void bsp_can1_init(void);
void bsp_can2_init(void);
extern QueueHandle_t can1_recieve_data_queue;
extern QueueHandle_t can2_recieve_data_queue;	
 																		 
extern QueueHandle_t can1_send_data_queue;
extern QueueHandle_t can2_send_data_queue;		


int32_t can_send_msg(CM_MCAN_TypeDef *MCANx,stc_mcan_tx_msg_t *pTxMsg);
#endif