1# Copyright (c) 2021 Basalte bv
2# SPDX-License-Identifier: Apache-2.0
3
4config ZEPHYR_NANOPB_MODULE
5	bool
6
7menuconfig NANOPB
8	bool "Nanopb Support"
9	# Nanopb requires c_std_11 compiler features like _Static_assert
10	select REQUIRES_STD_C11
11	help
12	  This option enables the Nanopb library and generator.
13
14if NANOPB
15
16config NANOPB_ENABLE_MALLOC
17	bool "Malloc usage"
18	help
19	  This option enables dynamic allocation support in the decoder.
20
21config NANOPB_MAX_REQUIRED_FIELDS
22	int "Max number of required fields"
23	default 64
24	help
25	  Maximum number of proto2 required fields to check for presence.
26	  Default and minimum value is 64.
27
28config NANOPB_NO_ERRMSG
29	bool "Disable error messages"
30	help
31	  Disable error message support to save code size. Only error
32	  information is the true/false return value.
33
34config NANOPB_BUFFER_ONLY
35	bool "Buffers only"
36	help
37	  Disable support for custom streams. Only supports encoding and
38	  decoding with memory buffers. Speeds up execution and slightly
39	  decreases code size.
40
41config NANOPB_WITHOUT_64BIT
42	bool "Disable 64-bit integer fields"
43	help
44	  Disable support of 64-bit integer fields, for old compilers or
45	  for a slight speedup on 8-bit platforms.
46
47config NANOPB_ENCODE_ARRAYS_UNPACKED
48	bool "Encode arrays unpacked"
49	help
50	  Encode scalar arrays in the unpacked format, which takes up more
51	  space.
52	  Only to be used when the decoder on the receiving side cannot
53	  process packed arrays, such as protobuf.js versions before 2020.
54
55config NANOPB_VALIDATE_UTF8
56	bool "Validate UTF-8"
57	help
58	  Check whether incoming strings are valid UTF-8 sequences.
59	  Adds a small performance and code size penalty.
60
61endif # NANOPB
62