1# Copyright (c) 2022 Rodrigo Peixoto <rodrigopex@gmail.com>
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig ZBUS
5	bool "Zbus support"
6	depends on MULTITHREADING
7	help
8	  Enables support for Zephyr message bus.
9
10if ZBUS
11
12config ZBUS_CHANNELS_SYS_INIT_PRIORITY
13	default 5
14	int "The priority used during the SYS_INIT procedure."
15
16config ZBUS_CHANNEL_NAME
17	bool "Channel name field"
18
19config ZBUS_CHANNEL_ID
20	bool "Channel identifier field"
21
22config ZBUS_OBSERVER_NAME
23	bool "Observer name field"
24
25config ZBUS_CHANNEL_PUBLISH_STATS
26	bool "Channel publishing statistics (Timestamp and count)"
27
28config ZBUS_MSG_SUBSCRIBER
29	select NET_BUF
30	bool "Message subscribers will receive all messages in sequence."
31
32if ZBUS_MSG_SUBSCRIBER
33
34choice ZBUS_MSG_SUBSCRIBER_BUF_ALLOC
35	prompt "ZBus msg_subscribers buffer allocation"
36	default ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC
37
38config ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC
39	bool "Use heap to allocate msg_subscriber buffers data"
40
41config ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
42	bool "Use fixed data size for msg_subscriber buffers pool"
43
44endchoice
45
46config ZBUS_MSG_SUBSCRIBER_NET_BUF_POOL_ISOLATION
47	default n
48	bool "Use isolated pools instead of only using the global pool."
49
50config ZBUS_MSG_SUBSCRIBER_NET_BUF_POOL_SIZE
51	default 16
52	int "The count of net_buf available to be used simutaneously."
53
54if ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
55
56config ZBUS_MSG_SUBSCRIBER_NET_BUF_STATIC_DATA_SIZE
57	int "The size of the biggest message used with ZBus."
58
59endif # ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
60
61endif # ZBUS_MSG_SUBSCRIBER
62
63config ZBUS_RUNTIME_OBSERVERS
64	bool "Runtime observers support."
65
66config ZBUS_PRIORITY_BOOST
67	bool "ZBus priority boost algorithm"
68	default y
69	help
70	  ZBus implements the Highest Locker Protocol that relies on the observers’ thread priority
71	  to determine a temporary publisher priority.
72
73config ZBUS_ASSERT_MOCK
74	bool "Zbus assert mock for test purposes."
75	help
76	  This configuration enables the developer to change the _ZBUS_ASSERT behavior. When this configuration is
77	  enabled, _ZBUS_ASSERT returns -EFAULT instead of assert. It makes it more straightforward to test invalid
78	  parameters.
79
80
81config HEAP_MEM_POOL_ADD_SIZE_ZBUS
82	int
83	default 2048 if ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC && !ZBUS_RUNTIME_OBSERVERS
84	default 1024 if !ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC && ZBUS_RUNTIME_OBSERVERS
85	default 3072 if ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC && ZBUS_RUNTIME_OBSERVERS
86
87
88module = ZBUS
89module-str = zbus
90source "subsys/logging/Kconfig.template.log_config"
91
92endif # ZBUS
93