|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Fake PWM driver. More...
Files | |
| file | pwm_fake.h |
| Fake PWM driver API functions. | |
Functions | |
| int | fake_pwm_set_cycles (const struct device *, uint32_t, uint32_t, uint32_t, pwm_flags_t) |
| Fake implementation of the pwm_driver_api::set_cycles driver operation. | |
Fake PWM driver.
This is a Fake Function Framework (FFF) implementation of the PWM API, provided for use in tests. It is enabled by CONFIG_PWM_FAKE and instantiated from zephyr,fake-pwm 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 fake_pwm_set_cycles | ( | const struct device * | , |
| uint32_t | , | ||
| uint32_t | , | ||
| uint32_t | , | ||
| pwm_flags_t | ) |
#include <zephyr/drivers/pwm/pwm_fake.h>
Fake implementation of the pwm_driver_api::set_cycles driver operation.