mirror of
https://github.com/utkumaden/esp-idf-bmx280
synced 2026-01-19 21:42:18 +01:00
Compare commits
2 Commits
2dc752e074
...
v1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55e1ccc3c9 | ||
| b48a6e2fa9 |
15
Kconfig
15
Kconfig
@@ -12,14 +12,15 @@ menu "BMX280 Options"
|
||||
bool "I2C Master Driver (i2c_master.h)"
|
||||
help
|
||||
Use I2C Master Driver (i2c_master.h) for ESP-IDF >= 5.3.
|
||||
config BMX280_I2C_CLK_SPEED_HZ
|
||||
int "I2C Clock Speed (Hz)"
|
||||
default 100000
|
||||
range 1000 400000
|
||||
help
|
||||
Set the I2C clock speed in Hz.
|
||||
endchoice
|
||||
|
||||
|
||||
config BMX280_I2C_CLK_SPEED_HZ
|
||||
int "I2C Clock Speed (Hz)"
|
||||
default 100000
|
||||
range 1000 400000
|
||||
help
|
||||
Set the I2C clock speed in Hz. Only applies to the new I2C Master driver.
|
||||
|
||||
choice BMX280_EXPECT_DEVICE
|
||||
prompt "Installed Sensor Model"
|
||||
help
|
||||
|
||||
12
bmx280.c
12
bmx280.c
@@ -338,12 +338,6 @@ static esp_err_t bmx280_probe(bmx280_t *bmx280)
|
||||
#endif
|
||||
}
|
||||
|
||||
static esp_err_t bmx280_reset(bmx280_t *bmx280)
|
||||
{
|
||||
const static uint8_t din[] = { BMX280_RESET_VEC };
|
||||
return bmx280_write(bmx280, BMX280_REG_RESET, din, sizeof din);
|
||||
}
|
||||
|
||||
static esp_err_t bmx280_calibrate(bmx280_t *bmx280)
|
||||
{
|
||||
// Honestly, the best course of action is to read the high and low banks
|
||||
@@ -448,6 +442,12 @@ bmx280_t* bmx280_create_master(i2c_master_bus_handle_t bus_handle)
|
||||
}
|
||||
#endif
|
||||
|
||||
esp_err_t bmx280_reset(bmx280_t *bmx280)
|
||||
{
|
||||
const static uint8_t din[] = { BMX280_RESET_VEC };
|
||||
return bmx280_write(bmx280, BMX280_REG_RESET, din, sizeof din);
|
||||
}
|
||||
|
||||
void bmx280_close(bmx280_t *bmx280)
|
||||
{
|
||||
#if CONFIG_USE_I2C_MASTER_DRIVER
|
||||
|
||||
@@ -57,6 +57,12 @@ BMXAPI bmx280_t* bmx280_create_legacy(i2c_port_t port);
|
||||
#define bmx280_create_master(port) static_assert(0, "You have the wrong driver configuration for using the new I2C master driver.")
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Restart the sensor, effectively puting it into sleep mode.
|
||||
* @param bmx280 The instance to reset.
|
||||
*/
|
||||
esp_err_t bmx280_reset(bmx280_t *bmx280);
|
||||
|
||||
/**
|
||||
* Destroy your the instance.
|
||||
* @param bmx280 The instance to destroy.
|
||||
|
||||
Reference in New Issue
Block a user