1 /* 2 * Copyright (c) 2023 Bjarki Arge Andreasen 3 * Copyright (c) 2024 Andrew Featherstone 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef ZEPHYR_DRIVERS_RTC_RTC_UTILS_H_ 9 #define ZEPHYR_DRIVERS_RTC_RTC_UTILS_H_ 10 11 #include <stdbool.h> 12 #include <stdint.h> 13 14 #include <zephyr/drivers/rtc.h> 15 16 /** 17 * @brief Validate a datetime with a mask 18 * 19 * Ensure that any fields selected by mask contain a valid value. 20 * 21 * @param timeptr The time to set 22 * @param mask Mask of fields to validate 23 * 24 * @return true if the required fields are valid. 25 */ 26 bool rtc_utils_validate_rtc_time(const struct rtc_time *timeptr, uint16_t mask); 27 28 #endif /* ZEPHYR_DRIVERS_RTC_RTC_UTILS_H_ */ 29