/* * Furnace call relays on the UART1-OUT plug. * * Pin assignment was measured on this board -- Elecrow documents the GPIO * numbers but not the connector pin order. See README, "UART1-OUT plug". * * heat (W) IO20, white wire * fan (G) IO19, yellow wire * * Heat is on IO20 deliberately. IO20 is the ESP32-S3's USB D+, the line with * the hardware pull-up; with an active-low relay module a pull-up means * de-energized, so if the USB PHY is ever switched back on this pin fails * toward "no heat" rather than "heat stuck on". IO19 (D-) has no such pull-up. * * The simulator provides its own implementation of this interface, which is * why the API mentions no GPIOs. */ #ifndef RELAY_H #define RELAY_H #include #include "esp_err.h" typedef enum { RELAY_HEAT = 0, /* W -- gas valve call */ RELAY_FAN, /* G -- blower, manual circulation only */ RELAY_COUNT, } relay_id_t; /* Leaves both relays de-energized. Safe to call before anything else; it does * not depend on the display or the network. */ esp_err_t relay_init(void); void relay_set(relay_id_t id, bool energized); bool relay_get(relay_id_t id); const char *relay_name(relay_id_t id); #endif