Compare commits

..

3 Commits

Author SHA1 Message Date
crosstyan e6f96ea0e3 fix(llcc68): cache detected chip type
Store the detected chip type after the first successful version-register read so repeated radio operations do not keep querying the chip identity.

This preserves Unknown as uncached so transient read failures or unsupported responses can still be retried on a later call.
2026-06-16 19:36:45 +08:00
crosstyan b125dd33b9 style(llcc68): apply shared clang-format
Add a .clang-format file to the LLCC68 submodule so it can be formatted consistently when edited or checked out independently from the parent repository.

Reformat the tracked C and C++ driver sources with the shared style configuration.
2026-06-16 19:36:45 +08:00
crosstyan d382bdfd1e fix(llcc68): apply full radio profile before tx and rx
Reapply packet type, sync word, RF frequency, modulation, packet, CRC, and whitening settings on async TX/RX entry points.

This lets callers switch between preconfigured profiles immediately before a send or listen operation instead of relying on modem-init state.
2026-06-16 19:35:59 +08:00
5 changed files with 2172 additions and 2075 deletions
+25
View File
@@ -0,0 +1,25 @@
# C++ specific configuration (akin to Google's C++ style)
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options
---
Language: Cpp
BasedOnStyle: LLVM
UseTab: ForContinuationAndIndentation
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -4
ColumnLimit: 0
NamespaceIndentation: Inner
FixNamespaceComments: false
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
IndentCaseLabels: false
SortIncludes: Never
AlignConsecutiveMacros: AcrossEmptyLines
AlignConsecutiveAssignments: Consecutive
BreakStringLiterals: true
LineEnding: LF
MaxEmptyLinesToKeep: 2
BreakBeforeBraces: Attach
InsertBraces: true
BreakAfterAttributes: Always
+6 -5
View File
@@ -44,10 +44,10 @@ constexpr auto DEFAULT_BUSY_TIMEOUT_MS = 100;
* @param ldro_on Low data rate optimization setting sent to the radio
*/
constexpr airtime_t calc_time_on_air(uint8_t len, uint8_t sf, LoRaBandwidth bw,
LoRaCodingRate cr,
uint16_t preamble_length,
LoRaHeaderType header_type,
LoRaCrcType crc_type, bool ldro_on);
LoRaCodingRate cr,
uint16_t preamble_length,
LoRaHeaderType header_type,
LoRaCrcType crc_type, bool ldro_on);
struct LLCC68 {
/** trivial getter */
@@ -253,7 +253,7 @@ struct LLCC68 {
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);
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();
@@ -303,6 +303,7 @@ struct LLCC68 {
/** properties */
const struct device *dev;
std::optional<ChipType> cached_chip_type{};
};
} // namespace app::driver::llcc68
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -15,9 +15,9 @@ extern "C" {
typedef void (*llcc68_user_dio1_handler_t)(const struct device *dev, void *user_data);
enum llcc68_rf_switch_mode {
LLCC68_RF_SWITCH_NONE = 0,
LLCC68_RF_SWITCH_NONE = 0,
LLCC68_RF_SWITCH_GPIO_COMPLEMENTARY = 1,
LLCC68_RF_SWITCH_DIO2_SINGLE = 2,
LLCC68_RF_SWITCH_DIO2_SINGLE = 2,
};
struct llcc68_config {
+1315 -1245
View File
File diff suppressed because it is too large Load Diff