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.
This commit is contained in:
+16
-1
@@ -120,7 +120,7 @@ struct LLCC68 {
|
||||
uint8_t offset, std::span<const uint8_t> data_from_host,
|
||||
timeout_ms_t busy_timeout = DEFAULT_BUSY_TIMEOUT_MS);
|
||||
|
||||
void tx_rx_en_pin_set(TxRxPinState state);
|
||||
expected<unit, error_code> set_rf_switch_state(RfSwitchState state);
|
||||
|
||||
/** LLCC68 DataSheet Function */
|
||||
|
||||
@@ -239,6 +239,21 @@ struct LLCC68 {
|
||||
|
||||
expected<unit, error_code> set_tx(uint32_t timeout = TIMEOUT_NONE);
|
||||
expected<unit, error_code> set_rx(uint32_t timeout = TIMEOUT_INF);
|
||||
/**
|
||||
* @brief Start LLCC68 RX duty-cycle/listen mode.
|
||||
*
|
||||
* rx_period and sleep_period are raw 24-bit LLCC68 RTC periods, not
|
||||
* milliseconds. Datasheet section 13.1.7 defines one period as 15.625 us:
|
||||
* RX duration = rx_period * 15.625 us
|
||||
* sleep duration = sleep_period * 15.625 us
|
||||
*
|
||||
* Use rx_duty_cycle_period_from_ms() or set_rx_duty_cycle_ms() when caller
|
||||
* inputs are in milliseconds.
|
||||
*/
|
||||
expected<unit, error_code> set_rx_duty_cycle(uint32_t rx_period,
|
||||
uint32_t sleep_period);
|
||||
expected<unit, error_code> set_rx_duty_cycle_ms(uint32_t rx_period_ms,
|
||||
uint32_t sleep_period_ms);
|
||||
expected<unit, error_code> set_sleep(sleep_config_t config);
|
||||
expected<unit, error_code> set_tx_continuous_wave();
|
||||
expected<unit, error_code> set_tx_infinite_preamble();
|
||||
|
||||
Reference in New Issue
Block a user