45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
typedef union can_ide
|
|
{
|
|
unsigned int D32;
|
|
unsigned char D8[4];
|
|
struct{
|
|
unsigned int Cmd :8;
|
|
unsigned int dAddr :7;
|
|
unsigned int sAddr :7;
|
|
unsigned int dLvl :3;
|
|
unsigned int sLvl :2;
|
|
unsigned int Pri :2;
|
|
unsigned int Dump :3;
|
|
}BitF;
|
|
}can_ide_struct;
|
|
|
|
typedef struct can_def
|
|
{
|
|
unsigned int rx_cmd;
|
|
unsigned char rx_buf[8];
|
|
unsigned int rx_len;
|
|
unsigned int rx_complete;
|
|
|
|
unsigned int tx_cmd;
|
|
unsigned char tx_buf[8];
|
|
unsigned int tx_len;
|
|
unsigned int tx_complete;
|
|
unsigned int tx_complete_delay_flag;
|
|
unsigned int tx_complete_delay_tick;
|
|
unsigned int tx_err;
|
|
unsigned int tx_msg_falg;
|
|
unsigned int tx_tick;
|
|
unsigned int tx_timer_count;
|
|
}can_info_struct;
|
|
|
|
extern can_info_struct can_handle;
|
|
|
|
extern void can_prm_init(void);
|
|
extern void can_send_time_handle(void);
|
|
extern void can_task(void);
|
|
|
|
extern unsigned int internal_can_send_data(unsigned int head, unsigned char * pdata, unsigned int len);
|
|
extern unsigned int get_can_tx_complete(void);
|
|
extern unsigned int get_can_tx_complete_delay_flag(void);
|
|
extern void can_tx_complete_delay(void);
|