ErrorLib 1.0.8-master SHA: 810228da25
timestamp.h File Reference

Definition of timestamp data-structs. More...

#include <stdbool.h>
#include <stdint.h>
#include "cmsis_compiler.h"

Go to the source code of this file.

Data Structures

struct  Type_Timestamp
 Definition of a timestamp type. More...
 
struct  Type_DateTime
 

Functions

Type_Timestamp getTimestamp (void)
 
uint32_t DateTimeToUtc (Type_DateTime tDateTime)
 Converts structured UTC to seconds that have elapsed since January 1, 2020. More...
 
Type_DateTime UtcToDateTime (uint32_t UnixTime)
 Converts seconds that have elapsed since January 1, 2020 to structured UTC. More...
 
static __INLINE bool TimestampOlder (Type_Timestamp tTimestamp1, Type_Timestamp tTimestamp2)
 This functions compares two Type_Timestamp. More...
 
static __INLINE Type_Timestamp TimestampDifference (Type_Timestamp tTimestamp1, Type_Timestamp tTimestamp2)
 This functions subtract two Type_Timestamp. More...
 

Detailed Description

Definition of timestamp data-structs.


© Copyright 2017-2022 Copyright: Retostronik GmbH Stütingstraße 30 58285 Gevelsberg

Function Documentation

◆ DateTimeToUtc()

uint32_t DateTimeToUtc ( Type_DateTime  tDateTime)

Converts structured UTC to seconds that have elapsed since January 1, 2020.

Parameters
tDateTimeYear [2020..2088], month [1..12], day [1..31], hour [0..23], minute [0..59], second [0..59]
Returns
seconds since January 1, 2020.

◆ getTimestamp()

Type_Timestamp getTimestamp ( void  )

◆ TimestampDifference()

static __INLINE Type_Timestamp TimestampDifference ( Type_Timestamp  tTimestamp1,
Type_Timestamp  tTimestamp2 
)
static

This functions subtract two Type_Timestamp.

Parameters
tTimestamp1first time stamp
tTimestamp2second time stamp
Return values
tTimestamp1- tTimestamp2

◆ TimestampOlder()

static __INLINE bool TimestampOlder ( Type_Timestamp  tTimestamp1,
Type_Timestamp  tTimestamp2 
)
static

This functions compares two Type_Timestamp.

Parameters
tTimestamp1first time stamp to compare
tTimestamp2second time stamp to compare
Return values
trueif tTimestamp1 is older than tTimestamp2, false if equal or newer

◆ UtcToDateTime()

Type_DateTime UtcToDateTime ( uint32_t  TimeStamp)

Converts seconds that have elapsed since January 1, 2020 to structured UTC.

Parameters
TimeStampseconds since January 1, 2020
Returns
Structured Timestamp