第一次提交
This commit is contained in:
57
ETH/UdpServer/User/interface_can.h
Normal file
57
ETH/UdpServer/User/interface_can.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* can_drive.h
|
||||
*
|
||||
* Created on: 2023<32><33>1<EFBFBD><31>5<EFBFBD><35>
|
||||
* Author: Administrator
|
||||
*/
|
||||
|
||||
#ifndef USER_INTERFACE_CAN_H_
|
||||
#define USER_INTERFACE_CAN_H_
|
||||
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
/* CAN Mode Definition */
|
||||
#define TX_MODE 0
|
||||
#define RX_MODE 1
|
||||
|
||||
/* Frame Format Definition */
|
||||
#define Standard_Frame 0
|
||||
#define Extended_Frame 1
|
||||
|
||||
/* CAN Communication Mode Selection */
|
||||
//#define CAN_MODE TX_MODE
|
||||
#define CAN_MODE RX_MODE
|
||||
|
||||
/* Frame Formate Selection */
|
||||
//#define Frame_Format Extended_Frame
|
||||
#define Frame_Format Extended_Frame
|
||||
|
||||
#define Frame_Format Extended_Frame
|
||||
|
||||
|
||||
#define DF_CanIDbattery 0x18904001//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>
|
||||
#define DF_CanIDbattery1 0x100//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>
|
||||
#define DF_CanIDbattery2 0x101//<2F><><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>
|
||||
#define DF_CanIDRCH_3 0x12000023//<2F><><EFBFBD><EFBFBD>ң<EFBFBD><D2A3><EFBFBD><EFBFBD>
|
||||
|
||||
#define DF_CanIDMotor1 0x101//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define DF_CanIDMotor2 0x102//<2F>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#define DF_ExtIDShift 3//<2F><>չ֡<D5B9><D6A1>λ 32-29
|
||||
#define DF_StaIDShift 21//<2F><>֡<D7BC><D6A1>λ 32-11
|
||||
|
||||
//<2F>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
//<2F>ⲿ<EFBFBD><E2B2BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void CAN1_Mode_Init( u8 tsjw, u8 tbs2, u8 tbs1, u16 brp, u8 mode );
|
||||
void CAN2_Mode_Init( u8 tsjw, u8 tbs2, u8 tbs1, u16 brp, u8 mode );
|
||||
u8 CAN_Send_Msg( CAN_TypeDef *CANx, u32 ID, u8 ide, u8 rtr, u8 *msg, u8 len);
|
||||
u8 CAN_Receive_Msg(CAN_TypeDef *CANx, uint8_t FIFONumber, u8 *buf );
|
||||
void USB_LP_CAN1_RX0_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
void CAN2_RX1_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
#endif /* USER_INTERFACE_CAN_H_ */
|
||||
Reference in New Issue
Block a user