Added I2C settings app (#85)

This commit is contained in:
Ken Van Hoeylandt
2024-11-24 21:31:15 +01:00
committed by GitHub
parent d8731eaa17
commit c8f63adba4
19 changed files with 186 additions and 56 deletions
-15
View File
@@ -6,21 +6,6 @@
#define TAG "tdeck"
static bool init_i2c() {
const i2c_config_t i2c_conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_18,
.scl_io_num = GPIO_NUM_8,
.sda_pullup_en = GPIO_PULLUP_DISABLE,
.scl_pullup_en = GPIO_PULLUP_DISABLE,
.master = {
.clk_speed = 400000
}
};
return i2c_param_config(TDECK_I2C_BUS_HANDLE, &i2c_conf) == ESP_OK && i2c_driver_install(TDECK_I2C_BUS_HANDLE, i2c_conf.mode, 0, 0, 0) == ESP_OK;
}
static bool init_spi() {
spi_bus_config_t bus_config = {
.mosi_io_num = TDECK_SPI_PIN_MOSI,
+5 -5
View File
@@ -27,8 +27,8 @@ extern const tt::hal::Configuration lilygo_tdeck = {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_18,
.scl_io_num = GPIO_NUM_8,
.sda_pullup_en = GPIO_PULLUP_DISABLE,
.scl_pullup_en = GPIO_PULLUP_DISABLE,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
@@ -37,7 +37,7 @@ extern const tt::hal::Configuration lilygo_tdeck = {
},
tt::hal::i2c::Configuration {
.port = I2C_NUM_1,
.initMode = tt::hal::i2c::InitDisabled,
.initMode = tt::hal::i2c::InitByTactility,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
@@ -45,8 +45,8 @@ extern const tt::hal::Configuration lilygo_tdeck = {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_43,
.scl_io_num = GPIO_NUM_44,
.sda_pullup_en = GPIO_PULLUP_DISABLE,
.scl_pullup_en = GPIO_PULLUP_DISABLE,
.sda_pullup_en = false,
.scl_pullup_en = false,
.master = {
.clk_speed = 400000
},