Can_User.h 1.2 KB
Newer Older
1 2 3 4
#ifndef _CAN_USER_H_
#define _CAN_USER_H_
#include "RTE.h"
#include "Components.h"
5 6 7 8 9





10 11 12 13 14 15 16 17 18 19
/******************************************************************************
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
******************************************************************************/
20

21 22
#define   RSCAN0_BUS_OFF_LV1_RECOVERY_TIME  90U             
#define   RSCAN0_BUS_OFF_LV2_RECOVERY_TIME  1000U      
23

24 25 26 27 28 29 30
typedef struct
{
    uint8_t  Status;
    uint8_t  Timer;
    uint8_t  Cnt;
    uint8_t  ReportDTCCnt;
} RSCAN0BusoffMonitorStruct;
31 32 33



34 35 36 37 38 39 40 41 42
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);
43

44
#endif