mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-13 12:33:27 +02:00
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>
49 lines
1.2 KiB
C
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 */
|