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) {
56
56
return true;
57
57
}
58
58
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
+
59
66
bool i2cIsInit (uint8_t i2c_num ) {
60
67
if (i2c_num >= SOC_I2C_NUM ) {
61
68
return false;
Original file line number Diff line number Diff line change 19
19
20
20
#include "soc/soc_caps.h"
21
21
#if SOC_I2C_SUPPORTED
22
+ #include "esp_idf_version.h"
22
23
23
24
#ifdef __cplusplus
24
25
extern "C" {
@@ -39,6 +40,10 @@ esp_err_t i2cWriteReadNonStop(
39
40
);
40
41
bool i2cIsInit (uint8_t i2c_num );
41
42
43
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
44
+ void * i2cBusHandle (uint8_t i2c_num );
45
+ #endif
46
+
42
47
#ifdef __cplusplus
43
48
}
44
49
#endif
You can’t perform that action at this time.
0 commit comments