Loading...
Searching...
No Matches
os_time.h File Reference

mynewt-core time abstraction More...

Detailed Description

mynewt-core time abstraction

Author
Francisco Molina franc.nosp@m.ois-.nosp@m.xavie.nosp@m.r.mo.nosp@m.lina@.nosp@m.inri.nosp@m.a.fr

Definition in file os_time.h.

#include "os/os_error.h"
#include "ztimer.h"
+ Include dependency graph for os_time.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OS_TICKS_PER_SEC   (MS_PER_SEC)
 Ticks per seconds, ztimer_msec is used as system timer.
 

Functions

static os_time_t os_time_get (void)
 Returns the low 32 bits of cputime.
 
static os_error_t os_time_ms_to_ticks (uint32_t ms, os_time_t *out_ticks)
 Converts the given number of milliseconds into cputime ticks.
 
static os_error_t os_time_ticks_to_ms (os_time_t ticks, uint32_t *out_ms)
 Convert the given number of ticks into milliseconds.
 
static os_time_t os_time_ms_to_ticks32 (uint32_t ms)
 Converts the given number of milliseconds into cputime ticks.
 
static os_time_t os_time_ticks_to_ms32 (os_time_t ticks)
 Convert the given number of ticks into milliseconds.
 
static void os_time_delay (os_time_t ticks)
 Wait until the number of ticks has elapsed, BLOICKING.
 

Macro Definition Documentation

◆ OS_TICKS_PER_SEC

#define OS_TICKS_PER_SEC   (MS_PER_SEC)

Ticks per seconds, ztimer_msec is used as system timer.

Definition at line 33 of file os_time.h.

Function Documentation

◆ os_time_delay()

static void os_time_delay ( os_time_t  ticks)
inlinestatic

Wait until the number of ticks has elapsed, BLOICKING.

Parameters
[in]ticksThe number of ticks to wait.

Definition at line 102 of file os_time.h.

◆ os_time_get()

static os_time_t os_time_get ( void  )
inlinestatic

Returns the low 32 bits of cputime.

Returns
uint32_t The lower 32 bits of cputime

Definition at line 40 of file os_time.h.

◆ os_time_ms_to_ticks()

static os_error_t os_time_ms_to_ticks ( uint32_t  ms,
os_time_t out_ticks 
)
inlinestatic

Converts the given number of milliseconds into cputime ticks.

Parameters
[in]msThe number of milliseconds to convert to ticks
[out]out_ticksThe number of ticks corresponding to 'ms'
Returns
os_error_t OS_OK - no error

Definition at line 53 of file os_time.h.

◆ os_time_ms_to_ticks32()

static os_time_t os_time_ms_to_ticks32 ( uint32_t  ms)
inlinestatic

Converts the given number of milliseconds into cputime ticks.

Parameters
[in]msThe number of milliseconds to convert to ticks
Returns
uint32_t The number of ticks corresponding to 'ms'

Definition at line 80 of file os_time.h.

◆ os_time_ticks_to_ms()

static os_error_t os_time_ticks_to_ms ( os_time_t  ticks,
uint32_t *  out_ms 
)
inlinestatic

Convert the given number of ticks into milliseconds.

Parameters
[in]ticksThe number of ticks to convert to milliseconds.
[out]out_msThe converted milliseconds from 'ticks'
Returns
os_error_t OS_OK - no error

Definition at line 67 of file os_time.h.

◆ os_time_ticks_to_ms32()

static os_time_t os_time_ticks_to_ms32 ( os_time_t  ticks)
inlinestatic

Convert the given number of ticks into milliseconds.

Parameters
[in]ticksThe number of ticks to convert to milliseconds.
Returns
uint32_t The number of milliseconds corresponding to 'ticks'

Definition at line 92 of file os_time.h.