ud3tn/include/platform/hal_time.h
Felix Walter 26e91ad69e Remove config.h: Move all definitions to individual headers
This moves all definitions from config.h to individual header files and
makes them configurable (i.e., does not define when already defined).

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-09-29 14:43:21 +02:00

49 lines
1.2 KiB
C

// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
/*
* hal_time.h
*
* Description: contains the definitions of the hardware abstraction
* layer interface for semaphore-related functionality
*
*/
#ifndef HAL_TIME_H_INCLUDED
#define HAL_TIME_H_INCLUDED
#include <stdint.h>
// 01/01/2000 00:00:00 UTC
#define DTN_TIMESTAMP_OFFSET 946684800
/**
* @brief hal_time_get_timestamp_s Provides information about the current time
* @return The current time in seconds
*/
uint64_t hal_time_get_timestamp_s(void);
/**
* @brief hal_time_get_timestamp_ms Provides information about the current time
* @return The current time in milliseconds
*/
uint64_t hal_time_get_timestamp_ms(void);
/**
* @brief hal_time_get_timestamp_us Provides information about the current time
* @return The current time in microseconds
*/
uint64_t hal_time_get_timestamp_us(void);
/**
* @brief hal_time_get_system_time Provides the absolute system time (e.g.
* uptime)
* @return The uptime in microseconds
*/
uint64_t hal_time_get_system_time(void);
/**
* @brief hal_time_print_log_time_string Print the system time via hal_io as
* human-readable C-string.
*/
void hal_time_print_log_time_string(void);
#endif /* HAL_TIME_H_INCLUDED */