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