parent
2d04e13cc6
commit
8db57d6dc5
@ -1,31 +0,0 @@ |
||||
/*
|
||||
* Copyright 2023 jacqueline <me@jacqueline.id.au> |
||||
* |
||||
* SPDX-License-Identifier: GPL-3.0-only |
||||
*/ |
||||
|
||||
#include "drivers/gpios.hpp" |
||||
|
||||
#include "catch2/catch.hpp" |
||||
|
||||
#include "drivers/i2c.hpp" |
||||
#include "i2c_fixture.hpp" |
||||
|
||||
namespace drivers { |
||||
|
||||
TEST_CASE("gpio expander", "[integration]") { |
||||
I2CFixture i2c; |
||||
IGpios expander; |
||||
SECTION("with() writes when ") { |
||||
// Initial value.
|
||||
expander.Read(); |
||||
REQUIRE(expander.get_input(IGpios::KEY_DOWN) == true); |
||||
|
||||
expander.with([&](auto& gpio) { gpio.set_pin(IGpios::KEY_DOWN, false); }); |
||||
|
||||
expander.Read(); |
||||
REQUIRE(expander.get_input(IGpios::KEY_DOWN) == false); |
||||
} |
||||
} |
||||
|
||||
} // namespace drivers
|
@ -1,7 +1,5 @@ |
||||
/* |
||||
* Copyright 2023 jacqueline <me@jacqueline.id.au> |
||||
* |
||||
* SPDX-License-Identifier: GPL-3.0-only |
||||
*/ |
||||
# Copyright 2023 jacqueline <me@jacqueline.id.au> |
||||
# |
||||
# SPDX-License-Identifier: GPL-3.0-only |
||||
|
||||
idf_component_register(INCLUDE_DIRS "." REQUIRES drivers) |
||||
|
@ -1,10 +1,8 @@ |
||||
/* |
||||
* Copyright 2023 jacqueline <me@jacqueline.id.au> |
||||
* |
||||
* SPDX-License-Identifier: GPL-3.0-only |
||||
*/ |
||||
# Copyright 2023 jacqueline <me@jacqueline.id.au> |
||||
# |
||||
# SPDX-License-Identifier: GPL-3.0-only |
||||
|
||||
idf_component_register( |
||||
SRCS "main.cpp" |
||||
INCLUDE_DIRS "." |
||||
REQUIRES "catch2 dev_console") |
||||
REQUIRES "catch2 tangara") |
||||
|
Loading…
Reference in new issue