LoRa device type + SX1262 kernel driver (first checkpoint) (#565)

Adds sub-GHz radio support to Tactility as a first-class kernel device type, plus a
driver for the Semtech SX1262. Continues the radio work discussed in #342, brought up to
the current kernel driver model (rather than the deprecated tt::hal layer the earlier
prototype targeted).
This commit is contained in:
Crazypedia
2026-07-30 13:32:23 -04:00
committed by GitHub
parent 606b918f9c
commit f13c18f398
20 changed files with 2548 additions and 1 deletions
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <tactility/bindings/bindings.h>
#include <drivers/sx1262.h>
#ifdef __cplusplus
extern "C" {
#endif
DEFINE_DEVICETREE(sx1262, struct Sx1262Config)
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <tactility/drivers/gpio.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Field order must match the property order in bindings/semtech,sx1262.yaml */
struct Sx1262Config {
/** Chip-select index on the parent SPI controller, must match the node's unit address */
int32_t reg;
/** SPI clock frequency in kHz */
uint32_t spi_frequency_khz;
/** NRESET line (must be an SoC GPIO) */
struct GpioPinSpec pin_reset;
/** BUSY line (must be an SoC GPIO) */
struct GpioPinSpec pin_busy;
/** DIO1 interrupt line (must be an SoC GPIO) */
struct GpioPinSpec pin_dio1;
/** Optional module power enable, driven active while the device is started */
struct GpioPinSpec pin_enable;
/** Optional antenna select, driven active while the device is started */
struct GpioPinSpec pin_antenna_select;
/** TCXO reference voltage on DIO3 in millivolts, 0 when no TCXO is fitted */
uint32_t tcxo_millivolts;
/** Use the LDO regulator instead of the DC-DC converter */
bool use_regulator_ldo;
/** DIO2 drives the antenna TX/RX switch */
bool dio2_as_rf_switch;
};
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <tactility/module.h>
#ifdef __cplusplus
extern "C" {
#endif
extern struct Module sx126x_module;
#ifdef __cplusplus
}
#endif