12 namespace bme68x_bsec2_i2c {
14 static const char *
const TAG =
"bme68x_bsec2_i2c.sensor";
16 void BME68xBSEC2I2CComponent::setup() {
18 this->
bme68x_.intf_ptr = (
void *)
this;
19 this->
bme68x_.intf = BME68X_I2C_INTF;
20 this->
bme68x_.read = BME68xBSEC2I2CComponent::read_bytes_wrapper;
21 this->
bme68x_.write = BME68xBSEC2I2CComponent::write_bytes_wrapper;
22 this->
bme68x_.delay_us = BME68xBSEC2I2CComponent::delay_us;
28 void BME68xBSEC2I2CComponent::dump_config() {
30 BME68xBSEC2Component::dump_config();
35 int8_t BME68xBSEC2I2CComponent::read_bytes_wrapper(uint8_t a_register, uint8_t *data, uint32_t
len,
void *intfPtr) {
36 ESP_LOGVV(TAG,
"read_bytes_wrapper: reg = %u", a_register);
40 int8_t BME68xBSEC2I2CComponent::write_bytes_wrapper(uint8_t a_register,
const uint8_t *data, uint32_t len,
42 ESP_LOGVV(TAG,
"write_bytes_wrapper: reg = %u", a_register);
46 void BME68xBSEC2I2CComponent::delay_us(uint32_t period,
void *intfPtr) {
47 ESP_LOGVV(TAG,
"Delaying for %" PRIu32
"us", period);
bool read_bytes(uint8_t a_register, uint8_t *data, uint8_t len)
Compat APIs All methods below have been added for compatibility reasons.
struct bme68x_dev bme68x_
uint8_t address_
store the address of the device on the bus
std::string to_string(int value)
uint32_t fnv1_hash(const std::string &str)
Calculate a FNV-1 hash of str.
Implementation of SPI Controller mode.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
bool write_bytes(uint8_t a_register, const uint8_t *data, uint8_t len, bool stop=true)