Lines Matching +full:bit +full:- +full:per +full:- +full:seconds
5 * SPDX-License-Identifier: Apache-2.0
39 #define RTC_ALARM_TIME_MASK_SECOND BIT(0)
40 #define RTC_ALARM_TIME_MASK_MINUTE BIT(1)
41 #define RTC_ALARM_TIME_MASK_HOUR BIT(2)
42 #define RTC_ALARM_TIME_MASK_MONTHDAY BIT(3)
43 #define RTC_ALARM_TIME_MASK_MONTH BIT(4)
44 #define RTC_ALARM_TIME_MASK_YEAR BIT(5)
45 #define RTC_ALARM_TIME_MASK_WEEKDAY BIT(6)
46 #define RTC_ALARM_TIME_MASK_YEARDAY BIT(7)
47 #define RTC_ALARM_TIME_MASK_NSEC BIT(8)
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
62 int tm_sec; /**< Seconds [0, 59] */
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) */
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);
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);
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) {
249 return -ENOSYS;
252 return DEVICE_API_GET(rtc, dev)->alarm_get_supported_fields(dev, id, mask);
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) {
285 return -ENOSYS;
288 return DEVICE_API_GET(rtc, dev)->alarm_set_time(dev, id, mask, timeptr);
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) {
313 return -ENOSYS;
316 return DEVICE_API_GET(rtc, dev)->alarm_get_time(dev, id, mask, timeptr);
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) {
339 return -ENOSYS;
342 return DEVICE_API_GET(rtc, dev)->alarm_is_pending(dev, id);
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) {
378 return -ENOSYS;
381 return DEVICE_API_GET(rtc, dev)->alarm_set_callback(dev, id, callback, user_data);
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) {
421 return -ENOSYS;
424 return DEVICE_API_GET(rtc, dev)->update_set_callback(dev, callback, user_data);
449 * @param calibration Calibration to set in parts per billion
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) {
461 return -ENOSYS;
464 return DEVICE_API_GET(rtc, dev)->set_calibration(dev, calibration);
471 * @param calibration Destination for calibration in parts per billion
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) {
482 return -ENOSYS;
485 return DEVICE_API_GET(rtc, dev)->get_calibration(dev, calibration);
517 * @return The required calibration in parts per billion
523 return (int32_t)((1000000000000000000LL / frequency) - 1000000000);