Zephyr Project API 4.4.99
A Scalable Open Source RTOS
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
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_RTC_RTC_FAKE_H_
14#define ZEPHYR_INCLUDE_DRIVERS_RTC_RTC_FAKE_H_
15
16#include <zephyr/drivers/rtc.h>
17#include <zephyr/fff.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
44
46DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_set_time, const struct device *, const struct rtc_time *);
48DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_get_time, const struct device *, struct rtc_time *);
49
50#if defined(CONFIG_RTC_ALARM) || defined(__DOXYGEN__)
55DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_get_supported_fields, const struct device *, uint16_t,
56 uint16_t *);
61DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_set_time, const struct device *, uint16_t, uint16_t,
62 const struct rtc_time *);
67DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_get_time, const struct device *, uint16_t, uint16_t *,
68 struct rtc_time *);
73DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_is_pending, const struct device *, uint16_t);
78DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_alarm_set_callback, const struct device *, uint16_t,
79 rtc_alarm_callback, void *);
80#endif /* CONFIG_RTC_ALARM */
81
82#if defined(CONFIG_RTC_UPDATE) || defined(__DOXYGEN__)
87DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_update_set_callback, const struct device *,
88 rtc_update_callback, void *);
89#endif /* CONFIG_RTC_UPDATE */
90
91#if defined(CONFIG_RTC_CALIBRATION) || defined(__DOXYGEN__)
96DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_set_calibration, const struct device *, int32_t);
101DECLARE_FAKE_VALUE_FUNC(int, rtc_fake_get_calibration, const struct device *, int32_t *);
102#endif /* CONFIG_RTC_CALIBRATION */
103
107
108#ifdef __cplusplus
109}
110#endif
111
112#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:90
void(* rtc_update_callback)(const struct device *dev, void *user_data)
RTC update event callback.
Definition rtc.h:81
Main header file for real-time clock (RTC) 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:525
Structure for storing date and time values with sub-second precision.
Definition rtc.h:62