Fork of Tangara with customizations
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/*
|
|
|
|
* Copyright 2023 jacqueline <me@jacqueline.id.au>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "dac.hpp"
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
#include "catch2/catch.hpp"
|
|
|
|
|
|
|
|
#include "drivers/gpios.hpp"
|
|
|
|
#include "drivers/i2c.hpp"
|
|
|
|
#include "i2c_fixture.hpp"
|
|
|
|
|
|
|
|
namespace drivers {
|
|
|
|
|
|
|
|
TEST_CASE("dac configuration", "[integration]") {
|
|
|
|
I2CFixture i2c;
|
|
|
|
IGpios expander;
|
|
|
|
cpp::result<AudioDac*, AudioDac::Error> dac_res = AudioDac::create(&expander);
|
|
|
|
REQUIRE(dac_res.has_value());
|
|
|
|
std::unique_ptr<AudioDac> dac(dac_res.value());
|
|
|
|
|
|
|
|
auto power_state = dac->ReadPowerState();
|
|
|
|
|
|
|
|
REQUIRE(power_state.first == true); // booted
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace drivers
|