24#include "esphome/core/hal.h"
26#ifdef IOHOME_LR1121_FIRMWARE_UPDATE
41class Lr1121FirmwareUpdater;
53class Lr1121FirmwareUpdateController {
64 Lr1121FirmwareUpdateController(RadioDriver **radio, SpiAccess *spi, InternalGPIOPin **rst_pin,
65 InternalGPIOPin **busy_pin,
bool *busy,
66 BeginBlockingExcursionFn begin_blocking_excursion, IOHomeControlComponent *hub);
69 Lr1121FirmwareUpdateController(
const Lr1121FirmwareUpdateController &) =
delete;
70 Lr1121FirmwareUpdateController &operator=(
const Lr1121FirmwareUpdateController &) =
delete;
80 void run_boot_time_bootloader_read();
88 void cache_flash_verdict();
92 void dump_debug()
const;
98 std::vector<std::string> debug_lines()
const;
103 std::string describe_flash_verdict()
const;
112#ifdef IOHOME_LR1121_BOOTLOADER_UPDATE
122 std::string describe_bootloader_refusal(BootloaderUpgradePath path)
const;
134 void set_bootloader_rewrite_allowed(
bool allowed) { this->bootloader_rewrite_allowed_ = allowed; }
142 Lr1121FirmwareUpdater *lr1121_firmware_updater_{
nullptr};
143 bool lr1121_bootloader_version_known_{
false};
144 uint8_t lr1121_bootloader_chip_type_{0};
145 uint16_t lr1121_bootloader_version_{0};
146 bool lr1121_flash_verdict_known_{
false};
151 uint16_t lr1121_installed_fw_{0};
157 uint8_t lr1121_installed_device_type_{0};
158 bool lr1121_flash_confirmation_armed_{
false};
159#ifdef IOHOME_LR1121_BOOTLOADER_UPDATE
162 bool bootloader_rewrite_allowed_{
false};
169 void arm_flash_confirmation_();
178 void run_flash_sequence_();
180#ifdef IOHOME_LR1121_BOOTLOADER_UPDATE
191 void run_bootloader_upgrade_sequence_();
194 RadioDriver **radio_;
196 InternalGPIOPin **rst_pin_;
197 InternalGPIOPin **busy_pin_;
The main IO-Homecontrol component.
Abstract radio driver for IO-Homecontrol.
Interface for SPI bus access.
Injected-capability callback aliases shared by the hub's collaborator objects.
BootloaderUpgradePath
Whether the three-stage bootloader-rewrite sequence (ADR 0021) is applicable, and if not,...
FlashDecision
Outcome of lr1121_flash_decision().
std::function< void()> BeginBlockingExcursionFn
Raises the hub's "operation took a long time" warning threshold for a blocking radio excursion — writ...