File tree Expand file tree Collapse file tree 6 files changed +69
-18
lines changed
boards/seeed/xiao_esp32c6
dts/bindings/net/wireless Expand file tree Collapse file tree 6 files changed +69
-18
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 Mario Paja
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ if (CONFIG_ESP32_EXT_ANTENNA )
5
+ zephyr_library ()
6
+ zephyr_library_sources (board.c )
7
+ endif ()
Original file line number Diff line number Diff line change @@ -5,3 +5,8 @@ config HEAP_MEM_POOL_ADD_SIZE_BOARD
5
5
int
6
6
default 4096 if BOARD_XIAO_ESP32C6_ESP32C6_HPCORE
7
7
default 256 if BOARD_XIAO_ESP32C6_ESP32C6_LPCORE
8
+
9
+ config XIAO_ESP32C6_EXT_ANTENNA
10
+ bool "XIAO ESP32C6 external antenna konfiguration"
11
+ default y if BOARD_XIAO_ESP32C6_ESP32C6_HPCORE && ESP32_EXT_ANTENNA
12
+ select BOARD_LATE_INIT_HOOK
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Mario Paja
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ #include <zephyr/kernel.h>
8
+ #include <zephyr/drivers/gpio.h>
9
+ #include <zephyr/init.h>
10
+
11
+ void board_late_init_hook (void )
12
+ {
13
+ #if DT_NODE_HAS_STATUS_OKAY (DT_NODELABEL (rf_switch ))
14
+ const struct gpio_dt_spec rf_switch_en =
15
+ GPIO_DT_SPEC_GET (DT_NODELABEL (rf_switch ), enable_gpios );
16
+
17
+ if (gpio_is_ready_dt (& rf_switch_en )) {
18
+ gpio_pin_configure_dt (& rf_switch_en , GPIO_OUTPUT_ACTIVE );
19
+ }
20
+
21
+ const struct gpio_dt_spec ant_sel = GPIO_DT_SPEC_GET (DT_NODELABEL (rf_switch ), select_gpios );
22
+
23
+ if (gpio_is_ready_dt (& ant_sel )) {
24
+ #ifdef CONFIG_XIAO_ESP32C6_EXT_ANTENNA
25
+ gpio_pin_configure_dt (& ant_sel , GPIO_OUTPUT_ACTIVE );
26
+ #else
27
+ gpio_pin_configure_dt (& ant_sel , GPIO_OUTPUT_INACTIVE );
28
+ #endif /* XIAO_ESP32C6_EXT_ANTENNA */
29
+ }
30
+
31
+ #endif /* DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(rf_switch)) */
32
+ }
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 Mario Paja
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ description : |
5
+ Group of GPIO-controlled relays used to enable an RF switch and select the active antenna.
6
+
7
+ compatible : " gpio-rf-switch"
8
+
9
+ properties :
10
+ enable-gpios :
11
+ type : phandle-array
12
+ required : true
13
+ description : |
14
+ GPIOs to enable the RF switch module.
15
+
16
+ select-gpios :
17
+ type : phandle-array
18
+ required : true
19
+ description : |
20
+ GPIOs to select the active antenna
Original file line number Diff line number Diff line change 37
37
watchdog0 = &wdt0;
38
38
};
39
39
40
+ rf_switch: rf_switch {
41
+ compatible = "gpio-rf-switch";
42
+ enable-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
43
+ select-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
44
+ };
40
45
};
41
46
42
47
&trng0 {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments