modules/woz_port/include/woz_port.h
asxeem/openaliro
Module

woz_port.h

modules/woz_port/include/woz_port.h12 documented symbols

used by aliro_lat.c aliro_reader.c ccc_shim_rx.c uwb_isr.c uwb_min.c woz_alloc.h fira_session.c

API

Fstatic inline void *woz_malloc(size_t size)

modules/woz_port/include/woz_port.h:162

Allocate size bytes.

size
Number of bytes to allocate.
returns
Pointer to allocated memory, or NULL on failure.

Fstatic inline void *woz_calloc(size_t n, size_t size)

modules/woz_port/include/woz_port.h:172

Allocate and zero-initialize n elements of size bytes each.

n
Number of elements.
size
Bytes per element.
returns
Pointer to allocated and zeroed memory, or NULL on failure.

Fstatic inline void woz_free(void *ptr)

modules/woz_port/include/woz_port.h:180

Deallocate memory.

ptr
Pointer to memory to free (may be NULL).

Fstatic inline int64_t woz_uptime_us(void)

modules/woz_port/include/woz_port.h:188

Monotonic microseconds since boot.

returns
Microseconds elapsed since system start.
called by woz_cycle_get_32, woz_uptime_ms

Fstatic inline int64_t woz_uptime_ms(void)

modules/woz_port/include/woz_port.h:199

Monotonic milliseconds since boot.

returns
Milliseconds elapsed since system start.
calls woz_uptime_us

Fstatic inline void woz_sleep_ms(int32_t ms)

modules/woz_port/include/woz_port.h:207

Sleep for a given number of milliseconds (host-test stub).

ms
milliseconds to sleep; ignored in deterministic host tests.

Fstatic inline void woz_sleep_us(int64_t us)

modules/woz_port/include/woz_port.h:215

Sleep for a given number of microseconds (host-test stub).

us
microseconds to sleep; ignored in deterministic host tests.

Fstatic inline uint32_t woz_cycle_get_32(void)

modules/woz_port/include/woz_port.h:223

Retrieve a 32-bit cycle counter with microsecond resolution.

returns
current uptime in microseconds, cast to uint32_t.
calls woz_uptime_us

Ctypedef int woz_mutex_t

modules/woz_port/include/woz_port.h:230

Opaque mutex type for host tests (single-threaded, no-op).

Fstatic inline void woz_mutex_init(woz_mutex_t *m)

modules/woz_port/include/woz_port.h:235

Initialize a mutex (host-test stub).

m
pointer to mutex to initialize; no-op in single-threaded tests.

Fstatic inline void woz_mutex_lock(woz_mutex_t *m)

modules/woz_port/include/woz_port.h:243

Acquire a mutex (host-test stub).

m
pointer to mutex to lock; no-op in single-threaded tests.

Fstatic inline void woz_mutex_unlock(woz_mutex_t *m)

modules/woz_port/include/woz_port.h:251

Release a mutex (host-test stub).

m
pointer to mutex to unlock; no-op in single-threaded tests.