add IRQ rate helper function (#1471)

init
This commit is contained in:
Igor Biletskyy
2023-06-20 11:47:43 -07:00
committed by GitHub
parent 58b80f3b77
commit 0f4e8f79f5
3 changed files with 20 additions and 2 deletions

View File

@@ -736,6 +736,10 @@ class Panda:
def get_secret(self):
return self._handle.controlRead(Panda.REQUEST_IN, 0xd0, 1, 0, 0x10)
def get_interrupt_call_rate(self, irqnum):
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xc4, int(irqnum), 0, 4)
return struct.unpack("I", dat)[0]
# ******************* configuration *******************
def set_power_save(self, power_save_enabled=0):