Can_User.h 1.22 KB
Newer Older
李俭双's avatar
李俭双 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#ifndef _CAN_USER_H_
#define _CAN_USER_H_
#include "RTE.h"
#include "Application.h"
#include "Components.h"





/******************************************************************************
Bus-off
******************************************************************************/
#define   RSCAN0_BUS_STABLE                 0x00U
#define   RSCAN0_BUS_OFF_LV1                0x01U
#define   RSCAN0_BUS_OFF_LV2                0x02U
#define   RSCAN00_BUS_LIMP                   0x03U
/******************************************************************************
Bus-off
******************************************************************************/

#define   RSCAN0_BUS_OFF_LV1_RECOVERY_TIME  90U             
#define   RSCAN0_BUS_OFF_LV2_RECOVERY_TIME  1000U      

typedef struct
{
    uint8_t  Status;
    uint8_t  Timer;
    uint8_t  Cnt;
30
    uint8_t   RecoverTimer;
李俭双's avatar
李俭双 committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
} RSCAN0BusoffMonitorStruct;



extern void Can_Tx_Apply_Buff(void);
extern void Can_RX_Apply_Buff(void);
extern void Can_BusOff_Recover(uint8_t deltaTime);
extern void COM_CAN_Init(void);
extern void Can_Init(void);
extern void Can_Rx_Cak(CanTxRxMsg *Msg);
extern void Busoff(void);
extern uint8_t COM_APP_Process(st_CAN_Msg *Msg);
extern void Can_Write(st_CAN_Msg *Msg);

#endif