2022-07-30 23:40:36 -03:00
|
|
|
|
# Copyright (c) 2022 Rodrigo Peixoto <rodrigopex@gmail.com>
|
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
|
|
menuconfig ZBUS
|
|
|
|
|
bool "Zbus support"
|
2023-11-22 15:40:15 +01:00
|
|
|
|
depends on MULTITHREADING
|
2022-07-30 23:40:36 -03:00
|
|
|
|
help
|
|
|
|
|
Enables support for Zephyr message bus.
|
|
|
|
|
|
|
|
|
|
if ZBUS
|
|
|
|
|
|
2025-04-19 09:56:50 -03:00
|
|
|
|
config ZBUS_PREFER_DYNAMIC_ALLOCATION
|
|
|
|
|
bool "Set zbus to work with dynamic allocation using the system heap"
|
|
|
|
|
default y
|
|
|
|
|
|
2023-07-22 12:55:48 -03:00
|
|
|
|
config ZBUS_CHANNELS_SYS_INIT_PRIORITY
|
|
|
|
|
default 5
|
|
|
|
|
int "The priority used during the SYS_INIT procedure."
|
2022-07-30 23:40:36 -03:00
|
|
|
|
|
|
|
|
|
config ZBUS_CHANNEL_NAME
|
|
|
|
|
bool "Channel name field"
|
|
|
|
|
|
2024-07-05 20:15:13 +10:00
|
|
|
|
config ZBUS_CHANNEL_ID
|
|
|
|
|
bool "Channel identifier field"
|
|
|
|
|
|
2022-07-30 23:40:36 -03:00
|
|
|
|
config ZBUS_OBSERVER_NAME
|
|
|
|
|
bool "Observer name field"
|
|
|
|
|
|
2024-07-08 14:38:47 +10:00
|
|
|
|
config ZBUS_CHANNEL_PUBLISH_STATS
|
|
|
|
|
bool "Channel publishing statistics (Timestamp and count)"
|
|
|
|
|
|
2023-09-02 13:35:14 -03:00
|
|
|
|
config ZBUS_MSG_SUBSCRIBER
|
|
|
|
|
select NET_BUF
|
|
|
|
|
bool "Message subscribers will receive all messages in sequence."
|
|
|
|
|
|
|
|
|
|
if ZBUS_MSG_SUBSCRIBER
|
|
|
|
|
|
2023-11-22 20:03:30 +01:00
|
|
|
|
choice ZBUS_MSG_SUBSCRIBER_BUF_ALLOC
|
2023-09-02 13:35:14 -03:00
|
|
|
|
prompt "ZBus msg_subscribers buffer allocation"
|
2025-04-19 09:56:50 -03:00
|
|
|
|
default ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC if ZBUS_PREFER_DYNAMIC_ALLOCATION
|
|
|
|
|
default ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
|
2023-09-02 13:35:14 -03:00
|
|
|
|
|
2023-11-22 20:03:30 +01:00
|
|
|
|
config ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC
|
2023-09-02 13:35:14 -03:00
|
|
|
|
bool "Use heap to allocate msg_subscriber buffers data"
|
|
|
|
|
|
2023-11-22 20:03:30 +01:00
|
|
|
|
config ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
|
2023-09-02 13:35:14 -03:00
|
|
|
|
bool "Use fixed data size for msg_subscriber buffers pool"
|
|
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
2024-06-06 15:22:09 -03:00
|
|
|
|
config ZBUS_MSG_SUBSCRIBER_NET_BUF_POOL_ISOLATION
|
|
|
|
|
default n
|
|
|
|
|
bool "Use isolated pools instead of only using the global pool."
|
|
|
|
|
|
2023-09-02 13:35:14 -03:00
|
|
|
|
config ZBUS_MSG_SUBSCRIBER_NET_BUF_POOL_SIZE
|
|
|
|
|
default 16
|
|
|
|
|
int "The count of net_buf available to be used simutaneously."
|
|
|
|
|
|
2023-11-22 20:03:30 +01:00
|
|
|
|
if ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
|
2023-09-02 13:35:14 -03:00
|
|
|
|
|
|
|
|
|
config ZBUS_MSG_SUBSCRIBER_NET_BUF_STATIC_DATA_SIZE
|
|
|
|
|
int "The size of the biggest message used with ZBus."
|
|
|
|
|
|
2023-11-22 20:03:30 +01:00
|
|
|
|
endif # ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_STATIC
|
2023-09-02 13:35:14 -03:00
|
|
|
|
|
|
|
|
|
endif # ZBUS_MSG_SUBSCRIBER
|
|
|
|
|
|
2023-07-22 12:55:48 -03:00
|
|
|
|
config ZBUS_RUNTIME_OBSERVERS
|
|
|
|
|
bool "Runtime observers support."
|
2022-07-30 23:40:36 -03:00
|
|
|
|
|
2025-04-19 09:56:50 -03:00
|
|
|
|
if ZBUS_RUNTIME_OBSERVERS
|
|
|
|
|
|
|
|
|
|
choice ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC
|
|
|
|
|
prompt "ZBus runtime observers node allocation"
|
|
|
|
|
default ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_DYNAMIC if ZBUS_PREFER_DYNAMIC_ALLOCATION
|
|
|
|
|
default ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_STATIC
|
|
|
|
|
|
|
|
|
|
config ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_DYNAMIC
|
|
|
|
|
bool "Use heap to allocate runtime observers node"
|
|
|
|
|
|
|
|
|
|
config ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_STATIC
|
|
|
|
|
bool "Use a pool of runtime observers nodes"
|
|
|
|
|
|
|
|
|
|
config ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_NONE
|
|
|
|
|
bool "Use user-provided runtime observers nodes"
|
|
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
|
|
config ZBUS_RUNTIME_OBSERVERS_NODE_POOL_SIZE
|
|
|
|
|
int "Runtime observer pool size"
|
|
|
|
|
depends on ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_STATIC
|
|
|
|
|
default 8
|
|
|
|
|
|
|
|
|
|
endif # ZBUS_RUNTIME_OBSERVERS
|
|
|
|
|
|
2023-09-05 12:48:55 -03:00
|
|
|
|
config ZBUS_PRIORITY_BOOST
|
|
|
|
|
bool "ZBus priority boost algorithm"
|
|
|
|
|
default y
|
|
|
|
|
help
|
|
|
|
|
ZBus implements the Highest Locker Protocol that relies on the observers’ thread priority
|
|
|
|
|
to determine a temporary publisher priority.
|
|
|
|
|
|
2022-07-30 23:40:36 -03:00
|
|
|
|
config ZBUS_ASSERT_MOCK
|
|
|
|
|
bool "Zbus assert mock for test purposes."
|
|
|
|
|
help
|
|
|
|
|
This configuration enables the developer to change the _ZBUS_ASSERT behavior. When this configuration is
|
|
|
|
|
enabled, _ZBUS_ASSERT returns -EFAULT instead of assert. It makes it more straightforward to test invalid
|
|
|
|
|
parameters.
|
|
|
|
|
|
|
|
|
|
|
2024-08-27 08:21:16 -03:00
|
|
|
|
config HEAP_MEM_POOL_ADD_SIZE_ZBUS
|
|
|
|
|
int
|
2025-04-19 09:56:50 -03:00
|
|
|
|
default 2048 if ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC && !ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_DYNAMIC
|
|
|
|
|
default 1024 if !ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC && ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_DYNAMIC
|
|
|
|
|
default 3072 if ZBUS_MSG_SUBSCRIBER_BUF_ALLOC_DYNAMIC && ZBUS_RUNTIME_OBSERVERS_NODE_ALLOC_DYNAMIC
|
2024-08-27 08:21:16 -03:00
|
|
|
|
|
|
|
|
|
|
2022-07-30 23:40:36 -03:00
|
|
|
|
module = ZBUS
|
|
|
|
|
module-str = zbus
|
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
|
|
|
|
|
|
|
|
endif # ZBUS
|