Solaris Software
Toggle main menu visibility
Loading...
Searching...
No Matches
time.c
Go to the documentation of this file.
1
/**
2
* @file time.c
3
* @brief HAL time functions implementation. Dispatches through the registered HAL port.
4
*/
5
6
/* ----------------------------------------------------------------
7
* INCLUDES
8
* ---------------------------------------------------------------- */
9
#include "
spp/hal/hal.h
"
10
#include "
spp/hal/time/time.h
"
11
12
/* ----------------------------------------------------------------
13
* PUBLIC FUNCTIONS
14
* ---------------------------------------------------------------- */
15
spp_uint32_t
SPP_HAL_TIME_getTimeMs
(
void
)
16
{
17
const
SPP_HalPort_t
*p_port =
SPP_HAL_getPort
();
18
if
((p_port == NULL) || (p_port->
time
.
getTimeMs
== NULL))
19
{
20
return
0U;
21
}
22
return
p_port->
time
.
getTimeMs
();
23
}
24
25
spp_uint32_t
SPP_HAL_TIME_getTimeUs
(
void
)
26
{
27
const
SPP_HalPort_t
*p_port =
SPP_HAL_getPort
();
28
if
((p_port == NULL) || (p_port->
time
.
getTimeUs
== NULL))
29
{
30
return
0U;
31
}
32
return
p_port->
time
.
getTimeUs
();
33
}
34
35
void
SPP_HAL_TIME_delayMs
(
spp_uint32_t
ms)
36
{
37
const
SPP_HalPort_t
*p_port =
SPP_HAL_getPort
();
38
if
((p_port != NULL) && (p_port->
time
.
delayMs
!= NULL))
39
{
40
p_port->
time
.
delayMs
(ms);
41
}
42
}
SPP_HAL_getPort
const SPP_HalPort_t * SPP_HAL_getPort(void)
Returns the registered HAL port.
Definition
hal.c:52
hal.h
This file contains the structs that contain all the pointers to the functions that are used by the SP...
SPP_HALTime_t::getTimeUs
spp_uint32_t(*) getTimeUs(void)
Return the current hardware time in microseconds.
Definition
hal.h:216
SPP_HALTime_t::getTimeMs
spp_uint32_t(*) getTimeMs(void)
Return the current hardware time in milliseconds.
Definition
hal.h:207
SPP_HALTime_t::delayMs
void(*) delayMs(spp_uint32_t ms)
Block for the requested number of milliseconds.
Definition
hal.h:226
SPP_HalPort_t
Ports struct that contains all the pointers to the Ports functions.
Definition
hal.h:234
SPP_HalPort_t::time
SPP_HALTime_t time
Definition
hal.h:238
SPP_HAL_TIME_getTimeMs
spp_uint32_t SPP_HAL_TIME_getTimeMs(void)
Return the current hardware time in milliseconds.
Definition
time.c:15
SPP_HAL_TIME_getTimeUs
spp_uint32_t SPP_HAL_TIME_getTimeUs(void)
Return the current hardware time in microseconds.
Definition
time.c:25
SPP_HAL_TIME_delayMs
void SPP_HAL_TIME_delayMs(spp_uint32_t ms)
Block for the requested number of milliseconds.
Definition
time.c:35
time.h
SPP HAL time API — dispatches through the registered HAL port.
spp_uint32_t
uint32_t spp_uint32_t
Definition
types.h:31
solaris-v2
spp
hal
time
time.c
Generated by
1.18.0