diff --git a/drivers/llcc68/Kconfig b/drivers/llcc68/Kconfig index 4999105..92c75ba 100644 --- a/drivers/llcc68/Kconfig +++ b/drivers/llcc68/Kconfig @@ -14,6 +14,17 @@ config LLCC68_INIT_PRIORITY 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 diff --git a/include/llcc68.hpp b/include/llcc68.hpp index 2397def..558f81f 100644 --- a/include/llcc68.hpp +++ b/include/llcc68.hpp @@ -11,7 +11,7 @@ #include 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_INF = 0xffffffff; diff --git a/include/llcc68_definitions.hpp b/include/llcc68_definitions.hpp index 7d43768..81e4a98 100644 --- a/include/llcc68_definitions.hpp +++ b/include/llcc68_definitions.hpp @@ -376,6 +376,55 @@ enum class GfskRxBandwidth : uint8_t { 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 { Off = 0x00, Bits8 = 0x04, @@ -478,7 +527,7 @@ struct 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()) { return { .mod_params = diff --git a/include/llcc68_raw.h b/include/llcc68_raw.h index f865728..c1695e5 100644 --- a/include/llcc68_raw.h +++ b/include/llcc68_raw.h @@ -6,7 +6,7 @@ #include #include -#define LLCC68_MAX_BUFFER_PAYLOAD 128 +#define LLCC68_MAX_BUFFER_PAYLOAD CONFIG_LLCC68_MAX_PAYLOAD_LENGTH #ifdef __cplusplus extern "C" {