implemented protocol turning on and off

This commit is contained in:
dekunukem
2021-12-17 10:55:23 +00:00
parent d22e7b44cf
commit e325ee6b30
16 changed files with 1385 additions and 1335 deletions

View File

@@ -27,16 +27,16 @@ GPIO.output(PBOARD_DFU_PIN, GPIO.LOW)
usb4vc_oled.print_welcome_screen(RPI_APP_VERSION_TUPLE)
reset_pboard()
# usb4vc_usb_scan.set_protocol()
# reset_pboard()
usb4vc_usb_scan.set_protocol()
usb4vc_usb_scan.get_pboard_info()
# time.sleep(5)
# usb4vc_oled.oled_clear()
# usb4vc_oled.oled_queue_worker.start()
# usb4vc_usb_scan.usb_device_scan_thread.start()
# usb4vc_usb_scan.raw_input_event_parser_thread.start()
usb4vc_usb_scan.usb_device_scan_thread.start()
usb4vc_usb_scan.raw_input_event_parser_thread.start()
# while 1:
# time.sleep(10)
while 1:
time.sleep(10)

View File

@@ -293,11 +293,12 @@ def get_pboard_info():
time.sleep(0.01)
# send an empty message to allow response to be shifted into RPi
response = pcard_spi.xfer(list(nop_spi_msg_template))
time.sleep(0.01)
response = pcard_spi.xfer(list(nop_spi_msg_template))
print(response)
def set_protocol():
this_msg = list(set_protocl_spi_msg_template)
this_msg[3] = 2
this_msg[4] = 4
this_msg[5] = 1
this_msg[3] = 1 | 0x80
this_msg[4] = 4 #| 0x80
pcard_spi.xfer(this_msg)