mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 01:33:52 +08:00
Clock source driver (#580)
* Initial clock source implementation * fix misra? * Working now. Still need to fix board detection though * Always stop pulse * revert board detection bodge Co-authored-by: Tici <robbe@comma.ai>
This commit is contained in:
@@ -148,6 +148,10 @@ class Panda(object):
|
||||
HW_TYPE_PEDAL = b'\x04'
|
||||
HW_TYPE_UNO = b'\x05'
|
||||
|
||||
CLOCK_SOURCE_MODE_DISABLED = 0
|
||||
CLOCK_SOURCE_MODE_FREE_RUNNING = 1
|
||||
CLOCK_SOURCE_MODE_EXTERNAL_SYNC = 2
|
||||
|
||||
def __init__(self, serial=None, claim=True):
|
||||
self._serial = serial
|
||||
self._handle = None
|
||||
@@ -665,3 +669,7 @@ class Panda(object):
|
||||
# ****************** Phone *****************
|
||||
def set_phone_power(self, enabled):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xb3, int(enabled), 0, b'')
|
||||
|
||||
# ************** Clock Source **************
|
||||
def set_clock_source_mode(self, mode):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xf5, int(mode), 0, b'')
|
||||
|
||||
Reference in New Issue
Block a user