k-line 5 baud init (#565)

* k-line slow init

* k-line slow init LED bit blink

* fix misra violations

* better names for k-line methods

* debug prints match names

* switch to timer

* use TIM4 until I figure out TIM5

* tickle faster

* fix bit bug and add stop bit

* TIM5 working

* USB return after addr sent

* fix l-line reset

* fix misra violations

* blink for the ones instead of the zeros

* k-line 5 baud fault type

* lin check

* use TIM5 or wakeup

* better names
This commit is contained in:
Greg Hogan
2020-07-10 14:18:24 -07:00
committed by GitHub
parent 2fab502cad
commit 390b8bce81
6 changed files with 151 additions and 42 deletions

View File

@@ -579,6 +579,14 @@ class Panda(object):
if DEBUG:
print("kline wakeup done")
def kline_5baud(self, addr, k=True, l=True):
assert k or l, "must specify k-line, l-line, or both"
if DEBUG:
print("kline 5 baud...")
self._handle.controlWrite(Panda.REQUEST_OUT, 0xf4, 2 if k and l else int(l), addr, b'')
if DEBUG:
print("kline 5 baud done")
def kline_drain(self, bus=2):
# drain buffer
bret = bytearray()