Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Fake comparator driver. More...

Files

file  fake_comp.h
 Fake comparator driver API functions.

Functions

 DECLARE_FAKE_VALUE_FUNC (int, comp_fake_comp_get_output, const struct device *)
 @fake_of{comparator_driver_api::get_output}
 DECLARE_FAKE_VALUE_FUNC (int, comp_fake_comp_set_trigger, const struct device *, enum comparator_trigger)
 @fake_of{comparator_driver_api::set_trigger}
 DECLARE_FAKE_VALUE_FUNC (int, comp_fake_comp_set_trigger_callback, const struct device *, comparator_callback_t, void *)
 @fake_of{comparator_driver_api::set_trigger_callback}
 DECLARE_FAKE_VALUE_FUNC (int, comp_fake_comp_trigger_is_pending, const struct device *)
 @fake_of{comparator_driver_api::trigger_is_pending}

Detailed Description

Fake comparator driver.

@driver_fake{comparator_interface,CONFIG_COMPARATOR_FAKE_COMP,zephyr\,fake-comp}

const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(fake_comp));
comp_fake_comp_get_output_fake.return_val = 1;
zassert_equal(1, comp_fake_comp_get_output_fake.call_count);
zassert_equal(dev, comp_fake_comp_get_output_fake.arg0_val);
int comparator_get_output(const struct device *dev)
Get comparator's output state.
#define DEVICE_DT_GET(node_id)
Get a device reference from a devicetree node identifier.
Definition device.h:317
#define DT_NODELABEL(label)
Get a node identifier for a node label.
Definition devicetree.h:197
#define zassert_equal(a, b,...)
Assert that a equals b.
Definition ztest_assert.h:321
Runtime device structure (in ROM) per driver instance.
Definition device.h:525

Function Documentation

◆ DECLARE_FAKE_VALUE_FUNC() [1/4]

DECLARE_FAKE_VALUE_FUNC ( int ,
comp_fake_comp_get_output ,
const struct device *  )

◆ DECLARE_FAKE_VALUE_FUNC() [2/4]

DECLARE_FAKE_VALUE_FUNC ( int ,
comp_fake_comp_set_trigger ,
const struct device * ,
enum comparator_trigger )

◆ DECLARE_FAKE_VALUE_FUNC() [3/4]

DECLARE_FAKE_VALUE_FUNC ( int ,
comp_fake_comp_set_trigger_callback ,
const struct device * ,
comparator_callback_t ,
void *  )

◆ DECLARE_FAKE_VALUE_FUNC() [4/4]

DECLARE_FAKE_VALUE_FUNC ( int ,
comp_fake_comp_trigger_is_pending ,
const struct device *  )