rename GPIO pin with ublox in the name that is not ublox specific (#29702)

* rename UBLOX_PWR_EN to GNSS_PWR_EN

* add schematic label as comment
old-commit-hash: 5058f31908
This commit is contained in:
Greg Hogan 2023-08-29 15:24:37 -07:00 committed by GitHub
parent 38270df689
commit de996d76bb
6 changed files with 12 additions and 12 deletions

View File

@ -5,7 +5,7 @@
#define GPIO_HUB_RST_N 30
#define GPIO_UBLOX_RST_N 32
#define GPIO_UBLOX_SAFEBOOT_N 33
#define GPIO_UBLOX_PWR_EN 34
#define GPIO_GNSS_PWR_EN 34 /* SCHEMATIC LABEL: GPIO_UBLOX_PWR_EN */
#define GPIO_STM_RST_N 124
#define GPIO_STM_BOOT0 134
#define GPIO_BMX_ACCEL_INT 21
@ -17,7 +17,7 @@
#define GPIO_HUB_RST_N 0
#define GPIO_UBLOX_RST_N 0
#define GPIO_UBLOX_SAFEBOOT_N 0
#define GPIO_UBLOX_PWR_EN 0
#define GPIO_GNSS_PWR_EN 0 /* SCHEMATIC LABEL: GPIO_UBLOX_PWR_EN */
#define GPIO_STM_RST_N 0
#define GPIO_STM_BOOT0 0
#define GPIO_BMX_ACCEL_INT 0

View File

@ -6,7 +6,7 @@ class GPIO:
HUB_RST_N = 30
UBLOX_RST_N = 32
UBLOX_SAFEBOOT_N = 33
UBLOX_PWR_EN = 34
GNSS_PWR_EN = 34 # SCHEMATIC LABEL: GPIO_UBLOX_PWR_EN
STM_RST_N = 124
STM_BOOT0 = 134

View File

@ -53,7 +53,7 @@ if __name__ == "__main__":
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.GNSS_PWR_EN, True)
gpio_init(GPIO.LTE_RST_N, True)
gpio_init(GPIO.LTE_PWRKEY, True)
gpio_init(GPIO.CAM0_AVDD_EN, True)
@ -65,7 +65,7 @@ if __name__ == "__main__":
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.GNSS_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
@ -92,7 +92,7 @@ if __name__ == "__main__":
gpio_set(GPIO.STM_RST_N, False)
time.sleep(5)
print("panda: ", read_power_avg())
gpio_set(GPIO.UBLOX_PWR_EN, True)
gpio_set(GPIO.GNSS_PWR_EN, True)
time.sleep(5)
print("gps: ", read_power_avg())
gpio_set(GPIO.LTE_RST_N, False)

View File

@ -27,11 +27,11 @@ UBLOX_ASSIST_ACK = b"\xb5\x62\x13\x60\x08\x00"
def set_power(enabled: bool) -> None:
gpio_init(GPIO.UBLOX_SAFEBOOT_N, True)
gpio_init(GPIO.UBLOX_PWR_EN, True)
gpio_init(GPIO.GNSS_PWR_EN, True)
gpio_init(GPIO.UBLOX_RST_N, True)
gpio_set(GPIO.UBLOX_SAFEBOOT_N, True)
gpio_set(GPIO.UBLOX_PWR_EN, enabled)
gpio_set(GPIO.GNSS_PWR_EN, enabled)
gpio_set(GPIO.UBLOX_RST_N, enabled)
def add_ubx_checksum(msg: bytes) -> bytes:

View File

@ -271,7 +271,7 @@ def main() -> NoReturn:
def cleanup(sig, frame):
cloudlog.warning("caught sig disabling quectel gps")
gpio_set(GPIO.UBLOX_PWR_EN, False)
gpio_set(GPIO.GNSS_PWR_EN, False)
teardown_quectel(diag)
cloudlog.warning("quectel cleanup done")
@ -289,8 +289,8 @@ def main() -> NoReturn:
want_assistance = not r
current_gps_time = utc_to_gpst(GPSTime.from_datetime(datetime.utcnow()))
cloudlog.warning("quectel setup done")
gpio_init(GPIO.UBLOX_PWR_EN, True)
gpio_set(GPIO.UBLOX_PWR_EN, True)
gpio_init(GPIO.GNSS_PWR_EN, True)
gpio_set(GPIO.GNSS_PWR_EN, True)
pm = messaging.PubMaster(['qcomGnss', 'gpsLocation'])

View File

@ -56,7 +56,7 @@ class TestPigeond(unittest.TestCase):
managed_processes['pigeond'].stop()
assert gpio_read(GPIO.UBLOX_RST_N) == 0
assert gpio_read(GPIO.UBLOX_PWR_EN) == 0
assert gpio_read(GPIO.GNSS_PWR_EN) == 0
if __name__ == "__main__":