2023-08-21 16:48:00 +08:00

109 lines
3.2 KiB
C

/*@处根据实际情况填写相关信息,将@字符以及这条提示语句去掉*/
/******************************************************************************
| File Name : @文件名
| Description: @文件描述
******************************************************************************/
#ifndef CANTP_H
#define CANTP_H
/******************************************************************************
* Description: : Include File Section
******************************************************************************/
#include "CanSm.h"
#include "CanTp_Cfg.h"
/******************************************************************************
* Description: : Macro Description Section
******************************************************************************/
/******************************************************************************
* Description: : Structure Type Declaration Section
******************************************************************************/
typedef enum
{
CeCanTp_e_Empty = 0,
CeCanTp_e_Full = 1,
}TeCanTp_e_RxBufferSts;
typedef enum
{
CeCanTp_e_Physical=0,
CeCanTp_e_Functional,
}TeCanTp_e_AddrMethod;
typedef enum
{
CeCanTp_e_Idel = 0,
CeCanTp_e_SF_Get,
CeCanTp_e_MF_FFGet,
CeCanTp_e_MF_CFTakein,
CeCanTp_e_MF_Get,
CeCanTp_e_Answer,
}TeCanTp_e_TpSts;
typedef enum
{
CeCanTp_e_CntnsIdel = 0,
CeCanTp_e_CntnsSF_Get,
}TeCanTp_e_CntnsTpSts;
typedef enum
{
CeCanTp_e_TX_Idel = 0,
CeCanTp_e_TX_FCWaiting,
CeCanTp_e_TX_FCGet,
CeCanTp_e_TX_CFGaving,
}TeCanTp_e_MFTxSts;
typedef enum
{
CeCanTp_e_As = 0,
CeCanTp_e_Bs,
CeCanTp_e_Cs,
CeCanTp_e_Ar,
CeCanTp_e_Br,
CeCanTp_e_Cr,
}TeCanTp_e_MFTimerSwitch;
typedef enum
{
CeCanTp_e_Tx_Idle = 0,
CeCanTp_e_Tx_Busy,
}TeCanTp_e_TxSts;
typedef enum
{
CeCanTp_e_Tx_Succeed = 0,
CeCanTp_e_Tx_Wrong,
}TeCanTp_e_TxResult;
typedef enum
{
CeCanTp_e_S3_Start = 0,
CeCanTp_e_S3_Stop,
}TeCanTp_e_S3TimerSts;
/******************************************************************************
* Description: : Global Variable Declaration Section
******************************************************************************/
/******************************************************************************
* Description: : Global Function Prototype Declaration
******************************************************************************/
extern uint8 GetCanTp_u_S3Sts(void);/*读取S3*/
extern void MngCanTp_MainFunction(void);/*主调度函数*/
extern void InitCanTp_Parameter(void);/*初始化*/
extern TeCanTp_e_TxResult SetCanTp_TxBuffer(uint16 LeCanTp_p_DL, const uint8 LeCanTp_p_DataAddr[]);/*发送函数*/
extern TeCanTp_e_TxResult SetCanTp_Tx_78Neg(uint16 LeCanTp_p_DL , const uint8 LeCanTp_p_DataAddr[]);
extern void RxIndicationCanTP_AddrFunc_Message(CanIf_HwHandleType LeCanTp_e_Hrh, CanIf_CanIdType LeCanTp_e_CanId,CanIf_CanDlcType LeCanTp_e_CanDlc, const CanIf_CanDataType LeCanTp_e_CanSduPtr[]);/*接收函数*/
extern void RxIndicationCanTP_AddrPhy_Message(CanIf_HwHandleType LeCanTp_e_Hrh, CanIf_CanIdType LeCanTp_e_CanId,CanIf_CanDlcType LeCanTp_e_CanDlc,const CanIf_CanDataType LeCanTp_e_CanSduPtr[]);/*接收函数*/
extern TeCanTp_e_RxBufferSts GetCanTp_e_RxBufferSts(uint8* LeCanTp_p_AddrMethod , uint16* LeCanTp_p_DL , uint8** LeCanTp_p_DataAddr);/*上层读取接收到得报文*/
#endif