Lines Matching refs:xt_clock_adj
209 static int am1805_set_calibration(const struct device *dev, int32_t xt_clock_adj) in am1805_set_calibration() argument
218 if (xt_clock_adj < -320 || xt_clock_adj > 127) { in am1805_set_calibration()
219 LOG_DBG("Cannot be calibrated adj = %d\n", xt_clock_adj); in am1805_set_calibration()
221 } else if (xt_clock_adj < -256) { in am1805_set_calibration()
224 xt_calib_value = ((uint8_t)(xt_clock_adj + 192) >> 1); in am1805_set_calibration()
227 } else if (xt_clock_adj < -192) { in am1805_set_calibration()
230 xt_calib_value = (uint8_t)(xt_clock_adj + 192); in am1805_set_calibration()
232 } else if (xt_clock_adj < -128) { in am1805_set_calibration()
235 xt_calib_value = (uint8_t)(xt_clock_adj + 128); in am1805_set_calibration()
237 } else if (xt_clock_adj < -64) { in am1805_set_calibration()
240 xt_calib_value = (uint8_t)(xt_clock_adj + 64); in am1805_set_calibration()
242 } else if (xt_clock_adj < 64) { in am1805_set_calibration()
245 xt_calib_value = (uint8_t)(xt_clock_adj); in am1805_set_calibration()
247 } else if (xt_clock_adj < 128) { in am1805_set_calibration()
250 xt_calib_value = ((uint8_t)(xt_clock_adj >> 1)); in am1805_set_calibration()