Files
crosstyan 1c3626d58b feat(llcc68): add configurable RF switch modes
Add an explicit rf-switch-mode devicetree property for LLCC68 instances, covering no switch handling, TXEN/RXEN complementary GPIO control, and DIO2 single-pin control for PE4259-style RF switches. Preserve the existing default behavior with an auto Kconfig default that only enables complementary GPIO handling when both TXEN and RXEN GPIOs are present.

Resolve the RF switch mode into llcc68_config at build time and validate incompatible devicetree combinations with BUILD_ASSERT checks. Configure optional RXEN GPIO handling for DIO2 single-pin mode and keep DIO2 RF switch control disabled unless that mode is selected.

Replace the old fire-and-forget TX/RX GPIO helper with a result-returning mode-aware RF switch state helper, and apply it across standby, sleep, CAD, TX, RX, continuous wave, infinite preamble, and modem init paths.

Add SetRxDutyCycle support with explicit raw 24-bit LLCC68 period units, plus helpers and a millisecond wrapper for callers that work in time units. Select the RX RF path before issuing the duty-cycle command so RXEN stays valid for duty-cycle listen windows.
2026-06-01 18:05:31 +08:00

71 lines
2.0 KiB
Plaintext

DT_COMPAT_SEMTECH_LLCC68_WEIHUA := "semtech,llcc68-weihua"
config LLCC68
bool "Semtech LLCC68 LoRa Radio Driver"
depends on SPI && GPIO
default $(dt_compat_enabled,$(DT_COMPAT_SEMTECH_LLCC68_WEIHUA))
help
Enable the Semtech LLCC68 LoRa Radio Driver.
config LLCC68_INIT_PRIORITY
int "LLCC68 Initialization Priority"
default 90
help
The priority of the LLCC68 initialization. Lower numbers indicate
higher priority.
config LLCC68_MAX_PAYLOAD_LENGTH
int "LLCC68 maximum payload length"
default 128
range 1 255
help
Maximum radio payload length accepted by the LLCC68 driver.
The LLCC68 packet length fields support up to 255 bytes. Keep this
lower when the application has a known payload ceiling to reduce RAM
used by the driver's SPI staging buffers.
config LLCC68_ALWAYS_USE_SX1262_HIGH_PA
bool "LLCC68 Always Use SX1262 High Power Amplifier"
default y
help
When enabled, the LLCC68/SX1262/SX1261 driver always chooses high
power amplifier settings instead of selecting them from chip version.
choice LLCC68_RF_SWITCH_DEFAULT
prompt "Default LLCC68 RF switch mode"
default LLCC68_RF_SWITCH_DEFAULT_AUTO
help
Default RF switch mode for LLCC68 devicetree nodes that do not set
rf-switch-mode.
config LLCC68_RF_SWITCH_DEFAULT_AUTO
bool "Auto"
help
Preserve legacy behavior: use complementary GPIO control when both
tx-enable-gpios and rx-enable-gpios are present, otherwise disable RF
switch control.
config LLCC68_RF_SWITCH_DEFAULT_NONE
bool "None"
help
Disable RF switch control unless rf-switch-mode is set in devicetree.
config LLCC68_RF_SWITCH_DEFAULT_GPIO_COMPLEMENTARY
bool "TXEN/RXEN complementary GPIO"
help
Use MCU GPIOs for complementary TXEN/RXEN RF switch control by default.
config LLCC68_RF_SWITCH_DEFAULT_DIO2_SINGLE
bool "DIO2 single-pin"
help
Use LLCC68 DIO2 RF switch control by default. DIO2 drives TXEN, while
RXEN is held active externally or by rx-enable-gpios.
endchoice
module = LLCC68
module-str = llcc68
source "subsys/logging/Kconfig.template.log_config"