#pragma once #include #include #include "config.h" // The PCF85063 RTC and the SHTC3 sensor share one bus. Both drivers call this; // only the first call does any work. inline bool i2cBusBegin() { static bool started = false; if (!started) { started = Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN, I2C_FREQ_HZ); } return started; } // True if a device acknowledges its address. inline bool i2cDevicePresent(uint8_t addr) { Wire.beginTransmission(addr); return Wire.endTransmission() == 0; }