Lines Matching +full:time +full:- +full:out
5 * SPDX-License-Identifier: Apache-2.0
10 * @brief Public real time clock driver API
34 * @brief Mask for alarm time fields to enable when setting alarm time
35 * @name RTC Alarm Time Mask
53 * @brief Structure for storing date and time values with sub-second precision.
55 * @details The structure is 1-1 mapped to the struct tm for the members
56 * \p tm_sec to \p tm_isdst making it compatible with the standard time library.
67 int tm_year; /**< Year - 1900 */
68 int tm_wday; /**< Day of the week [0, 6] (Sunday = 0) (Unknown = -1) */
69 int tm_yday; /**< Day of the year [0, 365] (Unknown = -1) */
70 int tm_isdst; /**< Daylight saving time flag [-1] (Unknown = -1) */
101 * @brief API for setting RTC time
107 * @brief API for getting RTC time
113 * @brief API for getting the supported fields of the RTC alarm time
120 * @brief API for setting RTC alarm time
127 * @brief API for getting RTC alarm time
189 * @brief API for setting RTC time.
192 * @param timeptr The time to set
195 * @return -EINVAL if RTC time is invalid or exceeds hardware capabilities
196 * @return -errno code if failure
202 return DEVICE_API_GET(rtc, dev)->set_time(dev, timeptr); in z_impl_rtc_set_time()
206 * @brief API for getting RTC time.
209 * @param timeptr Destination for the time
212 * @return -ENODATA if RTC time has not been set
213 * @return -errno code if failure
219 return DEVICE_API_GET(rtc, dev)->get_time(dev, timeptr); in z_impl_rtc_get_time()
229 * @brief API for getting the supported fields of the RTC alarm time.
233 * @param mask Mask of fields in the alarm time which are supported
238 * @return -EINVAL if id is out of range or time is invalid
239 * @return -ENOTSUP if API is not supported by hardware
240 * @return -errno code if failure
248 if (DEVICE_API_GET(rtc, dev)->alarm_get_supported_fields == NULL) { in z_impl_rtc_alarm_get_supported_fields()
249 return -ENOSYS; in z_impl_rtc_alarm_get_supported_fields()
252 return DEVICE_API_GET(rtc, dev)->alarm_get_supported_fields(dev, id, mask); in z_impl_rtc_alarm_get_supported_fields()
256 * @brief API for setting RTC alarm time.
258 * @details To enable an RTC alarm, one or more fields of the RTC alarm time
259 * must be enabled. The mask designates which fields of the RTC alarm time to
261 * alarm will trigger when all enabled fields of the alarm time match the RTC
262 * time.
266 * @param mask Mask of fields in the alarm time to enable
267 * @param timeptr The alarm time to set
274 * @return -EINVAL if id is out of range or time is invalid
275 * @return -ENOTSUP if API is not supported by hardware
276 * @return -errno code if failure
284 if (DEVICE_API_GET(rtc, dev)->alarm_set_time == NULL) { in z_impl_rtc_alarm_set_time()
285 return -ENOSYS; in z_impl_rtc_alarm_set_time()
288 return DEVICE_API_GET(rtc, dev)->alarm_set_time(dev, id, mask, timeptr); in z_impl_rtc_alarm_set_time()
292 * @brief API for getting RTC alarm time.
296 * @param mask Destination for mask of fields which are enabled in the alarm time
297 * @param timeptr Destination for the alarm time
302 * @return -EINVAL if id is out of range
303 * @return -ENOTSUP if API is not supported by hardware
304 * @return -errno code if failure
312 if (DEVICE_API_GET(rtc, dev)->alarm_get_time == NULL) { in z_impl_rtc_alarm_get_time()
313 return -ENOSYS; in z_impl_rtc_alarm_get_time()
316 return DEVICE_API_GET(rtc, dev)->alarm_get_time(dev, id, mask, timeptr); in z_impl_rtc_alarm_get_time()
330 * @return -EINVAL if id is out of range
331 * @return -ENOTSUP if API is not supported by hardware
332 * @return -errno code if failure
338 if (DEVICE_API_GET(rtc, dev)->alarm_is_pending == NULL) { in z_impl_rtc_alarm_is_pending()
339 return -ENOSYS; in z_impl_rtc_alarm_is_pending()
342 return DEVICE_API_GET(rtc, dev)->alarm_is_pending(dev, id); in z_impl_rtc_alarm_is_pending()
367 * @return -EINVAL if id is out of range
368 * @return -ENOTSUP if API is not supported by hardware
369 * @return -errno code if failure
377 if (DEVICE_API_GET(rtc, dev)->alarm_set_callback == NULL) { in z_impl_rtc_alarm_set_callback()
378 return -ENOSYS; in z_impl_rtc_alarm_set_callback()
381 return DEVICE_API_GET(rtc, dev)->alarm_set_callback(dev, id, callback, user_data); in z_impl_rtc_alarm_set_callback()
399 * callback. The update callback will be invoked every time the
411 * @return -ENOTSUP if API is not supported by hardware
412 * @return -errno code if failure
420 if (DEVICE_API_GET(rtc, dev)->update_set_callback == NULL) { in z_impl_rtc_update_set_callback()
421 return -ENOSYS; in z_impl_rtc_update_set_callback()
424 return DEVICE_API_GET(rtc, dev)->update_set_callback(dev, callback, user_data); in z_impl_rtc_update_set_callback()
452 * @return -EINVAL if calibration is out of range
453 * @return -ENOTSUP if API is not supported by hardware
454 * @return -errno code if failure
460 if (DEVICE_API_GET(rtc, dev)->set_calibration == NULL) { in z_impl_rtc_set_calibration()
461 return -ENOSYS; in z_impl_rtc_set_calibration()
464 return DEVICE_API_GET(rtc, dev)->set_calibration(dev, calibration); in z_impl_rtc_set_calibration()
474 * @return -ENOTSUP if API is not supported by hardware
475 * @return -errno code if failure
481 if (DEVICE_API_GET(rtc, dev)->get_calibration == NULL) { in z_impl_rtc_get_calibration()
482 return -ENOSYS; in z_impl_rtc_get_calibration()
485 return DEVICE_API_GET(rtc, dev)->get_calibration(dev, calibration); in z_impl_rtc_get_calibration()
523 return (int32_t)((1000000000000000000LL / frequency) - 1000000000); in rtc_calibration_from_frequency()