|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Fake comparator driver. More...
Files | |
| file | fake_comp.h |
| Fake comparator driver API functions. | |
Functions | |
| int | comp_fake_comp_get_output (const struct device *) |
| Fake implementation of the comparator_driver_api::get_output driver operation. | |
| int | comp_fake_comp_set_trigger (const struct device *, enum comparator_trigger) |
| Fake implementation of the comparator_driver_api::set_trigger driver operation. | |
| int | comp_fake_comp_set_trigger_callback (const struct device *, comparator_callback_t, void *) |
| Fake implementation of the comparator_driver_api::set_trigger_callback driver operation. | |
| int | comp_fake_comp_trigger_is_pending (const struct device *) |
| Fake implementation of the comparator_driver_api::trigger_is_pending driver operation. | |
Fake comparator driver.
This is a Fake Function Framework (FFF) implementation of the Comparator API, provided for use in tests. It is enabled by CONFIG_COMPARATOR_FAKE_COMP and instantiated from zephyr,fake-comp devicetree nodes.
Each fake below is paired with an FFF control structure named after it with an additional _fake suffix, which tests use to set return values, install custom fakes, or inspect call counts and captured arguments. The control structures are not listed here; see Mocking via FFF.
Use return_val for fakes that only report status; a fake with output parameters must be driven with a custom_fake, as return_val leaves those parameters untouched.
When CONFIG_ZTEST is enabled, a ztest rule resets every fake before each test case.
| int comp_fake_comp_get_output | ( | const struct device * | ) |
#include <zephyr/drivers/comparator/fake_comp.h>
Fake implementation of the comparator_driver_api::get_output driver operation.
| int comp_fake_comp_set_trigger | ( | const struct device * | , |
| enum | comparator_trigger ) |
#include <zephyr/drivers/comparator/fake_comp.h>
Fake implementation of the comparator_driver_api::set_trigger driver operation.
| int comp_fake_comp_set_trigger_callback | ( | const struct device * | , |
| comparator_callback_t | , | ||
| void * | ) |
#include <zephyr/drivers/comparator/fake_comp.h>
Fake implementation of the comparator_driver_api::set_trigger_callback driver operation.
| int comp_fake_comp_trigger_is_pending | ( | const struct device * | ) |
#include <zephyr/drivers/comparator/fake_comp.h>
Fake implementation of the comparator_driver_api::trigger_is_pending driver operation.