This commit is contained in:
MobKBK
2026-06-20 21:22:34 +08:00
commit 460e0e9e73
320 changed files with 135203 additions and 0 deletions

40
HARDWARE/can.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef __CAN_H
#define __CAN_H
#include "sys.h"
#include "system.h"
//CAN1 receives RX0 interrupt enablement
//CAN1接收RX0中断使能
#define CAN1_RX0_INT_ENABLE 1 //0, not enabling;1, can make //0,不使能; 1,使能
u8 CAN1_Mode_Init(u8 tsjw,u8 tbs2,u8 tbs1,u16 brp,u8 mode);
u8 CAN1_Tx_Msg(u32 id,u8 ide,u8 rtr,u8 len,u8 *dat);
u8 CAN1_Msg_Pend(u8 fifox);
void CAN1_Rx_Msg(u8 fifox,u32 *id,u8 *ide,u8 *rtr,u8 *len,u8 *dat);
u8 CAN1_Tx_Staus(u8 mbox);
u8 CAN1_Send_Msg(u8* msg,u8 len);
u8 CAN1_Receive_Msg(u8 *buf);
u8 CAN1_Send_MsgTEST(u8* msg,u8 len);
u8 CAN1_Send_Num(u32 id,u8* msg);
void can_data_transition(void);
#endif