Lines Matching refs:calibration
498 static int rtc_sam_set_calibration(const struct device *dev, int32_t calibration) in rtc_sam_set_calibration() argument
508 if ((calibration < RTC_SAM_CALIBRATE_PPB_MIN) || in rtc_sam_set_calibration()
509 (calibration > RTC_SAM_CALIBRATE_PPB_MAX)) { in rtc_sam_set_calibration()
514 if (calibration < 0) { in rtc_sam_set_calibration()
516 calibration = -calibration; in rtc_sam_set_calibration()
545 if (calibration < RTC_SAM_CALIBRATE_PPB_QUANTA) { in rtc_sam_set_calibration()
548 } else if (calibration < RTC_SAM_CALIBRATE_PPB_LOW_SCALE) { in rtc_sam_set_calibration()
550 slow_clock_calibration = (uint32_t)((3906000 / (20 * calibration)) - 1); in rtc_sam_set_calibration()
553 slow_clock_calibration = (uint32_t)((3906000 / calibration) - 1); in rtc_sam_set_calibration()
586 static int rtc_sam_get_calibration(const struct device *dev, int32_t *calibration) in rtc_sam_get_calibration() argument
594 if (calibration == NULL) { in rtc_sam_get_calibration()
604 *calibration = 0; in rtc_sam_get_calibration()
606 *calibration = 3906000 / (correction + 1); in rtc_sam_get_calibration()
608 *calibration = 3906000 / ((correction + 1) * 20); in rtc_sam_get_calibration()
612 *calibration = -*calibration; in rtc_sam_get_calibration()