17#include "pw_bytes/span.h"
18#include "pw_function/function.h"
19#include "pw_i2c/address.h"
20#include "pw_i2c/responder.h"
21#include "pw_result/result.h"
22#include "pw_status/status.h"
23#include "pw_unit_test/framework.h"
25namespace pw::i2c::test {
43 bool OnStop()
override {
return on_stop_cb(); }
46 on_start_read_cb = std::move(cb);
50 on_start_write_cb = std::move(cb);
54 on_write_cb = std::move(cb);
57 void SetOnReadCb(
pw::Function<Result<ConstByteSpan>()>&& cb) {
58 on_read_cb = std::move(cb);
61 void SetOnStopCb(
pw::Function<
bool()>&& cb) { on_stop_cb = std::move(cb); }
Definition: responder.h:27
Definition: responder.h:87
Definition: responder_test_interface.h:83
virtual Status SimulateInitiatorWrite(ConstByteSpan write_data, bool send_stop)=0
virtual Responder & GetResponder()=0
virtual Status SimulateInitiatorRead(ByteSpan buffer, bool send_stop)=0
Definition: responder_test_interface.h:33
bool OnWrite(ConstByteSpan data) override
Definition: responder_test_interface.h:39
Result< ConstByteSpan > OnRead() override
Definition: responder_test_interface.h:41
bool OnStop() override
Definition: responder_test_interface.h:43
bool OnStartRead() override
Definition: responder_test_interface.h:35
bool OnStartWrite() override
Definition: responder_test_interface.h:37
Definition: framework_backend.h:723
fit::function_impl< function_internal::config::kInlineCallableSize, !function_internal::config::kEnableDynamicAllocation, FunctionType, PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE > Function
Definition: function.h:73