|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Fake RTC driver. More...
Files | |
| file | rtc_fake.h |
| Fake RTC driver API functions. | |
Functions | |
| int | rtc_fake_set_time (const struct device *, const struct rtc_time *) |
| Fake implementation of the rtc_driver_api::set_time driver operation. | |
| int | rtc_fake_get_time (const struct device *, struct rtc_time *) |
| Fake implementation of the rtc_driver_api::get_time driver operation. | |
| int | rtc_fake_alarm_get_supported_fields (const struct device *, uint16_t, uint16_t *) |
| Fake implementation of the rtc_driver_api::alarm_get_supported_fields driver operation. | |
| int | rtc_fake_alarm_set_time (const struct device *, uint16_t, uint16_t, const struct rtc_time *) |
| Fake implementation of the rtc_driver_api::alarm_set_time driver operation. | |
| int | rtc_fake_alarm_get_time (const struct device *, uint16_t, uint16_t *, struct rtc_time *) |
| Fake implementation of the rtc_driver_api::alarm_get_time driver operation. | |
| int | rtc_fake_alarm_is_pending (const struct device *, uint16_t) |
| Fake implementation of the rtc_driver_api::alarm_is_pending driver operation. | |
| int | rtc_fake_alarm_set_callback (const struct device *, uint16_t, rtc_alarm_callback, void *) |
| Fake implementation of the rtc_driver_api::alarm_set_callback driver operation. | |
| int | rtc_fake_update_set_callback (const struct device *, rtc_update_callback, void *) |
| Fake implementation of the rtc_driver_api::update_set_callback driver operation. | |
| int | rtc_fake_set_calibration (const struct device *, int32_t) |
| Fake implementation of the rtc_driver_api::set_calibration driver operation. | |
| int | rtc_fake_get_calibration (const struct device *, int32_t *) |
| Fake implementation of the rtc_driver_api::get_calibration driver operation. | |
Fake RTC driver.
This is a Fake Function Framework (FFF) implementation of the RTC API, provided for use in tests. It is enabled by CONFIG_RTC_FAKE and instantiated from zephyr,fake-rtc 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.
#include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::alarm_get_supported_fields driver operation.
CONFIG_RTC_ALARM. #include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::alarm_get_time driver operation.
CONFIG_RTC_ALARM. #include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::alarm_is_pending driver operation.
CONFIG_RTC_ALARM. | int rtc_fake_alarm_set_callback | ( | const struct device * | , |
| uint16_t | , | ||
| rtc_alarm_callback | , | ||
| void * | ) |
#include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::alarm_set_callback driver operation.
CONFIG_RTC_ALARM. | int rtc_fake_alarm_set_time | ( | const struct device * | , |
| uint16_t | , | ||
| uint16_t | , | ||
| const struct rtc_time * | ) |
#include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::alarm_set_time driver operation.
CONFIG_RTC_ALARM. #include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::get_calibration driver operation.
CONFIG_RTC_CALIBRATION. #include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::get_time driver operation.
#include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::set_calibration driver operation.
CONFIG_RTC_CALIBRATION. #include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::set_time driver operation.
| int rtc_fake_update_set_callback | ( | const struct device * | , |
| rtc_update_callback | , | ||
| void * | ) |
#include <zephyr/drivers/rtc/rtc_fake.h>
Fake implementation of the rtc_driver_api::update_set_callback driver operation.
CONFIG_RTC_UPDATE.