Zephyr API 3.6.99
Loading...
Searching...
No Matches
rtc_fake.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Prevas A/S
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_RTC_RTC_FAKE_H_
8#define ZEPHYR_INCLUDE_DRIVERS_RTC_RTC_FAKE_H_
9
10#include <zephyr/drivers/rtc.h>
11#include <zephyr/fff.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_set_time, const struct device *, const struct rtc_time *);
18DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_get_time, const struct device *, struct rtc_time *);
19
20#ifdef CONFIG_RTC_ALARM
21DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_get_supported_fields, const struct device *, uint16_t,
22 uint16_t *);
23DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_set_time, const struct device *, uint16_t, uint16_t,
24 const struct rtc_time *);
25DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_get_time, const struct device *, uint16_t, uint16_t *,
26 struct rtc_time *);
27DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_is_pending, const struct device *, uint16_t);
28DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_set_callback, const struct device *, uint16_t,
29 rtc_alarm_callback, void *);
30#endif /* CONFIG_RTC_ALARM */
31
32#ifdef CONFIG_RTC_UPDATE
33DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_update_set_callback, const struct device *,
34 rtc_update_callback, void *);
35#endif /* CONFIG_RTC_UPDATE */
36
37#ifdef CONFIG_RTC_CALIBRATION
38DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_set_calibration, const struct device *, int32_t);
39DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_get_calibration, const struct device *, int32_t *);
40#endif /* CONFIG_RTC_CALIBRATION */
41
42#ifdef __cplusplus
43}
44#endif
45
46#endif /* ZEPHYR_INCLUDE_DRIVERS_RTC_RTC_FAKE_H_ */
#define DECLARE_FAKE_VALUE_FUNC(...)
Definition fff.h:8684
void(* rtc_alarm_callback)(const struct device *dev, uint16_t id, void *user_data)
RTC alarm triggered callback.
Definition rtc.h:91
void(* rtc_update_callback)(const struct device *dev, void *user_data)
RTC update event callback.
Definition rtc.h:81
Public real time clock driver API.
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Structure for storing date and time values with sub-second precision.
Definition rtc.h:61