/* * Pi HS DE/IN via GPIO v2 ioctl (Rev E J19). Used when POG422_HS_PATH=pi. * pinctrl system()/popen is init/fallback only — not the inject hot path. * * machine: DE=BCM11 M-S_OUT, IN=BCM9 M-S_IN (active-low) * ois: DE=BCM10 OIS_OUT, IN=BCM8 OIS_IN (active-low) * * OUT idle = drive low (never high-Z into TXS). IN low = bus driven. */ #ifndef POG422_PI_HS_H #define POG422_PI_HS_H #include #ifdef __cplusplus extern "C" { #endif /* 1 if POG422_HS_PATH resolves to pi (env or /etc/ethergold/ethergold.env). */ int pog422_pi_hs_enabled(void); /* Channel from POG422_UARTD_CHANNEL (machine|ois). Default machine. */ int pog422_pi_hs_is_ois(void); /* DE BCM for current channel (11 or 10). */ int pog422_pi_hs_de_bcm(void); /* IN BCM for current channel (9 or 8). */ int pog422_pi_hs_in_bcm(void); /* Drive DE high (1) or idle-low (0). Best-effort pinctrl. */ int pog422_pi_hs_de_set(int high); /* Read HS IN: *active=1 when bus driven (IN low). Returns 0 ok, <0 on error. */ int pog422_pi_hs_in_active(uint8_t *active); /* Configure IN as input+pu and OUT idle-low. Call once when Pi HS enables. */ int pog422_pi_hs_ensure_pins(void); #ifdef __cplusplus } #endif #endif /* POG422_PI_HS_H */