23#include "esphome/core/hal.h"
25#ifdef IOHOME_LR1121_FIRMWARE_UPDATE
40class Lr1121FirmwareUpdater;
52class Lr1121FirmwareUpdateController {
63 Lr1121FirmwareUpdateController(RadioDriver **radio, SpiAccess *spi, InternalGPIOPin **rst_pin,
64 InternalGPIOPin **busy_pin,
bool *busy,
65 BeginBlockingExcursionFn begin_blocking_excursion, IOHomeControlComponent *hub);
68 Lr1121FirmwareUpdateController(
const Lr1121FirmwareUpdateController &) =
delete;
69 Lr1121FirmwareUpdateController &operator=(
const Lr1121FirmwareUpdateController &) =
delete;
79 void run_boot_time_bootloader_read();
87 void cache_flash_verdict();
91 void dump_debug()
const;
97 std::vector<std::string> debug_lines()
const;
102 std::string describe_flash_verdict()
const;
111#ifdef IOHOME_LR1121_BOOTLOADER_UPDATE
121 std::string describe_bootloader_refusal(BootloaderUpgradePath path)
const;
133 void set_bootloader_rewrite_allowed(
bool allowed) { this->bootloader_rewrite_allowed_ = allowed; }
141 Lr1121FirmwareUpdater *lr1121_firmware_updater_{
nullptr};
142 bool lr1121_bootloader_version_known_{
false};
143 uint8_t lr1121_bootloader_chip_type_{0};
144 uint16_t lr1121_bootloader_version_{0};
145 bool lr1121_flash_verdict_known_{
false};
150 uint16_t lr1121_installed_fw_{0};
156 uint8_t lr1121_installed_device_type_{0};
157 bool lr1121_flash_confirmation_armed_{
false};
158#ifdef IOHOME_LR1121_BOOTLOADER_UPDATE
161 bool bootloader_rewrite_allowed_{
false};
168 void arm_flash_confirmation_();
177 void run_flash_sequence_();
179#ifdef IOHOME_LR1121_BOOTLOADER_UPDATE
190 void run_bootloader_upgrade_sequence_();
193 RadioDriver **radio_;
195 InternalGPIOPin **rst_pin_;
196 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...