File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ static bool i2cDetachBus(void *bus_i2c_num) {
5656 return true;
5757}
5858
59+ void * i2cBusHandle (uint8_t i2c_num ) {
60+ if (i2c_num >= SOC_I2C_NUM ) {
61+ return NULL ;
62+ }
63+ return bus [i2c_num ].bus_handle ;
64+ }
65+
5966bool i2cIsInit (uint8_t i2c_num ) {
6067 if (i2c_num >= SOC_I2C_NUM ) {
6168 return false;
Original file line number Diff line number Diff line change 1919
2020#include "soc/soc_caps.h"
2121#if SOC_I2C_SUPPORTED
22+ #include "esp_idf_version.h"
2223
2324#ifdef __cplusplus
2425extern "C" {
@@ -39,6 +40,10 @@ esp_err_t i2cWriteReadNonStop(
3940);
4041bool i2cIsInit (uint8_t i2c_num );
4142
43+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
44+ void * i2cBusHandle (uint8_t i2c_num );
45+ #endif
46+
4247#ifdef __cplusplus
4348}
4449#endif
You can’t perform that action at this time.
0 commit comments