From 33b27e8b6b18811ebbf3bfff3828d97e001d1c95 Mon Sep 17 00:00:00 2001 From: Alexandre B Date: Mon, 8 Jul 2024 11:24:21 -0400 Subject: [PATCH] Update main.c --- ESP32-IDF_BMP280/main/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ESP32-IDF_BMP280/main/main.c b/ESP32-IDF_BMP280/main/main.c index bdde4b49..664ba053 100644 --- a/ESP32-IDF_BMP280/main/main.c +++ b/ESP32-IDF_BMP280/main/main.c @@ -19,6 +19,7 @@ #include #include "esp_log.h" #include "driver/i2c.h" +#include "bme280.h" static const char *TAG = "i2c-simple-example"; @@ -44,14 +45,19 @@ static esp_err_t mpu9250_register_read(uint8_t reg_addr, uint8_t *data, size_t l return i2c_master_write_read_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, ®_addr, 1, data, len, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); } -static esp_err_t bme280_I2C_burst_read(uint8_t device_address, uint8_t register_address, uint8_t *registers_data, size_t count) +/*static esp_err_t bme280_I2C_burst_read(uint8_t device_address, uint8_t register_address, uint8_t *registers_data, size_t count) { - int error = 0; - unsigned char array[BME280_I2C_BUFFER_LEN]; + int command_result = 0; + //unsigned char array[BME280_I2C_BUFFER_LEN]; unsigned char pos; array[0] = register_address; - error = i2c_master_write_read_device(0, device_address, write_buffer, write_size, *array, read_size, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); + command_result = i2c_master_write_read_device(0, device_address, write_buffer, write_size, *array, read_size, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); //error = i2c_master_write_read_device(I2C_MASTER_NUM, MPU9250_SENSOR_ADDR, ®ister_address, 1, registers_data, count, I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); +}*/ + +static esp_err_t bme280_read_raw_temperature(uint8_t *raw_temperature_u32) { + // BME280_INIT_VALUE + // BME280_TEMPERATURE_MSB_REG 0xFA } /**