Thanks @MicroController! This did the trick. :D
For reference, this is what it looks like now:
reg_and_data[0] = reg_addr;
std::memcpy(&(reg_and_data[1]), reg_data, length);
esp_err_t error = i2c_master_transmit(_instance->_device_handle,
reg_and_data,
length + 1,
-1);
As an old Java ...
Search found 4 matches
- Sat Jan 06, 2024 9:26 pm
- Forum: ESP-IDF
- Topic: Rewrite I2C read / write functions to use newer driver/i2c_master.h API
- Replies: 6
- Views: 10964
- Fri Jan 05, 2024 10:28 pm
- Forum: ESP-IDF
- Topic: Rewrite I2C read / write functions to use newer driver/i2c_master.h API
- Replies: 6
- Views: 10964
Rewrite I2C read / write functions to use newer driver/i2c_master.h API
I am currently trying to communicate with a BME680 sensor over I2C using the newest Bosch API and ESP IDF 5.3.
I found some very old code which seems to work but uses the API provided by driver/i2c.h. Since it is recommended to use the newer API driver/i2c_master.h I try to rewrite the code but ...
I found some very old code which seems to work but uses the API provided by driver/i2c.h. Since it is recommended to use the newer API driver/i2c_master.h I try to rewrite the code but ...
- Tue Jan 02, 2024 4:09 pm
- Forum: ESP-IDF
- Topic: Logging stops working after i2c_new_master_bus()
- Replies: 2
- Views: 8432
Logging stops working after i2c_new_master_bus()
I am using an ESP32-C3-DevLit-M1 and try to speak to a sensor via I2C. In order to do that I create a new I2C master bus using
esp_err_t i2c_new_master_bus(const i2c_master_bus_config_t *bus_config, i2c_master_bus_handle_t *ret_bus_handle); imported from i2c_master.h. When I call this function the ...
esp_err_t i2c_new_master_bus(const i2c_master_bus_config_t *bus_config, i2c_master_bus_handle_t *ret_bus_handle); imported from i2c_master.h. When I call this function the ...
- Wed Dec 27, 2023 1:52 pm
- Forum: ESP-IDF
- Topic: Upgrade to newer IDF version makes examples stop working
- Replies: 0
- Views: 4102
Upgrade to newer IDF version makes examples stop working
I am fairly new to the IDF framework and encountered problems with everything newer than 5.0.
Currently I am working with an ESP32C3 dev module and trying some display stuff over SPI. Under IDF v5.0 I got the simple spi_lcd_touch example working like a charm. I had to plug in my GPIOs, build and ...
Currently I am working with an ESP32C3 dev module and trying some display stuff over SPI. Under IDF v5.0 I got the simple spi_lcd_touch example working like a charm. I had to plug in my GPIOs, build and ...