Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_timer.h
Go to the documentation of this file.
1
17#ifndef RTE_OS_TIMER_H
18#define RTE_OS_TIMER_H
19
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
28RTE_DECLARE_STORAGE(rte_timer_storage_t, 64U);
29
31typedef struct rte_timer_impl_s *rte_timer_handle_t;
32
34typedef enum rte_timer_mode_e
35{
39
49typedef void (*rte_timer_callback_t)(rte_timer_handle_t handle, void *user_ctx);
50
59
73rte_status_t rte_timer_create(rte_timer_storage_t *storage,
74 const rte_timer_config_t *config,
75 rte_timer_handle_t *out_handle);
76
85
93
101
111
112/*
113 * The OSAdapter vtable (rte_osadapter_timer_t) and rte_osadapter_timer_register()
114 * live in rte_osadapter/timer/rte_osadapter_timer.h, not here (ADR-021).
115 * This header is the consumer-facing surface only - a real application
116 * never needs to see the OSAdapter vtable shape; only the platform
117 * integrator wiring a concrete OSAdapter does.
118 */
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif /* RTE_OS_TIMER_H */
125 /* TIMER */
rte_status_t
Common result/status codes.
Definition rte_status.h:27
rte_status_t rte_timer_now(rte_timestamp_ms_t *out_now_ms)
Returns the current monotonic time base used by all timers.
Definition rte_timer.c:139
rte_status_t rte_timer_stop(rte_timer_handle_t handle)
Stops a running timer; safe to call on an already-stopped timer.
Definition rte_timer.c:105
rte_status_t rte_timer_start(rte_timer_handle_t handle)
Starts (or restarts) a created timer.
Definition rte_timer.c:79
struct rte_timer_impl_s * rte_timer_handle_t
Definition rte_timer.h:31
rte_timer_mode_t
Whether a timer fires once or repeatedly every period_ms.
Definition rte_timer.h:35
rte_status_t rte_timer_create(rte_timer_storage_t *storage, const rte_timer_config_t *config, rte_timer_handle_t *out_handle)
Creates a timer bound to caller-owned storage. Does not start it.
Definition rte_timer.c:44
rte_status_t rte_timer_destroy(rte_timer_handle_t handle)
Destroys a timer, releasing any OSAdapter resources bound to it.
Definition rte_timer.c:122
void(*) rte_timer_callback_t(rte_timer_handle_t handle, void *user_ctx)
Signature for a timer expiry callback.
Definition rte_timer.h:49
@ RTE_TIMER_MODE_PERIODIC
Definition rte_timer.h:37
@ RTE_TIMER_MODE_ONE_SHOT
Definition rte_timer.h:36
#define RTE_DECLARE_STORAGE(type_name, byte_size)
Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout...
Definition rte_types.h:69
uint32_t rte_duration_ms_t
Definition rte_types.h:27
uint64_t rte_timestamp_ms_t
Definition rte_types.h:30
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
Configuration for rte_timer_create().
Definition rte_timer.h:53
rte_timer_callback_t callback
Definition rte_timer.h:56
rte_timer_mode_t mode
Definition rte_timer.h:54
rte_duration_ms_t period_ms
Definition rte_timer.h:55