38 return lifecycle_status;
48 if ((storage == NULL) || (config == NULL) || (out_handle == NULL))
65 return lifecycle_status;
132 if (out_now_ms == NULL)
sapi_status_t sapi_lifecycle_check_setup_allowed(void)
Convenience check for a setup-only constructor: call this as one of the first checks in any function ...
sapi_status_t
Common result/status codes.
@ SAPI_STATUS_NOT_SUPPORTED
@ SAPI_STATUS_INVALID_PARAM
@ SAPI_STATUS_NOT_INITIALIZED
sapi_status_t sapi_timer_register_backend(const sapi_timer_backend_t *backend)
Registers the backend implementation used by every sapi_timer_* call. This is how an integrator suppl...
sapi_status_t sapi_timer_start(sapi_timer_handle_t handle)
Starts (or restarts) a created timer.
sapi_status_t sapi_timer_stop(sapi_timer_handle_t handle)
Stops a running timer; safe to call on an already-stopped timer.
sapi_status_t sapi_timer_destroy(sapi_timer_handle_t handle)
Destroys a timer, releasing any backend resources bound to it.
struct sapi_timer_impl_s * sapi_timer_handle_t
sapi_status_t sapi_timer_now(sapi_timestamp_ms_t *out_now_ms)
Returns the current monotonic time base used by all timers.
sapi_status_t sapi_timer_create(sapi_timer_storage_t *storage, const sapi_timer_config_t *config, sapi_timer_handle_t *out_handle)
Creates a timer bound to caller-owned storage. Does not start it.
uint64_t sapi_timestamp_ms_t
static const sapi_clocksync_backend_t * s_backend
Process-wide application setup-phase lock (ADR-026).
OS Abstraction Layer - Timer service.
OS-backend adaptation surface for the Timer service (ADR-005, ADR-021).
Backend vtable: an integrator's implementation of the timer service for a specific OS/RTOS/BSP target...
sapi_status_t(*) destroy(sapi_timer_handle_t handle)
Backend implementation of sapi_timer_destroy(). May be NULL.
sapi_status_t(*) stop(sapi_timer_handle_t handle)
Backend implementation of sapi_timer_stop(). May be NULL.
sapi_status_t(*) now(sapi_timestamp_ms_t *out_now_ms)
Backend implementation of sapi_timer_now(). May be NULL.
sapi_status_t(*) start(sapi_timer_handle_t handle)
Backend implementation of sapi_timer_start(). May be NULL.
sapi_status_t(*) create(sapi_timer_storage_t *storage, const sapi_timer_config_t *config, sapi_timer_handle_t *out_handle)
Backend implementation of sapi_timer_create(). May be NULL.
Configuration for sapi_timer_create().
sapi_timer_callback_t callback
sapi_duration_ms_t period_ms