StbM¶
文档信息(Document Information)¶
版本历史(Version History)¶
日期(Date) |
作者(Author) |
版本(Version) |
状态(Status) |
说明(Description) |
|---|---|---|---|---|
2025/2/24 |
xiongfei.shi |
V0.1 |
发布(Release) |
首次发布(First release) |
2025/04/04 |
xiongfei.shi |
V1.0 |
发布(Release) |
正式发布(Official release) |
参考文档(References)¶
编号(Number) |
分类(Classification) |
标题(Title) |
版本(Version) |
|---|---|---|---|
1 |
Autosar |
AUTOSAR_FO_RS_TimeSync.pdf |
R23-11 |
2 |
Autosar |
AUTOSAR_FO_PRS_TimeSyncProtocol.pdf |
R23-11 |
3 |
Autosar |
AUTOSAR_CP_SWS_SynchronizedTimeBaseManager.pdf |
R23-11 |
术语与简写(Terms and Abbreviations)¶
术语(Terms)¶
术语(Terms) |
解释(Explanation) |
|---|---|
Current Time Tuple |
当前时间元组,包含全局时间的本地实例和本地虚拟时间(Current time tuple, including the local instance of global time and local virtual time) |
Disciplined HW Clock |
一种可以调整其速率和偏移量的硬件时钟(A hardware clock whose rate and offset can be adjusted) |
Global Time |
由全局时间主机提供的时间(Time provided by the global time master) |
Local Instance of the Global Time |
基于本地虚拟时间结合从全局时间主机接收到的时间元组推导出的本地时间(Local time derived based on local virtual time combined with the time tuple received from the global time master) |
Main Time Tuple |
用来计算推导全局时间本地实例的时间对(A pair of times used to calculate and derive the local instance of global time) |
Notification Time Base Customer |
当发生如下事件时,时间基客户端将会被同步时间管理器通知:(The time base customer will be notified by the synchronized time manager when the following events occur:) 时间基状态发生了变化(例如,时间基发生了超时)(The time base status changes (for example, the time base times out)) 时间基准值已经达到了用户预先设定的一个值(The time base value has reached a value preset by the user) |
Offset Correction |
补偿时间偏移所需的偏移值(The offset value required to compensate for time offset) |
Offset Correction by Jump |
在时间同步时应用的一个偏移值,这是值将补偿本地全局时间与从时间主站接收到的全局时间值之间的时差(An offset value applied during time synchronization, which will compensate for the time difference between the local global time and the global time value received from the time master) |
Offset Correction by Rate Adaption |
除了速率校准之外还会应用速率偏差校准,这样可以让本地时间平滑的向全局时间过渡(In addition to rate correction, rate deviation correction will also be applied, which can make the local time smoothly transition to the global time) |
Rate Correction |
速率校准(Rate correction) |
Rate Deviation |
表示目标时钟频率和参考时钟频率之间相差了多少(Indicates the difference between the target clock frequency and the reference clock frequency) |
Time Base Customer |
同步时间管理器支持下述3种时基客户(The synchronized time manager supports the following three types of time base customers) 活跃客户(Active customers)、 触发客户(Trigger customers)、 通知客户(Notification customers) |
简写(Abbreviations)¶
简写(Abbreviation) |
全称(Full name) |
解释(Explanation) |
|---|---|---|
DET |
Default Error Tracer |
默认错误检测模块 |
ECU |
Electronic Control Unit |
电子控制器单元 |
PDU |
Protocol Data Unit |
协议数据单元 |
StbM |
Synchronized Time-Base Manager |
同步时基管理 |
<Bus>TSyn |
A bus specific Time Synchronization Provider module |
基于特定总线的时间同步模块 |
CanTSyn |
Time Synchronization Provider module for CAN |
基于CAN总线的时间同步提供者 |
EthTSyn |
Time Synchronization Provider module for Ethernet |
基于以太网总线的时间同步提供者 |
TG |
Time Gateway |
时间网关 |
TS |
Time Slave |
时间从机 |
TM |
Time Master |
时间主机 |
TD |
Time Domain |
时间域 |
TL |
Local Instance of the Global Time |
全局时间的本地实例 |
TV |
Virtual Local Time |
虚拟本地时间 |
Rrc |
Rate (correction) as derived by rate measurement |
速率校正值 |
Roc |
Rate offset as derived by Offset Correction by Rate Adaption |
通过速率自适应的偏移校正得出的速率偏移值 |
简介(Introduction)¶
StbM(Synchronization TimeBase Manager,时间同步管理器),负责在分布式车载系统中实现时间同步,确保相关模块在同一时间基准下运行。时间同步支持多种同步协议,这部分主要在<bus>TSyn模块中实现,StbM对这些模块进行统一的抽象和管理,对上提供服务。StbM在AutoSAR中软件层级架构如下图。
StbM (Synchronization TimeBase Manager) is responsible for implementing time synchronization in distributed in-vehicle systems to ensure that related modules run under the same time base. Time synchronization supports multiple synchronization protocols, which are mainly implemented in the <bus>TSyn module. StbM provides unified abstraction and management for these modules and offers services to the upper layer. The software layer architecture of StbM in AutoSAR is as follows.
![]()
StbM在AUTOSAR中的位置(Position of StbM in AUTOSAR)¶
本文主要描述StbM,给CanTSyn, EthTSyn提供接口用来更新同步时间,以及给其他用户提供接口用来获取/通知同步时间。
This document mainly describes StbM, which provides interfaces for CanTSyn and EthTSyn to update synchronization time, and provides interfaces for other users to obtain/notify synchronization time.
功能描述(Functional Description)¶
公共特性(Public Features)¶
多核多分区功能(Multi-core and Multi-partition Features)¶
StbMGenernal/StbMEcucPartitionRef 作为StbM模块的主分区,仅为服务封装提供参考
StbMGeneral/StbMEcucPartitionRef, as the main partition of the StbM module, serves only as a reference for service encapsulation.
StbM 以 StbMSynchronizedTimeBase 作为工作单位,其分区根据 StbMSynchronizedTimeBase /StbMLocalTimeClock/StbMLocalTimeHardware 引用的硬件时钟源决定:
StbM uses StbMSynchronizedTimeBase as the unit of work. Its partition is determined by the hardware clock source referenced by StbMSynchronizedTimeBase/StbMLocalTimeClock/StbMLocalTimeHardware:
CanTSynGlobalTimeDomain:获取 CanDriver 模块 CanGeneral/CanEcucPartitionRef 配置列表,即为 TimeBase 涉及的所有分区。
CanTSynGlobalTimeDomain: Obtains the CanGeneral/CanEcucPartitionRef configuration list from the CanDriver module, which represents all partitions involved in the TimeBase.
EthTSynGlobalTimeDomain:获取 EthDriver 模块 EthGeneral/EthEcucPartitionRef 配置列表,即为 TimeBase 涉及的所有分区。
EthTSynGlobalTimeDomain: Obtains the EthGeneral/EthEcucPartitionRef configuration list from the EthDriver module, which represents all partitions involved in the TimeBase.
GptChannelConfiguration:获取引用的 GptChannelConfiguration/GptChannelEcucPartitionRef 配置列表,即为 TimeBase 涉及的所有分区。
GptChannelConfiguration: Obtains the referenced GptChannelConfiguration/GptChannelEcucPartitionRef configuration list, which represents all partitions involved in the TimeBase.
配置项 StbMEcucPartitionRef 确定纯本地时间基运行在哪个分区上,同步时间基运行于哪个分区由其被关联的<Bus>TSyn模块决定,在单分区系统上不需要配置该参数。
The configuration item StbMEcucPartitionRef determines which partition the pure local time base runs on. The partition where the synchronized time base runs is determined by the <Bus>TSyn module it is associated with. This parameter does not need to be configured in a single-partition system.
Memmap功能(Memmap Features)¶
memmap文件是动态的。存在STBM_START_SEC_CODE、STBM_STOP_SEC_CODE、STBM_START_SEC_CALLOUT_CODE、STBM_STOP_SEC_CALLOUT_CODE、STBM_START_SEC_CONST_32、STBM_STOP_SEC_CONST_32、STBM_START_SEC_CONFIG_DATA_32、STBM_STOP_SEC_CONFIG_DATA_32、STBM_START_SEC_CONFIG_DATA_UNSPECIFIED、STBM_STOP_SEC_CONFIG_DATA_UNSPECIFIED、STBM_START_SEC_VAR_CLEARED_8、STBM_STOP_SEC_VAR_CLEARED_8、STBM_START_SEC_VAR_CLEARED_16、STBM_STOP_SEC_VAR_CLEARED_16、STBM_START_SEC_VAR_CLEARED_BOOLEAN、STBM_STOP_SEC_VAR_CLEARED_BOOLEAN、STBM_START_SEC_VAR_CLEARED_PTR、STBM_STOP_SEC_VAR_CLEARED_PTR、STBM_START_SEC_VAR_CLEARED_UNSPECIFIED、STBM_STOP_SEC_VAR_CLEARED_UNSPECIFIED、STBM_START_SEC_VAR_CLEARED_GLOBAL_UNSPECIFIED、STBM_STOP_SEC_VAR_CLEARED_GLOBAL_UNSPECIFIED、STBM_START_SEC_CONST_PTR、STBM_STOP_SEC_CONST_PTR、STBM_START_SEC_VAR_INIT_GLOBAL_UNSPECIFIED、STBM_STOP_SEC_VAR_INIT_GLOBAL_UNSPECIFIED、STBM_START_SEC_VAR_CLEARED_{{PartitionName}}_UNSPECIFIED、STBM_STOP_SEC_VAR_CLEARED_{{PartitionName}}_UNSPECIFIED 字段。
The memmap file is dynamic. There are STBM_START_SEC_CODE, STBM_STOP_SEC_CODE, STBM_START_SEC_CALLOUT_CODE, STBM_STOP_SEC_CALLOUT_CODE, STBM_START_SEC_CONST_32, STBM_STOP_SEC_CONST_32, STBM_START_SEC_CONFIG_DATA_32, STBM_STOP_SEC_CONFIG_DATA_32, STBM_START_SEC_CONFIG_DATA_UNSPECIFIED, STBM_STOP_SEC_CONFIG_DATA_UNSPECIFIED, STBM_START_SEC_VAR_CLEARED_8, STBM_STOP_SEC_VAR_CLEARED_8, STBM_START_SEC_VAR_CLEARED_16, STBM_STOP_SEC_VAR_CLEARED_16, STBM_START_SEC_VAR_CLEARED_BOOLEAN, STBM_STOP_SEC_VAR_CLEARED_BOOLEAN, STBM_START_SEC_VAR_CLEARED_PTR, STBM_STOP_SEC_VAR_CLEARED_PTR, STBM_START_SEC_VAR_CLEARED_UNSPECIFIED, STBM_STOP_SEC_VAR_CLEARED_UNSPECIFIED, STBM_START_SEC_VAR_CLEARED_GLOBAL_UNSPECIFIED, STBM_STOP_SEC_VAR_CLEARED_GLOBAL_UNSPECIFIED, STBM_START_SEC_CONST_PTR, STBM_STOP_SEC_CONST_PTR, STBM_START_SEC_VAR_INIT_GLOBAL_UNSPECIFIED, STBM_STOP_SEC_VAR_INIT_GLOBAL_UNSPECIFIED, STBM_START_SEC_VAR_CLEARED_{{PartitionName}}_UNSPECIFIED、STBM_STOP_SEC_VAR_CLEARED_{{PartitionName}}_UNSPECIFIED fields.
独占区功能(Exclusive Area Features)¶
None.
模块特性(Module Features)¶
全局时间基(Global Time Base)¶
由于不同的硬件时钟,速率可能会有偏差,这将会导致使用不同硬件时钟的应用,各自的时间会有偏差,为了消除这种偏差,StbM会将一个主节点的时间基作为全局的时间基,并将所有其他节点的时间同步到这一节点,以达成时间同步的目的。
Due to the possible rate deviation of different hardware clocks, applications using different hardware clocks will have time deviations. To eliminate this deviation, StbM will take the time base of a master node as the global time base,and synchronize the time of all other nodes to this node to achieve time synchronization.
状态变化通知功能(Status Change Notification Function)¶
StbM允许客户注册回调函数,StbM将跟踪用户通过掩码配置的状态位,当这些状态位有变化时StbM将通过回调函数通知用户。
StbM allows customers to register callback functions. StbM will track the status bits configured by the user through a mask, and notify the user through the callback function when these status bits change.
定时功能(Timing Function)¶
StbM实现了定时器功能,允许用户设置定时任务,当时间到达用户设定的时间值时,StbM将通过回调函数触发用户设定的任务。
StbM implements a timer function, allowing users to set timing tasks. When the time reaches the time value set by the user, StbM will trigger the task set by the user through a callback function.
时间记录功能(Time Recording Function)¶
时间记录功能将记录StbM发生同步事件的时间点的数据快照,供用户获取用于验证本地时间精度等目的。
The time recording function will record data snapshots of the time points when synchronization events occur in StbM, for users to obtain for purposes such as verifying local time accuracy.
时间偏差校准(Time Deviation Correction)¶
如果开启了时间偏差校准功能,StbM将通过速率校准和偏移校准来减小本地时间和全局时间之间的偏差。StbM管理一个主时间组,这个主时基组用来作为其他从节点时间同步的基准,主时间组由TG和TV组成,TG是全局时间,TV是虚拟本地时间,TG的来源为总线同步模块设置的时间和当前的TV通过时间校正计算而得出的时间,TV的来源是本地的硬件时钟,包括GPT,OS和EthTSyn三种。
If the time deviation correction function is enabled, StbM will reduce the deviation between local time and global time through rate correction and offset correction. StbM manages a main time group, which is used as the reference for time synchronization of other slave nodes.The main time group consists of TG and TV. TG is the global time, and TV is the virtual local time. The source of TG is the time set by the bus synchronization module and the time derived from the current TV through time correction calculation. The source of TV is the local hardware clock, including GPT, OS, and EthTSyn.
时间校正计算包括偏移校正和速率校正,偏移校正包括跳跃校正和速率适应。速率校正,在单位时间不停计算时间差,以得出不同时钟间的速率偏差,而偏移校正是根据本地的时间,速率的偏差以及接受到的时间计算得出的时间来覆盖主时间组。表示成公式为TL = TGSync + (TV - TVSync) * r。其中的跳跃校正为当StbM接收到时间值时,主时间组的值直接更新为接收到的时间。
Time correction calculation includes offset correction and rate correction. Offset correction includes jump correction and rate adaptation. Rate correction continuously calculates the time difference per unit time to derive the rate deviation between different clocks, while offset correction overwrites the main time group based on the local time,rate deviation, and the time calculated from the received time. It is expressed as a formula: TL = TGSync + (TV - TVSync) * r. The jump correction is that when StbM receives a time value, the value of the main time group is directly updated to the received time.
速率适应的偏移校正,则是在一段时间内逐渐校正调整偏移值。
Offset correction with rate adaptation gradually corrects and adjusts the offset value over a period of time.
偏差(Deviation)¶
1.不再支持偏移时间基(Offset time base is no longer supported)
2.不支持备用时钟功能(Standby clock function is not supported)
3.不支持时间验证功能(Time verification function is not supported)
4.不支持时间新鲜度功能(Time freshness function is not supported)
5.不支持Disciplined HW Clock(Disciplined HW Clock is not supported)
6.不支持同步时间的NVM存储机制(NVM storage mechanism for synchronized time is not supported)
7.不支持时间基的克隆(Time base cloning is not supported)
扩展(Extension¶
None
集成(Integration)¶
文件列表(File List)¶
静态文件(Static Files)¶
文件(File) |
描述(Description) |
|---|---|
StbM.h |
StbM模块头文件,包含了API函数的声明(Header file of the StbM module, including declarations of API functions) |
StbM_Internal.h |
StbM模块头文件,包含了内部数据类型定义(Header file of the StbM module, including definitions of internal data types) |
StbM_Types.h |
StbM模块头文件,包含了外部数据类型定义(Header file of the StbM module, including definitions of external data types) |
StbM.c |
StbM模块源文件,包含了API函数的实现(Source file of the StbM module, including implementations of API functions) |
StbM_CanTSyn.h |
声明StbM模块提供给CanTSyn模块的回调函数 (Declares callback functions for CanTSyn interaction) |
StbM_Clock.h |
StbM模块头文件,包含了同步时基时钟管理(Synchronized TimeBase Manager Clock Header File) |
StbM_EthTSyn.h |
声明StbM模块提供给EthTSyn模块的回调函数(Declares callback functions for EthTSyn interaction) |
StbM_Freshness.h |
StbM模块头文件,包含了同步时基新鲜度管理(Synchronized TimeBase Manager Freshness Header File) |
动态文件(Dynamic Files)¶
文件(File) |
描述(Description) |
|---|---|
StbM_MemMap.h |
StbM模块的内存映射(Memory mapping of the StbM module) |
StbM_Cfg.h |
定义StbM模块预编译时用到的配置参数(Defines configuration parameters used in the pre-compilation of the StbM module) |
StbM_Cfg.c |
StbM Pre-Compile 配置源文件(Pre-Compile configuration source file of StbM) |
StbM_PBcfg.c |
StbM Post-Build 配置源文件(Post-Build configuration source file of StbM) |
StbM_Callout.c |
用户自定义的回调函数实现(Implementation of user-defined callback functions) |
StbM_External.h |
用户自定义回调函数声明(Declarations of user-defined callback functions) |
错误处理(Error Handling)¶
开发错误(Development Errors)¶
Error code |
Value[hex] |
Description |
|---|---|---|
STBM_E_PARAM |
0x0A |
API called with invalid parameters. |
STBM_E_UNINIT |
0x0B |
API called while StbM is not initialized. |
STBM_E_PARAM_POINTER |
0x10 |
API called with invalid pointer in parameter list. |
STBM_E_INIT_FAILED |
0x11 |
STbM_Init initialization failed. |
STBM_E_SERVICE_NOT_SUPPORTED |
0x12 |
API not supported with current configuration. |
STBM_E_PARAM_TIMESTAMP |
0x25 |
API called with invalid timestamp. |
STBM_E_PARAM_USERDATA |
0x26 |
API called with invalid user data. |
STBM_E_INVALID_PARTITION |
0xF0 |
API called in invalid partition. |
STBM_E_ALREADY_INITIALIZED |
0xF1 |
StbM_Init has already been initialized. |
产品错误(Product Errors)¶
None
运行时错误(Runtime Errors)¶
None
接口描述(Interface Description)¶
类型定义¶
Type Name |
Type |
Description |
|---|---|---|
StbM_MeasurementType |
struct |
提供的服务¶
StbM_Init¶
void StbM_Init(const StbM_ConfigType *configPtr)
Initializes the Synchronized Timebase Manager.
- Sync/Async
Synchronous
- Reentrancy
Reentrant (Reentrant for different partitions. Non reentrant for the same partition.)
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
configPtr |
Pointer to post-build configuration data |
- Return type
void
StbM_GetVersionInfo¶
void StbM_GetVersionInfo(Std_VersionInfoType *versioninfo)
This function returns the version information of this module.
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[out] |
versioninfo |
Pointer to the memory location holding the version information. |
- Return type
void
StbM_GetCurrentTime¶
Std_ReturnType StbM_GetCurrentTime(StbM_SynchronizedTimeBaseType timeBaseId, StbM_TimeTupleType *timeTuple, StbM_UserDataType *userData)
Returns a time value(Local Time Base derived from Global Time Base) in standard format.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
timeTuple |
Current time stamp that is valid at this time |
[out] |
userData |
User data of the Time Base |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully get the Current time |
E_NOT_OK |
Getting the Current time failed |
StbM_GetCurrentSafeTime¶
Std_ReturnType StbM_GetCurrentSafeTime(StbM_SynchronizedTimeBaseType timeBaseId, StbM_TimeTripleType *timeTriple, StbM_UserDataType *userData)
Returns a time triple (Local Time, Fallback Local Time, Global time and timebase status) and user data details. Note: This API shall be called with locked interrupts / within an Exclusive Area to prevent interruption (i.e., the risk that the time stamp is outdated on return of the function call).
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
time base reference |
timeTriple |
||
userData |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
StbM_GetCurrentVirtualLocalTime¶
Std_ReturnType StbM_GetCurrentVirtualLocalTime(StbM_SynchronizedTimeBaseType timeBaseId, StbM_VirtualLocalTimeType *localTimePtr)
Returns the Virtual Local Time of the referenced Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
localTimePtr |
Current Virtual Local Time value |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully get the Virtual Local Time |
E_NOT_OK |
Getting the Virtual Local Time failed |
StbM_GetFallbackVirtualLocalTime¶
Std_ReturnType StbM_GetFallbackVirtualLocalTime(StbM_SynchronizedTimeBaseType timeBaseId, StbM_VirtualLocalTimeType *localTimePtr)
Returns the fallback Virtual Local Time of the referenced Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[out] |
localTimePtr |
Current Fallback Virtual Local Time value |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
StbM_SetGlobalTime¶
Std_ReturnType StbM_SetGlobalTime(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_TimeStampType *timeStamp, const StbM_UserDataType *userData)
Allows the Customers to set the new global time that has to be valid for the system, which will be sent to the busses. This function will be used if a Time Master is present in this ECU.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
timeStamp |
New time stamp |
[in] |
userData |
New user data(if not NULL) |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully set the global time |
E_NOT_OK |
Setting the global Time failed |
StbM_UpdateGlobalTime¶
Std_ReturnType StbM_UpdateGlobalTime(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_TimeStampType *timeStamp, const StbM_UserDataType *userData)
Allows the Customers to set the Global Time that will be sent to the buses. This function will be used if a Time Master is present in this ECU. Using UpdateGlobal Time will not lead to an immediate transmission of the Global Time.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
timeStamp |
New time stamp |
[in] |
userData |
New user data(if not NULL) |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully update the global time |
E_NOT_OK |
updating the global Time failed |
StbM_SetUserData¶
Std_ReturnType StbM_SetUserData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_UserDataType *userData)
Allows the customers to set the new user data that has to be valid for the system, which will be sent to the busses.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
userData |
New user data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully set the user data |
E_NOT_OK |
setting the user data failed |
StbM_BusSetGlobalTime¶
Std_ReturnType StbM_BusSetGlobalTime(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_TimeTupleType *timeTuplePtr, const StbM_UserDataType *userDataPtr, const StbM_MeasurementType *measureDataPtr)
Allows the Time Base Provider Modules to forward a new Global Time tuple(i.e., the Received Time Tuple) to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
timeTuplePtr |
New Global Time Tuple value |
[in] |
userDataPtr |
New User Data(if not NULL) |
[in] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully set Global Time tuple |
E_NOT_OK |
Setting the Global Time tuple failed |
StbM_GetRateDeviation¶
Std_ReturnType StbM_GetRateDeviation(StbM_SynchronizedTimeBaseType timeBaseId, StbM_RateDeviationType *rateDeviation)
Returns value of the current rate deviation of a Time Base.
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
rateDeviation |
Value of the current rate deviation of a Time Base |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully get rate deviation of a Time Base |
E_NOT_OK |
Getting the rate deviation failed |
StbM_SetRateCorrection¶
Std_ReturnType StbM_SetRateCorrection(StbM_SynchronizedTimeBaseType timeBaseId, StbM_RateDeviationType rateDeviation)
Allows to set the rate of a Synchronized Time Base(being either a Pure Local Time Base or not).
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
rateDeviation |
value of the applied rate deviation |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully set rate deviation of a Time Base |
E_NOT_OK |
Setting the rate deviation failed |
StbM_GetTimeLeap¶
Std_ReturnType StbM_GetTimeLeap(StbM_SynchronizedTimeBaseType timeBaseId, StbM_TimeDiffType *timeJump)
Returns value of Time Leap.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
timeJump |
Time leap value |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully get Time leap value |
E_NOT_OK |
Getting Time leap value failed |
StbM_GetTimeBaseStatus¶
Std_ReturnType StbM_GetTimeBaseStatus(StbM_SynchronizedTimeBaseType timeBaseId, StbM_TimeBaseStatusType *timeBaseStatus)
Returns detailed status information for a Synchronized(or Pure Local) Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
timeBaseStatus |
Status of the Synchronized(or Pure Local) Time Base |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully get status of the Time Base |
E_NOT_OK |
Getting status of the Time Base failed |
StbM_StartTimer¶
Std_ReturnType StbM_StartTimer(StbM_SynchronizedTimeBaseType timeBaseId, StbM_CustomerIdType customerId, const StbM_TimeStampType *expireTime)
Sets a time value, which the Time Base value is compared against.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
customerId |
The ID of the customer that is being used |
[in] |
expireTime |
Time value relative to current Time Base value of the Notification |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully start the timer |
E_NOT_OK |
Starting the timer failed |
StbM_GetSyncTimeRecordHead¶
Std_ReturnType StbM_GetSyncTimeRecordHead(StbM_SynchronizedTimeBaseType timeBaseId, StbM_SyncRecordTableHeadType *syncRecordTableHead)
Accesses to the recorded snapshot data Header of the table belonging to the Synchronized Time Base.
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
syncRecordTableHead |
Header of the table |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successful |
E_NOT_OK |
Failed |
StbM_TriggerTimeTransmission¶
Std_ReturnType StbM_TriggerTimeTransmission(StbM_SynchronizedTimeBaseType timeBaseId)
Called by the <Upper Layer> to force the Timesync Modules to transmit the current Time Base again due to an incremented timeBaseUpdateCounter[timeBaseId].
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successful |
E_NOT_OK |
Failed |
StbM_GetTimeBaseUpdateCounter¶
uint8 StbM_GetTimeBaseUpdateCounter(StbM_SynchronizedTimeBaseType timeBaseId)
Allows the Timesync Modules to detect, whether a Time Base should be transmitted immediately in the subsequent <Bus>TSyn_MainFunction() cycle.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
- Return type
uint8
Return values
Name |
Description |
|---|---|
Counter |
value belonging to the Time Base, that indicates a Time Base update to the Timesync Modules |
StbM_GetMasterConfig¶
Std_ReturnType StbM_GetMasterConfig(StbM_SynchronizedTimeBaseType timeBaseId, StbM_MasterConfigType *masterConfig)
Indicates if the functionality for a system wide master(e.g. StbM_SetGlobalTime) for a given Time Base is available or not.
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
masterConfig |
Indicates, if system wide master functionality is supported |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successful |
E_NOT_OK |
Failed |
StbM_GetBusProtocolParam¶
Std_ReturnType StbM_GetBusProtocolParam(StbM_SynchronizedTimeBaseType timeBaseId, StbM_ProtocolParamType *protocolParam)
Returns the protocol parameters for the Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[out] |
protocolParam |
Protocol parameters |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully get protocol parameters |
E_NOT_OK |
Getting protocol parameters failed |
StbM_SetBusProtocolParam¶
Std_ReturnType StbM_SetBusProtocolParam(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_ProtocolParamType *protocolParam)
Sets the protocol parameters for the Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
protocolParam |
Protocol parameters |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully set protocol parameters |
E_NOT_OK |
Setting protocol parameters failed |
StbM_GetTxFreshness¶
Std_ReturnType StbM_GetTxFreshness(uint16 StbMFreshnessValueId, uint8 *StbMFreshnessValue, uint32 *StbMFreshnessValueLength)
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
StbMFreshnessValueId |
Holds the identifier of the freshness value |
[out] |
StbMFreshnessValue |
Holds the current freshness value |
[inout] |
StbMFreshnessValueLength |
Holds the length of the provided freshness in bits |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
request successful |
E_NOT_OK |
request failed, a Freshness Value cannot be provided due to general issues for Freshness for this FreshnessValueId |
STBM_E_BUSY |
The Freshness information can temporarily not be provided |
StbM_GetTxFreshnessTruncData¶
Std_ReturnType StbM_GetTxFreshnessTruncData(uint16 StbMFreshnessValueId, uint8 *StbMFreshnessValue, uint32 *StbMFreshnessValueLength, uint8 *StbMTruncatedFreshnessValue, uint32 *StbMTruncatedFreshnessValueLength)
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
StbMFreshnessValueId |
Holds the identifier of the freshness value |
[out] |
StbMFreshnessValue |
Holds the current freshness value |
[inout] |
StbMFreshnessValueLength |
Holds the length of the provided freshness in bits |
[out] |
StbMTruncatedFreshnessValue |
Holds the truncated freshness to be included into the Secured time sync message. The parameter is optional. |
[inout] |
StbMTruncatedFreshnessValueLength |
Provides the truncated freshness length configured for this freshness. The caller may adapt the value if needed or can leave it unchanged if the configured length and provided length is the same. |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
request successful |
E_NOT_OK |
request failed, a Freshness Value cannot be provided due to general issues for Freshness for this FreshnessValueId |
STBM_E_BUSY |
The Freshness information can temporarily not be provided. |
StbM_SPduTxConfirmation¶
void StbM_SPduTxConfirmation(uint16 StbMFreshnessValueId)
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
StbMFreshnessValueId |
Holds the identifier of the freshness value |
- Return type
void
StbM_GetRxFreshness¶
Std_ReturnType StbM_GetRxFreshness(uint16 StbMFreshnessValueId, const uint8 *StbMTruncatedFreshnessValue, uint32 StbMTruncatedFreshnessValueLength, uint16 StbMAuthVerifyAttempts, uint8 *StbMFreshnessValue, uint32 *StbMFreshnessValueLength)
- Sync/Async
Synchronous
- Reentrancy
Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
StbMFreshnessValueId |
Holds the identifier of the freshness value. |
[in] |
StbMTruncatedFreshnessValue |
Holds the truncated freshness value that was contained in the Secured time sync message |
[in] |
StbMTruncatedFreshnessValueLength |
Holds the length in bits of the truncated freshness value. |
[in] |
StbMAuthVerifyAttempts |
Holds the number of authentication verify attempts of this time sync message since the last reception. The value is 0 for the first attempt and incremented on every unsuccessful verification attempt. |
[out] |
StbMFreshnessValue |
Holds the current freshness value |
[inout] |
StbMFreshnessValueLength |
Holds the length in bits of the freshness value |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
request successful |
E_NOT_OK |
request failed, a Freshness Value cannot be provided due to general issues for Freshness for this FreshnessValueId |
STBM_E_BUSY |
The Freshness information can temporarily not be provided. |
StbM_SetCloningOffset¶
Std_ReturnType StbM_SetCloningOffset(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_TimeStampType *timeOffset)
This interface is used by the StbM to set the time offset for the Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
timeOffset |
Time offset |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully set time offset |
E_NOT_OK |
Setting time offset failed |
StbM_CloneTimeBase¶
Std_ReturnType StbM_CloneTimeBase(StbM_SynchronizedTimeBaseType timeBaseId, StbM_CloneConfigType cloneCfg, StbM_TimeBaseStatusType statusMask, StbM_TimeBaseStatusType statusValue)
This interface is used by the StbM to clone the Time Base.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Identification of a Time Base |
[in] |
cloneCfg |
Clone configuration |
[in] |
statusMask |
Status mask |
[in] |
statusValue |
Status value |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Successfully cloned Time Base |
E_NOT_OK |
Cloning Time Base failed |
类型定义¶
Type Name |
Type |
Description |
|---|---|---|
StbMTimeNtfCallbackType |
void* |
|
StbM_HwCounterType |
uint64 |
|
StbM_LocalTimeType |
uint64 |
|
StbM_Time64TupleType |
struct |
|
StbM_RateCorrectionTupleType |
struct |
|
StbM_RateCorrectionType |
struct |
|
StbM_CurrentRateType |
struct |
|
StbM_NotificationType |
struct |
|
StbM_RateValidationTimeTripleType |
struct |
|
StbM_TimeBaseType |
struct |
提供的服务¶
StbM_MainFunction¶
void StbM_MainFunction(void)
This function needs to be called periodically to perform the AUTOSAR StbM activities.
- Sync/Async
Asynchronous
- Reentrancy
Reentrant (Reentrant for different partitions. Non reentrant for the same partition.)
- Return type
void
类型定义¶
Type Name |
Type |
Description |
|---|---|---|
StbM_SynchronizedTimeBaseTypeType |
enum |
|
CrcValidatedType |
enum |
|
CrcSecuredType |
enum |
|
StbM_NotificationInterfaceType |
enum |
|
StbM_LocalTimeHardwareCfgType |
enum |
|
StbM_RateSourceType |
enum |
|
StbM_TriggeredCustomerCfgType |
struct |
defines Configuration of The triggered customer. |
StbM_TimeCorrectionCfgType |
struct |
defines Configuration of the rate and offset correction. |
StbM_CloneRequestType |
struct |
|
StbM_LocalTimeClockCfgType |
struct |
defines Configuration of the hardware reference clock for StbMLocalTimeClock and StbMFallbackTimeClock. |
StbM_DisciplinedClockCfgType |
struct |
|
StbM_TimeRecordingCfgType |
struct |
defines Configuration of the time recording. |
StbM_NotificationCustomerCfgType |
struct |
defines Configuration of the Notification Customer. |
StbM_CanSlaveMeasurementQueueType |
struct |
|
StbM_CanMasterMeasurementQueueType |
struct |
|
StbM_EthSlaveMeasurementQueueType |
struct |
|
StbM_PdelayInitiatorMeasurementQueueType |
struct |
|
StbM_EthMasterMeasurementQueueType |
struct |
|
StbM_PdelayResponderMeasurementQueueType |
struct |
|
StbM_SynchronizedTimeBaseCfgType |
struct |
defines the information about a specific time-base. |
StbM_ConfigType |
struct |
提供的服务¶
类型定义¶
None
提供的服务¶
StbM_CanSetSlaveTimingData¶
Std_ReturnType StbM_CanSetSlaveTimingData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_CanTimeSlaveMeasurementType *measureDataPtr)
Allows the CanTSyn Module to forward CAN specific details to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[in] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
StbM_CanSetMasterTimingData¶
Std_ReturnType StbM_CanSetMasterTimingData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_CanTimeMasterMeasurementType *measureDataPtr)
Provides CAN Timesyn module specific data for a Time Master to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[out] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
类型定义¶
Type Name |
Type |
Description |
|---|---|---|
StbM_ClockGptConfigType |
struct |
|
StbM_ClockOsConfigType |
struct |
提供的服务¶
StbM_ClockPreInit¶
void StbM_ClockPreInit(void)
Sync/Async
Reentrancy
- Return type
void
StbM_ClockGptInit¶
void StbM_ClockGptInit(uint8 channelIdx)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
channelIdx |
- Return type
void
StbM_ClockGptGetCurrentTime¶
void StbM_ClockGptGetCurrentTime(uint8 channelIdx, uint64 *timePtr)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
channelIdx |
||
timePtr |
- Return type
void
StbM_ClockOsGetCurrentTime¶
void StbM_ClockOsGetCurrentTime(uint8 counterIdx, uint64 *timePtr)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
counterIdx |
||
timePtr |
- Return type
void
类型定义¶
None
提供的服务¶
StbM_EthSetSlaveTimingData¶
Std_ReturnType StbM_EthSetSlaveTimingData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_EthTimeSlaveMeasurementType *measureDataPtr)
Allows the EthTSyn Module to forward Ethernet specific details to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[in] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
StbM_EthSetPdelayInitiatorData¶
Std_ReturnType StbM_EthSetPdelayInitiatorData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_PdelayInitiatorMeasurementType *measureDataPtr)
Allows the EthTSyn Module to forward Ethernet specific pdelay initiator data to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[in] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
StbM_EthSetMasterTimingData¶
Std_ReturnType StbM_EthSetMasterTimingData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_EthTimeMasterMeasurementType *measureDataPtr)
Provides Ethernet Timesyn module specific data for a Time Master to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[out] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
StbM_EthSetPdelayResponderData¶
Std_ReturnType StbM_EthSetPdelayResponderData(StbM_SynchronizedTimeBaseType timeBaseId, const StbM_PdelayResponderMeasurementType *measureDataPtr)
Provides Ethernet Timesyn module specific pdelay responder data for a Time Master to the StbM.
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
timeBaseId |
Time Base reference |
[out] |
measureDataPtr |
New measurement data |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successful |
E_NOT_OK |
failed |
类型定义¶
None
提供的服务¶
StbM_FreshnessGetConfig¶
const StbM_FreshnessValueType * StbM_FreshnessGetConfig(uint16 freshnessValueId)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
freshnessValueId |
- Return type
const StbM_FreshnessValueType *
StbM_FreshnessGetTxData¶
Std_ReturnType StbM_FreshnessGetTxData(uint16 freshnessValueId, uint8 *freshnessValue, uint32 *freshnessValueLength)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
freshnessValueId |
||
freshnessValue |
||
freshnessValueLength |
- Return type
Std_ReturnType
StbM_FreshnessGetTxTruncData¶
Std_ReturnType StbM_FreshnessGetTxTruncData(uint16 freshnessValueId, uint8 *freshnessValue, uint32 *freshnessValueLength, uint8 *truncatedFreshnessValue, uint32 *truncatedFreshnessValueLength)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
freshnessValueId |
||
freshnessValue |
||
freshnessValueLength |
||
truncatedFreshnessValue |
||
truncatedFreshnessValueLength |
- Return type
Std_ReturnType
StbM_FreshnessSPduTxConfirmation¶
void StbM_FreshnessSPduTxConfirmation(uint16 freshnessValueId)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
freshnessValueId |
- Return type
void
StbM_FreshnessGetRxData¶
Std_ReturnType StbM_FreshnessGetRxData(uint16 freshnessValueId, const uint8 *truncatedFreshnessValue, uint32 truncatedFreshnessValueLength, uint16 authVerifyAttempts, uint8 *freshnessValue, uint32 *freshnessValueLength)
Sync/Async
Reentrancy
Parameters
Dir |
Name |
Description |
|---|---|---|
freshnessValueId |
||
truncatedFreshnessValue |
||
truncatedFreshnessValueLength |
||
authVerifyAttempts |
||
freshnessValue |
||
freshnessValueLength |
- Return type
Std_ReturnType
配置函数(Configuration function)¶
StbM_MainFunction¶
void StbM_MainFunction(void)
This function needs to be called periodically to perform the AUTOSAR StbM activities.
- Sync/Async
Asynchronous
- Reentrancy
Reentrant (Reentrant for different partitions. Non reentrant for the same partition.)
- Return type
void
StatusNotificationCallback<TimeBase>¶
Std_ReturnType StatusNotificationCallback<TimeBase>(StbM_TimeBaseNotificationType eventNotification)
The callback notifies the customers, when a <TimeBase> related event occurs, which is enabled by the notification mask
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
eventNotification |
Holds the notification bits for the different Time Base related events |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successfull |
E_NOT_OK |
failed |
<Customer>_TimeNotificationCallback<TimeBase>¶
Std_ReturnType <Customer>_TimeNotificationCallback<TimeBase>(StbM_TimeDiffType deviationTime)
This callback notifies the <Customer>, when a Time Base reaches the time value set by StbM_StartTimer for the <TimeBase>
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
deviationTime |
Difference time value when callback is called by StbM |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
successfull |
E_NOT_OK |
failed |
SyncTimeRecordBlockCallback<TimeBase>¶
Std_ReturnType SyncTimeRecordBlockCallback<TimeBase>(const StbM_SyncRecordTableBlockType* syncRecordTableBlock)
Provides a recorded snapshot data block of the measurement data table belonging to the Synchronized Time Base
- Sync/Async
Synchronous
- Reentrancy
Non Reentrant
Parameters
Dir |
Name |
Description |
|---|---|---|
[in] |
syncRecordTableBlock |
Block of the table |
- Return type
Std_ReturnType
Return values
Name |
Description |
|---|---|
E_OK |
Table access done |
E_NOT_OK |
Table contains no data or access invalid |
SWC服务组件封装(SWC Service Component Encapsulation)¶
以下类型和接口可以封装至SWC生成完整的服务组件,可以与应用通过端口连接,没有列出的部分StbM底层暂时不支持。
The following types and interfaces can be encapsulated into SWC to generate a complete service component, which can be connected to applications through ports. The unlisted parts are temporarily not supported by the StbM bottom layer.
CS接口封装(CS Interface Encapsulation)¶
注:下面提到的<UserModule>和<UserPort>分别为用户SWC的名字和对应端口名,在与StbM服务组件端口连接后适用。
Note: <UserModule> and <UserPort> mentioned below are the name of the user SWC and the corresponding port name, which are applicable after connecting to the StbM service component port.
Rte_Call_<UserModule>_<UserPort>_GetMasterConfig
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_GetMasterConfig |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_GetMasterConfig(See StbM_GetMasterConfig in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == TRUE And 2. StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Master_{Name} |
Rte_Call_<UserModule>_<UserPort>_SetGlobalTime
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_SetGlobalTime |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_SetGlobalTime(See StbM_SetGlobalTime in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == TRUE And 2. StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Master_{Name} |
Rte_Call_<UserModule>_<UserPort>_SetRateCorrection
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_SetRateCorrection |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_SetRateCorrection(See StbM_SetRateCorrection in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == TRUE And 2. StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Master_{Name} |
Rte_Call_<UserModule>_<UserPort>_SetUserData
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_SetUserData |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_SetUserData(See StbM_SetUserData in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == TRUE And 2. StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Master_{Name} |
Rte_Call_<UserModule>_<UserPort>_TriggerTimeTransmission
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_TriggerTimeTransmission |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_TriggerTimeTransmission(See StbM_TriggerTimeTransmission in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == TRUE And 2. StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Master_{Name} |
Rte_Call_<UserModule>_<UserPort>_UpdateGlobalTime
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_UpdateGlobalTime |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_UpdateGlobalTime(See StbM_UpdateGlobalTime in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == TRUE And 2. StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Master_{Name} |
Rte_Call_<UserModule>_<UserPort>_GetCurrentTime
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_GetCurrentTime |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_GetCurrentTime(See StbM_GetCurrentTime in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Slave_{Name} |
Rte_Call_<UserModule>_<UserPort>_GetRateDeviation
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_GetRateDeviation |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_GetRateDeviation(See StbM_GetRateDeviation in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Slave_{Name} |
Rte_Call_<UserModule>_<UserPort>_GetSyncTimeRecordHead
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_GetSyncTimeRecordHead |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_GetSyncTimeRecordHead(See StbM_GetSyncTimeRecordHead in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
1. StbMSynchronizedTimeBaseIdentifier < 128 And 2. StbMSynchronizedTimeBase/StbMIsSystemWideGlobalTimeMaster == FALSE And 3. StbMGeneral/StbMTimeRecordingSupport == True |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Slave_{Name} |
Rte_Call_<UserModule>_<UserPort>_GetTimeBaseStatus
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_GetTimeBaseStatus |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_GetTimeBaseStatus(See StbM_GetTimeBaseStatus in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Slave_{Name} |
Rte_Call_<UserModule>_<UserPort>_GetTimeLeap
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_GetTimeLeap |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_GetTimeLeap(See StbM_GetTimeLeap in the interface description chapter) |
变体:(Variant:) |
Name=StbMSynchronizedTimeBase.SHORT-NAME |
生成条件:(Generation Condition:) |
StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
GlobalTime_Slave_{Name} |
Rte_Call_<UserModule>_<UserPort>_StartTimer
函数名称:(Function Name:) |
Rte_Call_<UserModule>_<UserPortName>_StartTimer |
|---|---|
运行实体函数定义:(Runtime Entity Function Definition:) |
详见接口描述章节的StbM_StartTimer(See StbM_StartTimer in the interface description chapter) |
变体:(Variant:) |
TimeBase = StbMSynchronizedTimeBase.SHORT-NAME Customer = StbMSynchronizedTimeBase/StbMNotificationCustomer.SHORT-NAME |
生成条件:(Generation Condition:) |
StbMSynchronizedTimeBaseIdentifier < 128 |
端口类型:(Port Type:) |
Provided Port |
从属端口:(Dependent Port:) |
StartTimer_{TimeBase}_{Customer} |
依赖的服务(Applicable Services)¶
强制接口(Compulsory interface)¶
可选接口(Optional Interface)¶
API Function |
Header File |
Description |
|---|---|---|
Det_ReportError |
Det.h |
Service to report development errors. |
GetApplicationID |
Os.h |
Get application ID. |
EthIf_GetCurrentTimeTuple |
EthIf.h |
Returns a time tuple value out of the HW registers according to the capability of the HW. |
Gpt_GetTimeElapsed |
Gpt.h |
This service gets the number of ticks between the current tick value and a previously read tick value. |
GetCounterValue |
Os.h |
This service reads the current count value of a counter. |
Gpt_StartTimer |
Gpt.h |
Starts a timer channel. |
SyncScheduleTable |
Os.h |
This service provides the schedule table with a synchronization count and start synchronization. |
配置接口(Configuration Interfaces)¶
配置(Configuration)¶
StbMGeneral¶
![]()
StbMGeneral配置(StbMGeneral Configuration)
StbMGptTimerRef¶
该配置项选中的Gpt时钟必须是独占的,不能同时被时间基使用。
The Gpt clock selected in this configuration item must be exclusive and cannot be used by the time base at the same time.
该配置项选中的Gpt时钟需要在Mcal层将时钟周期配置为1微妙,并且将其定时中断函数配置为StbM_TimerCallback()。
The Gpt clock selected in this configuration item needs to configure the clock period to 1 microsecond in the Mcal layer, and configure its timing interrupt function to StbM_TimerCallback().
该配置项只能配置一个Gpt定时器,该定时器Mcal如果不支持跨核调用的话,那么创建的定时任务需要和该定时器需要配置在同一个核上。
Only one Gpt timer can be configured in this configuration item. If the Mcal of this timer does not support cross-core calls, the created timing task needs to be configured on the same core as the timer.
StbMSynchronizedTimeBase¶
StbMStoreTimebaseNonVolatile¶
当前还不支持此功能,因此该配置使能与否都无影响。
This function is not currently supported, so whether this configuration is enabled has no effect.
StbMLocalTimeClock¶
![]()
StbMLocalTimeClock配置(StbMLocalTimeClock Configuration)
注意: StbMLocalTimeHardware 的配置需要注意该StbM将被哪个<Bus>TSyn模块关联,那么此处配置的硬件时钟需要在Mcal上将其配置为和<Bus>TSyn模块在同一个核上。
For the configuration of StbMLocalTimeHardware , attention should be paid to which <Bus>TSyn module the StbM will be associated with. Then, the hardware clock configured here needs to be configured on the same core as the <Bus>TSyn module in Mcal.
如果该StbM将被多个不同核上的<Bus>TSyn模块关联,那么此处配置的硬件时钟需要在Mcal上将其配置为允许多核访问。
If the StbM will be associated with <Bus>TSyn modules on multiple different cores, the hardware clock configured here needs to be configured to allow multi-core access in Mcal.
Rte_StbM_Types.h文件生成 Generation of Rte_StbM_Types.h File¶
请参考《ORIENTAIS Configurator for EasyXMen V25.10 使用指南.pdf》的3.6.3章节服务封装使用步骤内容。
Please refer to the content of the service encapsulation usage steps in Chapter 3.6.3 of “ORIENTAIS Configurator for EasyXMen V25.10 User Manual .pdf”.