I2C board settings updated (#86)

This commit is contained in:
Ken Van Hoeylandt 2024-11-24 21:39:01 +01:00 committed by GitHub
parent c8f63adba4
commit caa8756998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 46 additions and 5 deletions

View File

@ -7,8 +7,8 @@ extern const tt::hal::Configuration m5stack_core2 = {
.sdcard = &m5stack_sdcard,
.power = &m5stack_power,
.i2c = {
// Internal
tt::hal::i2c::Configuration {
.name = "Internal",
.port = I2C_NUM_0,
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = false,
@ -26,8 +26,8 @@ extern const tt::hal::Configuration m5stack_core2 = {
.clk_flags = 0
}
},
// External (Grove)
tt::hal::i2c::Configuration {
.name = "External", // (Grove)
.port = I2C_NUM_1,
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = true,

View File

@ -9,8 +9,8 @@ const tt::hal::Configuration m5stack_cores3 = {
.sdcard = &m5stack_sdcard,
.power = &m5stack_power,
.i2c = {
// Internal
tt::hal::i2c::Configuration {
.name = "Internal",
.port = I2C_NUM_0,
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = false,
@ -28,8 +28,8 @@ const tt::hal::Configuration m5stack_cores3 = {
.clk_flags = 0
}
},
// External (Grove)
tt::hal::i2c::Configuration {
.name = "External", // Grove
.port = I2C_NUM_1,
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = true,

View File

@ -10,5 +10,44 @@ extern const tt::hal::Configuration waveshare_s3_touch = {
.display = { .setBacklightDuty = nullptr },
.sdcard = nullptr,
.power = nullptr,
.i2c = {}
.i2c = {
tt::hal::i2c::Configuration {
.name = "First",
.port = I2C_NUM_0,
.initMode = tt::hal::i2c::InitDisabled,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_NC,
.scl_io_num = GPIO_NUM_NC,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
},
tt::hal::i2c::Configuration {
.name = "Second",
.port = I2C_NUM_1,
.initMode = tt::hal::i2c::InitDisabled,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_NC,
.scl_io_num = GPIO_NUM_NC,
.sda_pullup_en = true,
.scl_pullup_en = true,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
}
}
};

View File

@ -16,6 +16,7 @@ const tt::hal::Configuration yellow_board_24inch_cap = {
.power = nullptr,
.i2c = {
tt::hal::i2c::Configuration {
.name = "First",
.port = I2C_NUM_0,
.initMode = tt::hal::i2c::InitDisabled,
.canReinit = true,
@ -34,6 +35,7 @@ const tt::hal::Configuration yellow_board_24inch_cap = {
}
},
tt::hal::i2c::Configuration {
.name = "Second",
.port = I2C_NUM_1,
.initMode = tt::hal::i2c::InitDisabled,
.canReinit = true,