63 lines
933 B
C
63 lines
933 B
C
|
#ifndef __BSP_CAN_H
|
|||
|
#define __BSP_CAN_H
|
|||
|
#include "sys.h"
|
|||
|
|
|||
|
#include "stm32f10x.h"
|
|||
|
#include "stm32f10x_can.h"
|
|||
|
|
|||
|
|
|||
|
//CAN<41><4E><EFBFBD><EFBFBD>RX0<58>ж<EFBFBD>ʹ<EFBFBD><CAB9>
|
|||
|
#define CAN_RX0_INT_ENABLE 1 //0,<2C><>ʹ<EFBFBD><CAB9>;1,ʹ<><CAB9>.
|
|||
|
|
|||
|
u8 CAN_Mode_Init(void);//CAN<41><4E>ʼ<EFBFBD><CABC>
|
|||
|
|
|||
|
u8 Can_Send_Msg(u8* msg,u8 len); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
u8 Can_Receive_Msg(u8 *buf); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
#define CAN_RX2_INT_ENABLE 1 //0,<2C><>ʹ<EFBFBD><CAB9>;1,ʹ<><CAB9>.
|
|||
|
|
|||
|
u8 CAN2_Mode_Init(void);//CAN<41><4E>ʼ<EFBFBD><CABC>
|
|||
|
|
|||
|
u8 Can2_Send_Msg(u8* msg,u8 len); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
u8 Can2_Send_Message( CanTxMsg msg);
|
|||
|
u8 Can2_Receive_Msg(u8 *buf); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @brief: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>bus off<EFBFBD><EFBFBD>recovery<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* @param : void
|
|||
|
*
|
|||
|
* @return: void
|
|||
|
*
|
|||
|
* @remark: <EFBFBD>Զ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD><EFBFBD>ɷ<EFBFBD><EFBFBD>ڶ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD>䱻ִ<EFBFBD>еļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD>10ms<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
void can_bus_off_recovery(void);
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* @brief: <EFBFBD><EFBFBD>ӡ can <EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|||
|
*/
|
|||
|
void can_bus_off_status_printf(void);
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|