// // Created by Stepan Usatiuk on 02.03.2025. // #ifndef CB_I2C_GLOBAL_HPP #define CB_I2C_GLOBAL_HPP #include "config.hpp" #include "driver/i2c_master.h" class I2cGlobal { public: static I2cGlobal& get(); i2c_master_bus_handle_t& get_bus_handle(); private: I2cGlobal(); static inline i2c_master_bus_config_t _i2c_mst_config = { .i2c_port = 0, .sda_io_num = I2C_SDA, .scl_io_num = I2C_SCL, .clk_source = I2C_CLK_SRC_DEFAULT, .glitch_ignore_cnt = 7, .flags = {.enable_internal_pullup = true, .allow_pd = true}, }; i2c_master_bus_handle_t _bus_handle; }; // namespace i2c_global #endif // CB_I2C_GLOBAL_HPP