Zephyr API Documentation
4.2.0-rc3
A Scalable Open Source RTOS
4.2.0-rc3
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
service.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Tomasz Bursztyka.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_SERVICE_H_
8
#define ZEPHYR_INCLUDE_SERVICE_H_
9
10
#include <
zephyr/sys/iterable_sections.h
>
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
25
31
struct
service
{
35
int (*
init
)(void);
36
};
31
struct
service
{
…
};
37
39
48
#define Z_SERVICE_NAME_GET(name) _CONCAT(__service_, name)
49
55
#define Z_SERVICE_INIT(init_fn) \
56
{ \
57
.init = (init_fn) \
58
}
59
66
#define Z_SERVICE_SECTION_NAME(level, prio) \
67
_CONCAT(INIT_LEVEL_ORD(level), _##prio)
68
77
#define Z_SERVICE_DEFINE(name, init_fn, level, prio) \
78
static const \
79
STRUCT_SECTION_ITERABLE_NAMED_ALTERNATE( \
80
service, service, \
81
Z_SERVICE_SECTION_NAME(level, prio), \
82
Z_SERVICE_NAME_GET(name)) = Z_SERVICE_INIT(init_fn)
83
85
87
88
#ifdef __cplusplus
89
}
90
#endif
91
92
#endif
/* ZEPHYR_INCLUDE_SERVICE_H_ */
service
Structure to store service instance.
Definition
service.h:31
service::init
int(* init)(void)
Initialization function.
Definition
service.h:35
iterable_sections.h
zephyr
service.h
Generated on
for Zephyr API Documentation by
1.14.0