Skip to content

Commit

Permalink
Add ihost bootloader reset
Browse files Browse the repository at this point in the history
  • Loading branch information
darkxst committed Dec 14, 2023
1 parent 326b1ab commit cfe51bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions universal_silabs_flasher/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ApplicationType(enum.Enum):

class ResetTarget(enum.Enum):
YELLOW = "yellow"
IHOST = "ihost"
SONOFF = "sonoff"

FW_IMAGE_TYPE_TO_APPLICATION_TYPE = {
Expand Down
13 changes: 13 additions & 0 deletions universal_silabs_flasher/flasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ async def enter_yellow_bootloader(self):
toggle_delay=0.1,
)

async def enter_ihost_bootloader(self):
_LOGGER.info("Triggering iHost bootloader")

await send_gpio_pattern(
chip_id=1,
pin_states={
27: [True, False, False],
26: [True, False, True],
},
toggle_delay=0.1,
)

async def enter_sonoff_bootloader(self):
_LOGGER.info("Triggering Sonoff bootloader")

Expand Down Expand Up @@ -197,6 +209,7 @@ async def probe_app_type(
types = self._probe_methods

reset_funcs = {
ResetTarget.IHOST: self.enter_ihost_bootloader,
ResetTarget.SONOFF: self.enter_sonoff_bootloader,
ResetTarget.YELLOW: self.enter_yellow_bootloader,
}
Expand Down

0 comments on commit cfe51bf

Please sign in to comment.