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 set_panda_power(power=True): if not TICI: return gpio_init(GPIO_STM_RST_N, True) gpio_init(GPIO_STM_BOOT0, True) gpio_init(GPIO_HUB_RST_N, True) gpio_set(GPIO_STM_RST_N, False) gpio_set(GPIO_HUB_RST_N, True) gpio_set(GPIO_STM_BOOT0, False) time.sleep(0.1) gpio_set(GPIO_STM_RST_N, power)
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, 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)
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 gpio_set(GPIO.STM_RST_N, True) # panda off gpio_set(GPIO.HUB_RST_N, False) # hub off # cameras in reset gpio_set(GPIO.CAM0_RSTN, False) gpio_set(GPIO.CAM1_RSTN, False) gpio_set(GPIO.CAM2_RSTN, False) time.sleep(8) print("baseline: ", read_power_avg()) gpio_set(GPIO.CAM0_AVDD_EN, True) time.sleep(2) print("cam avdd: ", read_power_avg()) os.system(