46 bool begin(TwoWire &wire, uint8_t addr,
int sda = -1,
int scl = -1)
49 return beginCommonStatic<SensorCommI2C, HalArduino>(
comm,
staticComm,
hal, wire, addr, sda, scl);
62 bool begin(SPIClass &spi, uint8_t csPin,
int mosi = -1,
int miso = -1,
int sck = -1)
65 return beginCommonStatic<SensorCommSPI, HalArduino>(
comm,
staticComm,
hal, spi, csPin, mosi, miso, sck);
69#elif defined(ESP_PLATFORM)
70#if defined(SENSORLIB_USE_I2C_LEGACY)
79 bool begin(i2c_port_t port_num, uint8_t addr,
int sda = -1,
int scl = -1)
82 return beginCommonStatic<SensorCommI2C, HalEspIDF>(
comm,
staticComm,
hal, port_num, addr, sda, scl);
92 bool begin(i2c_master_bus_handle_t handle, uint8_t addr)
95 return beginCommonStatic<SensorCommI2C, HalEspIDF>(
comm,
staticComm,
hal, handle, addr);
109 bool begin(spi_host_device_t host, spi_device_handle_t handle,
110 uint8_t csPin,
int mosi = -1,
int miso = -1,
int sck = -1)
113 return beginCommonStatic<SensorCommSPI, HalEspIDF>(
comm,
staticComm,
hal, host, handle, csPin, mosi, miso, sck);
132 return beginCommCustomCallback<SensorCommCustom, SensorCommCustomHal>(
143 if (!
comm || !
hal)
return false;
bool begin(CommInterface interface, SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback, uint8_t addr=0)
Initialize the sensor using custom callback interface.