Update main.c

This commit is contained in:
Alexander 2024-07-08 11:24:21 -04:00
parent 4f8c0e6f22
commit 33b27e8b6b

View File

@ -19,6 +19,7 @@
#include <stdio.h>
#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, &reg_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, &register_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
}
/**