Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
lr1121_firmware_decisions.h File Reference

Pure decision logic for the LR1121 transceiver-firmware-update feature. More...

#include <cstdint>
Include dependency graph for lr1121_firmware_decisions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esphome::home_io_control::Lr1121BootloaderRequirement
 One (target firmware, required bootloader) pairing from Semtech's published compatibility matrix. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Enumerations

enum class  esphome::home_io_control::BootloaderSupport : uint8_t { esphome::home_io_control::SUPPORTED , esphome::home_io_control::UNSUPPORTED , esphome::home_io_control::UNKNOWN_TARGET }
 Whether a target firmware version is known to work with a given bootloader version. More...
enum class  esphome::home_io_control::BootloaderMismatch : uint8_t { esphome::home_io_control::NONE , esphome::home_io_control::TARGET_NEEDS_NEWER , esphome::home_io_control::TARGET_NEEDS_OLDER }
 Direction of a bootloader/target mismatch, for messaging. More...
enum class  esphome::home_io_control::BootloaderUpgradePath : uint8_t { esphome::home_io_control::NOT_APPLICABLE , esphome::home_io_control::AVAILABLE , esphome::home_io_control::BLOCKED_UNKNOWN_TARGET , esphome::home_io_control::BLOCKED_BOOTLOADER_NEWER }
 Whether the three-stage bootloader-rewrite sequence (ADR 0021) is applicable, and if not, why. More...
enum class  esphome::home_io_control::FlashDecision : uint8_t {
  esphome::home_io_control::PROCEED , esphome::home_io_control::ALREADY_INSTALLED , esphome::home_io_control::NEEDS_CONFIRMATION , esphome::home_io_control::REJECT_WRONG_CHIP ,
  esphome::home_io_control::REJECT_BOOTLOADER_TOO_OLD
}
 Outcome of lr1121_flash_decision(). More...

Functions

constexpr bool esphome::home_io_control::lr1121_bootloader_is_lr1121 (uint16_t bootloader_version)
constexpr const char * esphome::home_io_control::lr1121_chip_family_for_bootloader (uint16_t bootloader_version)
 Human-readable chip family for a bootloader version that is not one of the two LR1121 values above, for an actionable REJECT_WRONG_CHIP message.
constexpr const char * esphome::home_io_control::lr1121_chip_family_for_device_type (uint8_t device_type)
 Human-readable chip family for a normal-mode device_type that is not the LR1121 value above, for an actionable REJECT_WRONG_CHIP message (the layer-3 counterpart of lr1121_chip_family_for_bootloader() above).
constexpr BootloaderSupport esphome::home_io_control::lr1121_bootloader_supports_target (uint16_t target_fw, uint16_t bootloader_version)
 Look up whether target_fw is known to require bootloader_version.
constexpr uint16_t esphome::home_io_control::lr1121_required_bootloader_for (uint16_t target_fw)
 Required bootloader for a known target firmware version.
constexpr BootloaderMismatch esphome::home_io_control::lr1121_bootloader_mismatch_kind (uint16_t target_fw, uint16_t bootloader_version)
 Classify a bootloader/target mismatch by direction; see BootloaderMismatch.
constexpr BootloaderUpgradePath esphome::home_io_control::lr1121_bootloader_upgrade_path (bool block_present, bool bootloader_version_known, uint16_t bootloader_version, uint16_t loader_fw, uint16_t target_fw)
 Whether the three-stage bootloader upgrade is applicable for the current cached state.
constexpr FlashDecision esphome::home_io_control::lr1121_flash_decision (uint8_t device_type, uint8_t bootloader_chip_type, uint16_t bootloader_version, uint16_t installed_fw, uint16_t target_fw, bool already_confirmed)
 The single decision point for whether/how to flash target_fw.

Variables

constexpr uint8_t esphome::home_io_control::LR1121_DEVICE_TYPE_FOR_FIRMWARE_DECISIONS = 0x03
 LR1121 GetVersion type byte in normal mode — must match radio_lr1121.h's LR1121_DEVICE_TYPE (0x03).
constexpr uint8_t esphome::home_io_control::LR1110_DEVICE_TYPE_FOR_FIRMWARE_DECISIONS = 0x01
 Normal-mode GetVersion type bytes for the two chips an LR1121 is most easily confused with — companions to LR1121_DEVICE_TYPE_FOR_FIRMWARE_DECISIONS above, used only to name the chip family in a REJECT_WRONG_CHIP message.
constexpr uint8_t esphome::home_io_control::LR1120_DEVICE_TYPE_FOR_FIRMWARE_DECISIONS = 0x02
constexpr uint8_t esphome::home_io_control::LR1121_BOOTLOADER_TYPE_FOR_FIRMWARE_DECISIONS = 0xDF
 LR1121 GetVersion type byte reported while running the bootloader (LR11XX_TYPE_PRODUCTION_MODE) — must match radio_lr1121_firmware_updater.h's LR1121_UPDATER_BOOTLOADER_TYPE (0xDF).
constexpr uint16_t esphome::home_io_control::LR1121_BOOTLOADER_2100 = 0x2100
 LR1121 bootloader versions, from Semtech's published compatibility matrix.
constexpr uint16_t esphome::home_io_control::LR1121_BOOTLOADER_2101 = 0x2101
constexpr uint16_t esphome::home_io_control::LR1120_BOOTLOADER_2000 = 0x2000
 Bootloader versions reported by the two chips an LR1121 is most easily confused with — used only to name the chip family in a REJECT_WRONG_CHIP message.
constexpr uint16_t esphome::home_io_control::LR1120_BOOTLOADER_2001 = 0x2001
constexpr uint16_t esphome::home_io_control::LR1110_BOOTLOADER_6500 = 0x6500
constexpr uint16_t esphome::home_io_control::LR1110_BOOTLOADER_1001 = 0x1001
constexpr uint16_t esphome::home_io_control::LR1121_LOADER_2100 = 0x2100
 Version the lr1121_loader_2100.bin bootloader-*loader* image reports of itself.
constexpr Lr1121BootloaderRequirement esphome::home_io_control::LR1121_KNOWN_BOOTLOADER_REQUIREMENTS []
 Bootloader requirements we know about, copied from Semtech's published pairings (SWTL001/application/src/lr11xx_update_utils.c :: compatibility_matrix[]): 0x0101/0x0102/0x0103 need bootloader 0x2100, 0x0104 needs 0x2101.

Detailed Description

Pure decision logic for the LR1121 transceiver-firmware-update feature.

Header-only pure functions, no I/O — same style as hub_decisions.h and radio_lr1121.h::lr1121_firmware_is_outdated(), fully host-testable without radio hardware. Deliberately does not include radio_lr1121.h: LR1121_DEVICE_TYPE_FOR_FIRMWARE_DECISIONS below is a local copy of that file's LR1121_DEVICE_TYPE (0x03), kept independent so this header pulls in nothing but cstdint — the same reasoning that keeps hub_decisions.h free of driver headers.

Definition in file lr1121_firmware_decisions.h.