i2c: support esp32h2

This commit is contained in:
laokaiyao
2022-01-04 19:48:12 +08:00
parent 7da023ceae
commit cf353c505a
28 changed files with 210 additions and 182 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*
@@ -318,6 +318,7 @@ struct I2CMasterFix {
i2c_port_t port;
};
#if CONFIG_SOC_I2C_SUPPORT_SLAVE
struct I2CSlaveFix {
I2CSlaveFix(CreateAnd flags, i2c_port_t port_arg = 0, size_t buffer_size = 64) : i2c_conf(), port(port_arg)
{
@@ -344,6 +345,7 @@ struct I2CSlaveFix {
i2c_config_t i2c_conf;
i2c_port_t port;
};
#endif // CONFIG_SOC_I2C_SUPPORT_SLAVE
struct I2CCmdLinkFix
{
@@ -376,6 +376,7 @@ TEST_CASE("I2CMaster syncronous transfer (read and write)")
}
}
#if SOC_I2C_SUPPORT_SLAVE
TEST_CASE("I2CSlave parameter configuration fails")
{
CMockFixture fix;
@@ -458,3 +459,4 @@ TEST_CASE("I2CSlave read calls driver functions correctly")
CHECK(read_buffer[i] == WRITE_BUFFER[i]);
}
}
#endif // SOC_I2C_SUPPORT_SLAVE