def recover_internal_panda(self): gpio_init(GPIO.STM_RST_N, True) gpio_init(GPIO.STM_BOOT0, True) gpio_set(GPIO.STM_RST_N, 1) gpio_set(GPIO.STM_BOOT0, 1) time.sleep(2) gpio_set(GPIO.STM_RST_N, 0) gpio_set(GPIO.STM_BOOT0, 0)
def enter_dfu(): # Enter DOS DFU gpio_init(GPIO.STM_RST_N, True) gpio_init(GPIO.STM_BOOT0, True) gpio_set(GPIO.STM_RST_N, True) gpio_set(GPIO.STM_BOOT0, True) time.sleep(2) gpio_set(GPIO.STM_RST_N, False)
def set_panda_power(power=True): if not TICI: return gpio_init(GPIO_STM_RST_N, True) gpio_init(GPIO_STM_BOOT0, True) gpio_set(GPIO_STM_RST_N, True) gpio_set(GPIO_HUB_RST_N, True) time.sleep(0.1) gpio_set(GPIO_STM_RST_N, not power)
def set_panda_power(power=True): if not TICI: return gpio_init(GPIO_STM_RST_N, True) gpio_init(GPIO_STM_BOOT0, True) gpio_set(GPIO_STM_RST_N, False if is_legacy_panda_reset() else True) gpio_set(GPIO_HUB_RST_N, True) time.sleep(0.1) gpio_set(GPIO_STM_RST_N, power if is_legacy_panda_reset() else (not power))
def reset_internal_panda(self): gpio_init(GPIO.STM_RST_N, True) gpio_set(GPIO.STM_RST_N, 1) time.sleep(2) gpio_set(GPIO.STM_RST_N, 0)
gpio_export(GPIO.CAM1_RSTN) gpio_export(GPIO.CAM2_RSTN) print("hello") os.system('kill $(pgrep -f "manager.py")') os.system('kill $(pgrep -f "python -m selfdrive.athena.manage_athenad")') os.system('kill $(pgrep -f "selfdrive.athena.athenad")') # stopping weston turns off lcd3v3 os.system("sudo service weston stop") os.system("sudo service ModemManager stop") print("services stopped") t = Tici() t.initialize_hardware() t.set_power_save(True) t.set_screen_brightness(0) gpio_init(GPIO.STM_RST_N, True) gpio_init(GPIO.HUB_RST_N, True) gpio_init(GPIO.UBLOX_PWR_EN, True) gpio_init(GPIO.LTE_RST_N, True) gpio_init(GPIO.LTE_PWRKEY, True) gpio_init(GPIO.CAM0_AVDD_EN, True) gpio_init(GPIO.CAM0_RSTN, True) gpio_init(GPIO.CAM1_RSTN, True) gpio_init(GPIO.CAM2_RSTN, True) os.system( "sudo su -c 'echo 0 > /sys/kernel/debug/regulator/camera_rear_ldo/enable'" ) # cam 1v2 off gpio_set(GPIO.CAM0_AVDD_EN, False) # cam 2v8 off gpio_set(GPIO.LTE_RST_N, True) # quectel off gpio_set(GPIO.UBLOX_PWR_EN, False) # gps off