Skip to content

Commit

Permalink
spi: add helper for getting bootloader ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Nov 8, 2024
1 parent aab03bc commit b8c4fbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ def read(self, address: int, length: int):
data = [struct.pack('>I', address), struct.pack('B', length - 1)]
return self._cmd(0x11, data=data, read_bytes=length)

def get_bootloader_id(self) -> int:
return self.read(0x1FF1E7FE, 1)

def get_chip_id(self) -> int:
r = self._cmd(0x02, read_bytes=3)
assert r[0] == 1 # response length - 1
Expand Down

0 comments on commit b8c4fbb

Please sign in to comment.