1config IDF_TARGET
2    string
3    default "$IDF_TARGET"
4
5config IDF_TARGET_CHIPA
6    bool
7    default "y" if IDF_TARGET="chipa"
8
9config IDF_TARGET_CHIPB
10    bool
11    default "y" if IDF_TARGET="chipb"
12
13config ALWAYS_VISIBLE
14    bool "Always visible option"
15
16choice ALWAYS_VISIBLE_CHOICE
17    prompt "Always visible choice"
18    default ALWAYS_VISIBLE_CHOICE_OP1
19
20    config ALWAYS_VISIBLE_CHOICE_OP1
21        bool "op1"
22
23    config ALWAYS_VISIBLE_CHOICE_OP2
24        bool "op2"
25endchoice
26
27config CONFIG_FOR_CHIPA
28    bool "Config for chip A"
29    depends on IDF_TARGET_CHIPA
30    default n
31
32config CONFIG_FOR_CHIPB
33    bool "Config for chip B"
34    depends on IDF_TARGET_CHIPB
35
36choice CHOICE_FOR_CHIPA
37    prompt "Always visible choice"
38    default CHOICE_FOR_CHIPA_OP1
39    depends on IDF_TARGET_CHIPA
40
41    config CHOICE_FOR_CHIPA_OP1
42        bool "op1"
43
44    config CHOICE_FOR_CHIPA_OP2
45        bool "op2"
46endchoice
47
48choice CHOICE_FOR_CHIPB
49    prompt "Always visible choice"
50    default CHOICE_FOR_CHIPB_OP1
51    depends on IDF_TARGET_CHIPB
52
53    config CHOICE_FOR_CHIPB_OP1
54        bool "op1"
55
56    config CHOICE_FOR_CHIPB_OP2
57        bool "op2"
58endchoice
59
60source "Kconfig.chipa"
61source "Kconfig.chipb"
62
63config DEEP_DEPENDENT_CONFIG
64    bool "Config depends on another config with default no value"
65    depends on CONFIG_FOR_CHIPA
66
67config DEEP_DEPENDENT_CONFIG_INV
68    bool "Config depends on the inverted value of another config"
69    depends on !CONFIG_FOR_CHIPA
70
71choice DEEP_DEPENDENT_CHOICE
72    prompt "depends on target-specific config"
73    default DEEP_DEPENDENT_CHOICE_OP1
74    depends on DEEP_DEPENDENT_CONFIG
75
76    config DEEP_DEPENDENT_CHOICE_OP1
77        bool "op1"
78
79    config DEEP_DEPENDENT_CHOICE_OP2
80        bool "op2"
81endchoice
82
83config INVISIBLE1
84    bool "depends on cannot be satified at the same time"
85    depends on CONFIG_FOR_CHIPA && IDF_TARGET_CHIPB
86
87config VISIBLE1
88    bool "makes no sense, just for testing OR dependencies"
89    depends on CONFIG_FOR_CHIPA || IDF_TARGET_CHIPB
90
91config CONFIG_FOR_CHIPA_DEPENDS_VAR1
92    bool "redundant AND in depends on"
93    depends on CONFIG_FOR_CHIPA && IDF_TARGET_CHIPA
94
95config CONFIG_FOR_CHIPA_DEPENDS_VAR2
96    bool "test AND + NOT"
97    depends on CONFIG_FOR_CHIPA && !IDF_TARGET_CHIPB
98
99config CONFIG_FOR_CHIPA_DEPENDS_VAR3
100    bool "test NOT"
101    depends on !IDF_TARGET_CHIPB
102
103config CONFIG_DEPENDS_ENV_VAR1
104    bool "test other environment variable (should be visible because only IDF_TARGET should make something invisible)"
105    depends on IDF_XYZ
106
107config CONFIG_DEPENDS_ENV_VAR2
108    bool "test other environment variable (should be visible because only IDF_TARGET should make something invisible)"
109    depends on !IDF_XYZ
110
111choice CHIPA_VERSION
112    prompt "CHIPA version"
113    default CHIPA_VERSION2
114    depends on CONFIG_FOR_CHIPA
115
116    config CHIPA_VERSION1
117        bool "Version 1"
118    config CHIPA_VERSION2
119        bool "Version 2"
120    config CHIPA_VERSION3
121        bool "Version 3"
122endchoice
123
124config CHIPA_REV_MIN
125    int
126    default 1 if CHIPA_VERSION1
127    default 2 if CHIPA_VERSION2
128    default 3 if CHIPA_VERSION3
129
130config CHIPA_FEATURE_FROM_V1
131    depends on CONFIG_FOR_CHIPA && (CHIPA_REV_MIN <= 1)
132    bool "Feature available from version 1"
133
134config CHIPA_FEATURE_FROM_V3
135    depends on CONFIG_FOR_CHIPA && (CHIPA_REV_MIN <= 3)
136    bool "Feature available from version 3"
137
138config CHIPA_OPTION
139    int "option with default value depending on the chip version"
140    depends on IDF_TARGET_CHIPA
141    default 5 if CHIPA_REV_MIN < 2
142    default 4 if CHIPA_VERSION = 2
143    default 9 if CHIPA_REV_MIN = 3
144
145config COMPILER
146    string "compiler prefix"
147    default "ca" if IDF_TARGET_CHIPA
148    default "cb" if IDF_TARGET_CHIPB
149
150config BOOL_OPTION
151    bool "bool option"
152    default y
153
154config BOOL_OPTION2
155    bool "bool option 2"
156    default BOOL_OPTION
157
158config HEX_OPTION
159    hex "bool option"
160    default 0xce if IDF_TARGET_CHIPA
161    default 0xff if IDF_TARGET_CHIPB
162    range 0xf 0xce if IDF_TARGET_CHIPA
163    range 0xfe 0xff if IDF_TARGET_CHIPB
164
165config INT_OPTION
166    int "int option"
167    range 1 10 if IDF_TARGET_CHIPA
168    range 100 200 if IDF_TARGET_CHIPB
169