ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
Loading...
Searching...
No Matches
time.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#include <libtock-sync/peripherals/rtc.h>
8#include <stdint.h>
9
22uint32_t epoch(void);
23
31void set_epoch(uint32_t epoch);
32
40uint32_t rtc_date_to_epoch(const libtock_rtc_date_t* date);
41
48void epoch_to_rtc_date(uint32_t epoch, libtock_rtc_date_t* date);
49
52#ifdef __cplusplus
53}
54#endif
void set_epoch(uint32_t epoch)
Sets the current unix epoch timestamp.
Definition time.c:25
uint32_t epoch(void)
Gets the current unix epoch timestamp.
Definition time.c:19
uint32_t rtc_date_to_epoch(const libtock_rtc_date_t *date)
Converts tock time to unix epoch time.
Definition time.c:31
void epoch_to_rtc_date(uint32_t epoch, libtock_rtc_date_t *date)
Convert unix epoch to tock time.
Definition time.c:65