I2C Implementation (#84)

This commit is contained in:
Ken Van Hoeylandt
2024-11-24 18:04:57 +01:00
committed by GitHub
parent 881c8517bf
commit d8731eaa17
51 changed files with 936 additions and 433 deletions
+42 -4
View File
@@ -7,11 +7,49 @@ bool twodotfour_bootstrap();
extern const tt::hal::sdcard::SdCard twodotfour_sdcard;
const tt::hal::Configuration yellow_board_24inch_cap = {
.bootstrap = &twodotfour_bootstrap,
.init_graphics = &twodotfour_lvgl_init,
.initPower = &twodotfour_bootstrap,
.initLvgl = &twodotfour_lvgl_init,
.display = {
.set_backlight_duty = &twodotfour_backlight_set
.setBacklightDuty = &twodotfour_backlight_set
},
.sdcard = &twodotfour_sdcard,
.power = nullptr
.power = nullptr,
.i2c = {
tt::hal::i2c::Configuration {
.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 = GPIO_PULLUP_DISABLE,
.scl_pullup_en = GPIO_PULLUP_DISABLE,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
},
tt::hal::i2c::Configuration {
.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 = GPIO_PULLUP_DISABLE,
.scl_pullup_en = GPIO_PULLUP_DISABLE,
.master = {
.clk_speed = 400000
},
.clk_flags = 0
}
}
}
};