eLooM for STM32 application  v3.3.0
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
SysTimestamp.h File Reference

Timestamp service. More...

#include "drivers/HwTSDriver.h"
#include "drivers/HwTSDriver_vtbl.h"
#include "drivers/SwTSDriver.h"
#include "drivers/SwTSDriver_vtbl.h"
+ Include dependency graph for SysTimestamp.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _SysTimestamp
 

Typedefs

typedef struct _SysTimestamp SysTimestamp_t
 

Functions

sys_error_code_t SysTsStart (SysTimestamp_t *_this, bool bReset)
 
sys_error_code_t SysTsStop (SysTimestamp_t *_this)
 
double SysTsGetTimestampF (SysTimestamp_t *_this)
 
uint64_t SysTsGetTimestampN (SysTimestamp_t *_this)
 
SysTimestamp_tSysGetTimestampSrv (void)
 

Detailed Description

Timestamp service.

Author
STMicroelectronics - AIS - MCD Team
Version
4.0.0
Date
Mar 15, 2022

The framework timestamp service provides an efficient way to get a common timestamp across the whole application. The service is configured with three parameter in the global sysgonfig.h file:

When the service is not enabled, it does not increase the memory footprint of eLooM. The timestamp service can use a software driver base on the RTOS tick or a dedicated hardware timer as showed in the class diagram in Fig.1

Fig.1 - SysTimestampSRV class diagram

Valid value are for SYS_TS_CFG_TSDRIVER_PARAMS are:

Attention

Copyright (c) 2022 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Typedef Documentation

◆ SysTimestamp_t

typedef struct _SysTimestamp SysTimestamp_t

Create type name for _SysTimestamp.

Function Documentation

◆ SysGetTimestampSrv()

SysTimestamp_t * SysGetTimestampSrv ( void  )

Get an instance of the system timestamp service.

Returns
an instance of the system timestamp service.

◆ SysTsGetTimestampF()

double SysTsGetTimestampF ( SysTimestamp_t _this)

Get the system timestamp in seconds. If the service was not started then the value is undefined. It can be used also form an ISR.

Parameters
_this[IN] specifies a system timestamp object.
Returns
the value of the system timestamp in seconds.

◆ SysTsGetTimestampN()

uint64_t SysTsGetTimestampN ( SysTimestamp_t _this)

Get the system timestamp in ??tick??. If the service was not started then the value is undefined. It can be used also form an ISR.

Parameters
_this[IN] specifies a system timestamp object.
Returns
the value of the system timestamp in ??tick??.

◆ SysTsStart()

sys_error_code_t SysTsStart ( SysTimestamp_t _this,
bool  bReset 
)

Public API declaration Start the system timestamp service. The service must be started before getting the timestamp value. If the service is not started the value returned by SysTsGetTimestampF() and SysTsGetTimestampN() is undefined. It is possible to reset the timestamp counter to zero by using the bReset parameter.

Parameters
_this[IN] specifies a system timestamp object.
bReset[IN] if true the timestamp counter is reset to zero.
Returns
SYS_NO_ERROR_CODE if success, SYS_TS_SERVICE_ISSUE_ERROR_CODE otherwise

◆ SysTsStop()

sys_error_code_t SysTsStop ( SysTimestamp_t _this)

Stop the system timestamp service. When the service is stopped the value of the timestamp counter is frozen.

Parameters
_this[IN] specifies a system timestamp object.
Returns
SYS_NO_ERROR_CODE if success, SYS_TS_SERVICE_ISSUE_ERROR_CODE otherwise