Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
cpu_load.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024, Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_DEBUG_CPU_LOAD_H_
8
#define ZEPHYR_INCLUDE_DEBUG_CPU_LOAD_H_
9
10
#include <
stdbool.h
>
11
#include <
stdint.h
>
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
24
26
void
cpu_load_on_enter_idle
(
void
);
27
29
void
cpu_load_on_exit_idle
(
void
);
30
42
int
cpu_load_get
(
bool
reset);
43
50
void
cpu_load_log_control
(
bool
enable);
51
52
/* Optional callback for cpu_load_cb_reg
53
*
54
* This will be called from the k_timer expiry_fn used for periodic logging.
55
* CONFIG_CPU_LOAD_LOG_PERIODICALLY must be configured to a positive value.
56
* Time spent in this callback must be kept to a minimum.
57
*/
58
typedef
void (*
cpu_load_cb_t
)(
uint8_t
percent);
59
69
int
cpu_load_cb_reg
(
cpu_load_cb_t
cb,
uint8_t
threshold_percent);
70
74
75
#ifdef __cplusplus
76
}
77
#endif
78
79
80
#endif
/* ZEPHYR_INCLUDE_DEBUG_CPU_LOAD_H_ */
cpu_load_on_enter_idle
void cpu_load_on_enter_idle(void)
Hook called by the application specific hook on entering CPU idle.
cpu_load_cb_t
void(* cpu_load_cb_t)(uint8_t percent)
Definition
cpu_load.h:58
cpu_load_on_exit_idle
void cpu_load_on_exit_idle(void)
Hook called by the application specific hook on exiting CPU idle.
cpu_load_log_control
void cpu_load_log_control(bool enable)
Control periodic CPU statistics report.
cpu_load_cb_reg
int cpu_load_cb_reg(cpu_load_cb_t cb, uint8_t threshold_percent)
Optional registration of callback when load is greater or equal to the threshold.
cpu_load_get
int cpu_load_get(bool reset)
Get CPU load.
stdbool.h
stdint.h
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
zephyr
debug
cpu_load.h
Generated on
for Zephyr API by
1.17.0