feat(llcc68): make payload limit configurable
Add CONFIG_LLCC68_MAX_PAYLOAD_LENGTH with a default of 128 bytes and a hardware-bounded range of 1..255. Wire both the C++ and raw C LLCC68 payload buffer constants to the Kconfig value so application builds can tune radio buffer RAM without editing headers. Rename the fixed-length 100k preset from GMSK to GFSK and expose rx_bandwidth_hz() next to the GfskRxBandwidth enum so applications can report configured bandwidth without carrying driver-specific lookup tables.
This commit is contained in:
@@ -14,6 +14,17 @@ config LLCC68_INIT_PRIORITY
|
|||||||
The priority of the LLCC68 initialization. Lower numbers indicate
|
The priority of the LLCC68 initialization. Lower numbers indicate
|
||||||
higher priority.
|
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
|
config LLCC68_ALWAYS_USE_SX1262_HIGH_PA
|
||||||
bool "LLCC68 Always Use SX1262 High Power Amplifier"
|
bool "LLCC68 Always Use SX1262 High Power Amplifier"
|
||||||
default y
|
default y
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
#include <zephyr/drivers/gpio.h>
|
#include <zephyr/drivers/gpio.h>
|
||||||
|
|
||||||
namespace app::driver::llcc68 {
|
namespace app::driver::llcc68 {
|
||||||
constexpr size_t MAX_BUFFER_PAYLOAD = 128;
|
constexpr size_t MAX_BUFFER_PAYLOAD = CONFIG_LLCC68_MAX_PAYLOAD_LENGTH;
|
||||||
constexpr uint32_t TIMEOUT_NONE = 0;
|
constexpr uint32_t TIMEOUT_NONE = 0;
|
||||||
constexpr uint32_t TIMEOUT_INF = 0xffffffff;
|
constexpr uint32_t TIMEOUT_INF = 0xffffffff;
|
||||||
|
|
||||||
|
|||||||
@@ -376,6 +376,55 @@ enum class GfskRxBandwidth : uint8_t {
|
|||||||
Bw467000 = 0x09,
|
Bw467000 = 0x09,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline uint32_t rx_bandwidth_hz(GfskRxBandwidth bandwidth) {
|
||||||
|
using enum GfskRxBandwidth;
|
||||||
|
switch (bandwidth) {
|
||||||
|
case Bw4800:
|
||||||
|
return 4800;
|
||||||
|
case Bw5800:
|
||||||
|
return 5800;
|
||||||
|
case Bw7300:
|
||||||
|
return 7300;
|
||||||
|
case Bw9700:
|
||||||
|
return 9700;
|
||||||
|
case Bw11700:
|
||||||
|
return 11700;
|
||||||
|
case Bw14600:
|
||||||
|
return 14600;
|
||||||
|
case Bw19500:
|
||||||
|
return 19500;
|
||||||
|
case Bw23400:
|
||||||
|
return 23400;
|
||||||
|
case Bw29300:
|
||||||
|
return 29300;
|
||||||
|
case Bw39000:
|
||||||
|
return 39000;
|
||||||
|
case Bw46900:
|
||||||
|
return 46900;
|
||||||
|
case Bw58600:
|
||||||
|
return 58600;
|
||||||
|
case Bw78200:
|
||||||
|
return 78200;
|
||||||
|
case Bw93800:
|
||||||
|
return 93800;
|
||||||
|
case Bw117300:
|
||||||
|
return 117300;
|
||||||
|
case Bw156200:
|
||||||
|
return 156200;
|
||||||
|
case Bw187200:
|
||||||
|
return 187200;
|
||||||
|
case Bw234300:
|
||||||
|
return 234300;
|
||||||
|
case Bw312000:
|
||||||
|
return 312000;
|
||||||
|
case Bw373600:
|
||||||
|
return 373600;
|
||||||
|
case Bw467000:
|
||||||
|
return 467000;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
enum class GfskPreambleDetector : uint8_t {
|
enum class GfskPreambleDetector : uint8_t {
|
||||||
Off = 0x00,
|
Off = 0x00,
|
||||||
Bits8 = 0x04,
|
Bits8 = 0x04,
|
||||||
@@ -478,7 +527,7 @@ struct gfsk_parameters_t {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static constexpr gfsk_parameters_t
|
static constexpr gfsk_parameters_t
|
||||||
Gmsk100kFixed6(freq_t frequency_mhz = 434.18,
|
Gfsk100kFixed6(freq_t frequency_mhz = 434.18,
|
||||||
tx_params_t tx_params = tx_params_t::Default()) {
|
tx_params_t tx_params = tx_params_t::Default()) {
|
||||||
return {
|
return {
|
||||||
.mod_params =
|
.mod_params =
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <zephyr/types.h>
|
#include <zephyr/types.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#define LLCC68_MAX_BUFFER_PAYLOAD 128
|
#define LLCC68_MAX_BUFFER_PAYLOAD CONFIG_LLCC68_MAX_PAYLOAD_LENGTH
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
Reference in New Issue
Block a user