AUTOSAR_SWS_TTCANInterface 中文翻译

文档编号:433 | 状态:Final | 发布于:AUTOSAR CP Release 4.4.0
所属标准:AUTOSAR Classic Platform | 文档责任方:AUTOSAR

本翻译覆盖原文档 1-60 页正文。原文为软件规范(SWS),定义 TTCAN Interface 模块的 API、配置、错误处理。


1 引言与范围

TTCAN Interface(CanIf TTCAN 扩展)提供 TTCAN 协议栈的 ECU 抽象层。管理基本周期(Basic Cycle)+ 矩阵周期(Matrix Cycle)调度、时间窗口属性、PDU 路由。

2 缩略语

TTCAN / Basic Cycle / Matrix Cycle / Time Window / Exclusive / Arbitrating / Merged / TBTT / Level 0/1/2 / StbM

3 相关文档

[1] AUTOSAR SWS CAN Interface
[2] AUTOSAR SWS TTCAN Driver
[3] AUTOSAR SRS TTCAN
[4] ISO 11898-4

4 约束与假设

TTCAN Interface 应:

5 依赖其他模块

TTCAN Interface 依赖:TTCAN Driver / CanIf / PduR / StbM / ComM / BswM / Dem。

6 功能规格

6.1 架构

TTCAN Interface 扩展 CanIf,添加 TTCAN 特定功能。位于 TTCAN Driver 之上,PduR 之下。

6.2 矩阵周期

TTCAN Interface 管理 Matrix Cycle(包含多个 Basic Cycle)的调度。

7 API 服务

7.1 初始化 / 关闭

void CanIf_Init(const CanIf_ConfigType* ConfigPtr):初始化 TTCAN Interface(沿用 CanIf 命名)。
void CanIf_DeInit(void):去初始化。

7.2 控制器模式

Std_ReturnType CanIf_SetControllerMode(uint8 Controller, CanIf_ControllerModeType ControllerMode):设置控制器模式(UNINIT / STARTED / STOPPED / SLEEP)。
Std_ReturnType CanIf_GetControllerMode(uint8 Controller, CanIf_ControllerModeType* ControllerModePtr):获取模式。

7.3 发送

Std_ReturnType CanIf_Transmit(PduIdType TxPduId, const PduInfoType* PduInfoPtr):发送 PDU。

7.4 接收回调

void CanIf_RxIndication(const Can_HwType* Hw, const PduIdType PduId, const PduInfoType* PduInfoPtr):接收指示。
void CanIf_TxConfirmation(PduIdType CanTxPduId, Std_ReturnType Result):发送确认。

7.5 TTCAN 特定

Std_ReturnType CanIf_SetTrcvMode(uint8 Transceiver, CanTrcv_TrcvModeType TransceiverMode):设置收发器模式。
Std_ReturnType CanIf_GetTrcvMode(uint8 Transceiver, CanTrcv_TrcvModeType* TransceiverModePtr):获取收发器模式。

7.6 MainFunction

void CanIf_MainFunction_Read(void):读取事件处理。
void CanIf_MainFunction_BusOff(void):BusOff 处理。
void CanIf_MainFunction_Wakeup(void):唤醒处理。
void CanIf_MainFunction_Mode(void):模式处理。

8 配置

TTCAN Interface 配置类:

9 错误处理

9.1 开发错误

CANIF_E_UNINIT:模块未初始化。
CANIF_E_PARAM_POINTER:参数指针为空。
CANIF_E_PARAM:参数无效。
CANIF_E_INV_CFG:配置无效。

9.2 运行时错误

CANIF_E_BUSY:模块忙。


校对记录

校对轮次:L1 自动校对(2026-06-13)