mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 01:33:52 +08:00
spi: add helper for getting bootloader ID (#2074)
* spi: add helper for getting bootloader ID * fix mypy --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -397,6 +397,9 @@ class STBootloaderSPIHandle(BaseSTBootloaderHandle):
|
||||
data = [struct.pack('>I', address), struct.pack('B', length - 1)]
|
||||
return self._cmd(0x11, data=data, read_bytes=length)
|
||||
|
||||
def get_bootloader_id(self):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user