Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
#ifndef ARC_STD_TIME_H_
#define ARC_STD_TIME_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <time.h>
/**
* @brief the ARC_Time data structre based on time.h (mainly added to avoid having to type `struct tm` every time)
*
* seconds == tm_sec [0,60]
* minutes == tm_min [0,59]
* hour == tm_hour [0,23]
*
* day == tm_yday Day of year [0,365]
* month == tm_mon Month of year [0,11]
* year == tm_year Years since 1900
*
* dayOfWeek == tm_wday Day of week [0,6] (Sunday =0)
* dayOfMonth == tm_mday Day of month [1,31]
*
* daylightSavingsFlag == tm_isdst Daylight Savings flag
*/
typedef struct ARC_Time {
uint8_t seconds;
uint8_t minutes;
uint8_t hour;
uint32_t day;
uint8_t month;
uint32_t year;
uint8_t dayOfWeek;
uint8_t dayOfMonth;
uint8_t daylightSavingsFlag;
} ARC_Time;
/**
* @brief copies the contents of a tm struct pointer into the ARC_Time type
*
* @param time the struct tm type to copy
*
* @return the contents of a struct tm as an ARC_Time
*/
ARC_Time ARC_Time_CopyFromStructTmPtr(struct tm *time);
#ifdef __cplusplus
}
#endif
#endif // !ARC_STD_TIME_H_
ARC_Time
the ARC_Time data structre based on time.h (mainly added to avoid having to type struct tm every time...
Definition time.h:27
ARC_Time::year
uint32_t year
Definition time.h:34
ARC_Time::month
uint8_t month
Definition time.h:33
ARC_Time::day
uint32_t day
Definition time.h:32
ARC_Time::dayOfWeek
uint8_t dayOfWeek
Definition time.h:36
ARC_Time::dayOfMonth
uint8_t dayOfMonth
Definition time.h:37
ARC_Time::seconds
uint8_t seconds
Definition time.h:28
ARC_Time::minutes
uint8_t minutes
Definition time.h:29
ARC_Time::hour
uint8_t hour
Definition time.h:30
ARC_Time::daylightSavingsFlag
uint8_t daylightSavingsFlag
Definition time.h:39
time.h
ARC_Time_CopyFromStructTmPtr
ARC_Time ARC_Time_CopyFromStructTmPtr(struct tm *time)
copies the contents of a tm struct pointer into the ARC_Time type
ARC_Time
struct ARC_Time ARC_Time
the ARC_Time data structre based on time.h (mainly added to avoid having to type struct tm every time...