|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Fake regulator driver. More...
Files | |
| file | fake.h |
| Fake regulator driver API functions. | |
Fake regulator driver.
This is a Fake Function Framework (FFF) implementation of the Regulator API, provided for use in tests. It is enabled by CONFIG_REGULATOR_FAKE and instantiated from zephyr,fake-regulator 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.
A zephyr,fake-regulator node is instantiated as the regulator parent device and each of its child nodes as a regulator device.
regulator_fake_get_voltage() is given a default custom_fake returning 1 V, re-installed on every reset. Install your own custom_fake in the test case to change what it reports.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::count_current_limits driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::count_voltages driver operation.
| int regulator_fake_disable | ( | const struct device * | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::disable driver operation.
| int regulator_fake_enable | ( | const struct device * | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::enable driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::get_active_discharge driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::get_current_limit driver operation.
| int regulator_fake_get_error_flags | ( | const struct device * | , |
| regulator_error_flags_t * | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::get_error_flags driver operation.
| int regulator_fake_get_mode | ( | const struct device * | , |
| regulator_mode_t * | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::get_mode driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::get_voltage driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::list_current_limit driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::list_voltage driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::set_active_discharge driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::set_current_limit driver operation.
| int regulator_fake_set_mode | ( | const struct device * | , |
| regulator_mode_t | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::set_mode driver operation.
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_driver_api::set_voltage driver operation.
| int regulator_parent_fake_dvs_state_set | ( | const struct device * | , |
| regulator_dvs_state_t | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_parent_driver_api::dvs_state_set driver operation.
| int regulator_parent_fake_ship_mode | ( | const struct device * | ) |
#include <zephyr/drivers/regulator/fake.h>
Fake implementation of the regulator_parent_driver_api::ship_mode driver operation.