HW abstraction layer (#19530)
* start hw refactor
* move that
* pins
* put that back
old-commit-hash: 8674b023ba
commatwo_master
parent
84e8eb4191
commit
b950cab874
33 changed files with 87 additions and 81 deletions
@ -0,0 +1,19 @@ |
|||||||
|
import os |
||||||
|
from typing import cast |
||||||
|
|
||||||
|
from selfdrive.hardware.base import HardwareBase |
||||||
|
from selfdrive.hardware.eon.hardware import Android |
||||||
|
from selfdrive.hardware.tici.hardware import Tici |
||||||
|
from selfdrive.hardware.pc.hardware import Pc |
||||||
|
|
||||||
|
EON = os.path.isfile('/EON') |
||||||
|
TICI = os.path.isfile('/TICI') |
||||||
|
PC = not (EON or TICI) |
||||||
|
|
||||||
|
|
||||||
|
if EON: |
||||||
|
HARDWARE = cast(HardwareBase, Android()) |
||||||
|
elif TICI: |
||||||
|
HARDWARE = cast(HardwareBase, Tici()) |
||||||
|
else: |
||||||
|
HARDWARE = cast(HardwareBase, Pc()) |
@ -1,7 +1,8 @@ |
|||||||
from common.hardware_base import HardwareBase |
|
||||||
from cereal import log |
|
||||||
import subprocess |
import subprocess |
||||||
|
|
||||||
|
from cereal import log |
||||||
|
from selfdrive.hardware.base import HardwareBase |
||||||
|
|
||||||
NM = 'org.freedesktop.NetworkManager' |
NM = 'org.freedesktop.NetworkManager' |
||||||
NM_CON_ACT = NM + '.Connection.Active' |
NM_CON_ACT = NM + '.Connection.Active' |
||||||
NM_DEV_WL = NM + '.Device.Wireless' |
NM_DEV_WL = NM + '.Device.Wireless' |
@ -0,0 +1,8 @@ |
|||||||
|
# TODO: these are also defined in a header |
||||||
|
# GPIO pin definitions |
||||||
|
GPIO_HUB_RST_N = 30 |
||||||
|
GPIO_UBLOX_RST_N = 32 |
||||||
|
GPIO_UBLOX_SAFEBOOT_N = 33 |
||||||
|
GPIO_UBLOX_PWR_EN = 34 |
||||||
|
GPIO_STM_RST_N = 124 |
||||||
|
GPIO_STM_BOOT0 = 134 |
Loading…
Reference in new issue