libmetal
Loading...
Searching...
No Matches
lib
system
zephyr
sys.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved.
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
7
/*
8
* @file zephyr/sys.h
9
* @brief Zephyr system primitives for libmetal.
10
*/
11
12
#ifndef __METAL_SYS__H__
13
#error "Include metal/sys.h instead of metal/zephyr/sys.h"
14
#endif
15
16
#ifndef __METAL_ZEPHYR_SYS__H__
17
#define __METAL_ZEPHYR_SYS__H__
18
19
#include <metal/cpu.h>
20
#include <stdlib.h>
21
#include <zephyr/kernel.h>
22
23
#include "
log.h
"
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
29
#define metal_yield() metal_cpu_yield()
30
31
#define METAL_INIT_DEFAULTS \
32
{ \
33
.log_handler = metal_zephyr_log_handler, \
34
.log_level = METAL_LOG_INFO, \
35
}
36
37
#ifndef METAL_MAX_DEVICE_REGIONS
38
#define METAL_MAX_DEVICE_REGIONS 1
39
#endif
40
42
struct
metal_state
{
43
45
struct
metal_common_state
common
;
46
};
47
48
static
inline
void
metal_wait_usec
(uint32_t usec_to_wait)
49
{
50
k_busy_wait(usec_to_wait);
51
}
52
53
#ifdef __cplusplus
54
}
55
#endif
56
57
#endif
/* __METAL_ZEPHYR_SYS__H__ */
metal_common_state
Definition
sys.h:63
metal_state
Definition
sys.h:35
metal_state::common
struct metal_common_state common
Definition
sys.h:38
log.h
metal_wait_usec
static void metal_wait_usec(uint32_t usec_to_wait)
Definition
sys.h:48
Generated on
for libmetal by
1.15.0