Implemented I2C scanner app (#97)

This commit is contained in:
Ken Van Hoeylandt
2024-11-28 21:42:18 +01:00
committed by GitHub
parent 6094b9c3f2
commit 3f62ec2efa
19 changed files with 451 additions and 44 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ typedef struct {
} KeyboardData;
static inline bool keyboard_i2c_read(uint8_t* output) {
return tt::hal::i2c::masterRead(TDECK_KEYBOARD_I2C_BUS_HANDLE, TDECK_KEYBOARD_SLAVE_ADDRESS, output, 1);
return tt::hal::i2c::masterRead(TDECK_KEYBOARD_I2C_BUS_HANDLE, TDECK_KEYBOARD_SLAVE_ADDRESS, output, 1, 100 / portTICK_PERIOD_MS);
}
void keyboard_wait_for_response() {
+2 -2
View File
@@ -18,11 +18,11 @@ extern const tt::hal::Configuration lilygo_tdeck = {
.power = nullptr,
.i2c = {
tt::hal::i2c::Configuration {
.name = "Internal",
.port = I2C_NUM_0,
.initMode = tt::hal::i2c::InitByTactility,
.canReinit = false,
.hasMutableConfiguration = false,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_18,
@@ -36,11 +36,11 @@ extern const tt::hal::Configuration lilygo_tdeck = {
}
},
tt::hal::i2c::Configuration {
.name = "External",
.port = I2C_NUM_1,
.initMode = tt::hal::i2c::InitByTactility,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_43,
@@ -13,7 +13,6 @@ extern const tt::hal::Configuration m5stack_core2 = {
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = false,
.hasMutableConfiguration = false,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_21,
@@ -32,7 +31,6 @@ extern const tt::hal::Configuration m5stack_core2 = {
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_32,
@@ -15,7 +15,6 @@ const tt::hal::Configuration m5stack_cores3 = {
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = false,
.hasMutableConfiguration = false,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_12,
@@ -34,7 +33,6 @@ const tt::hal::Configuration m5stack_cores3 = {
.initMode = tt::hal::i2c::InitByExternal,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = GPIO_NUM_2,
@@ -37,7 +37,6 @@ extern const tt::hal::Configuration sim_hardware = {
.initMode = tt::hal::i2c::InitByTactility,
.canReinit = false,
.hasMutableConfiguration = false,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = 1,
@@ -56,7 +55,6 @@ extern const tt::hal::Configuration sim_hardware = {
.initMode = tt::hal::i2c::InitByTactility,
.canReinit = true,
.hasMutableConfiguration = true,
.timeout = 1000,
.config = (i2c_config_t) {
.mode = I2C_MODE_MASTER,
.sda_io_num = 1,
@@ -17,7 +17,6 @@ extern const tt::hal::Configuration waveshare_s3_touch = {
.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,
@@ -36,7 +35,6 @@ extern const tt::hal::Configuration waveshare_s3_touch = {
.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,
-2
View File
@@ -21,7 +21,6 @@ const tt::hal::Configuration yellow_board_24inch_cap = {
.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,
@@ -40,7 +39,6 @@ const tt::hal::Configuration yellow_board_24inch_cap = {
.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,