reactor-uc
0.1
Loading...
Searching...
No Matches
platform.h
Go to the documentation of this file.
1
#ifndef REACTOR_UC_PLATFORM_H
2
#define REACTOR_UC_PLATFORM_H
3
4
#include "reactor-uc/error.h"
5
#include "reactor-uc/tag.h"
6
#include <stdarg.h>
7
8
typedef
struct
Platform
Platform
;
9
10
struct
Platform
{
15
lf_ret_t (*
initialize
)(
Platform
*self);
19
instant_t (*
get_physical_time
)(
Platform
*self);
24
lf_ret_t (*
wait_until
)(
Platform
*self, instant_t wakeup_time);
29
lf_ret_t (*
wait_for
)(
Platform
*self, interval_t duration);
34
lf_ret_t (*
wait_until_interruptible
)(
Platform
*self, instant_t wakeup_time);
35
40
void (*
new_async_event
)(
Platform
*self);
41
47
void (*
enter_critical_section
)(
Platform
*self);
48
void (*
leave_critical_section
)(
Platform
*self);
49
};
50
51
// Return a pointer to a Platform object. Must be implemented for each
52
// target platform.
53
Platform
*
Platform_new
(
void
);
54
55
// Construct a Platform object. Must be implemented for each target platform.
56
void
Platform_ctor
(
Platform
*self);
57
58
// Allow each platform to provide its own implemntation for printing.
59
void
Platform_vprintf
(
const
char
*fmt, va_list args);
60
61
#endif
Platform_new
Platform * Platform_new(void)
Platform_vprintf
void Platform_vprintf(const char *fmt, va_list args)
Platform_ctor
void Platform_ctor(Platform *self)
Platform
Definition
platform.h:10
Platform::initialize
lf_ret_t(* initialize)(Platform *self)
Perform any platform initialization such as initializing semaphores, configuring clocks,...
Definition
platform.h:15
Platform::leave_critical_section
void(* leave_critical_section)(Platform *self)
Definition
platform.h:48
Platform::wait_until
lf_ret_t(* wait_until)(Platform *self, instant_t wakeup_time)
Put system to sleep until the wakeup time.
Definition
platform.h:24
Platform::wait_for
lf_ret_t(* wait_for)(Platform *self, interval_t duration)
Put system to sleep until the wakeup time.
Definition
platform.h:29
Platform::enter_critical_section
void(* enter_critical_section)(Platform *self)
Enter and leave a critical section.
Definition
platform.h:47
Platform::wait_until_interruptible
lf_ret_t(* wait_until_interruptible)(Platform *self, instant_t wakeup_time)
Put the system to sleep until the wakeup time or until an asynchronous event occurs.
Definition
platform.h:34
Platform::new_async_event
void(* new_async_event)(Platform *self)
Signal the occurrence of an asynchronous event.
Definition
platform.h:40
Platform::get_physical_time
instant_t(* get_physical_time)(Platform *self)
Return the current physical time in nanoseconds.
Definition
platform.h:19
reactor-uc
platform.h
Generated on Wed Jan 22 2025 07:27:09 for reactor-uc by
1.13.2