Lines Matching full:max
151 * @param max Pointer to the maximum supported timing parameter values.
156 const struct can_timing *min, const struct can_timing *max) in update_sample_pnt() argument
158 uint16_t tseg1_max = max->phase_seg1 + max->prop_seg; in update_sample_pnt()
165 tseg2 = CLAMP(tseg2, min->phase_seg2, max->phase_seg2); in update_sample_pnt()
174 if (tseg2 > max->phase_seg2) { in update_sample_pnt()
190 res->prop_seg = CLAMP(tseg1 / 2, min->prop_seg, max->prop_seg); in update_sample_pnt()
193 if (res->phase_seg1 > max->phase_seg1) { in update_sample_pnt()
195 res->phase_seg1 = max->phase_seg1; in update_sample_pnt()
242 * @param max Pointer to the maximum supported timing parameter values.
252 const struct can_timing *min, const struct can_timing *max, in can_calc_timing_internal() argument
255 uint32_t total_tq = CAN_SYNC_SEG + max->prop_seg + max->phase_seg1 + max->phase_seg2; in can_calc_timing_internal()
275 for (prescaler = MAX(core_clock / (total_tq * bitrate), min->prescaler); in can_calc_timing_internal()
276 prescaler <= max->prescaler; in can_calc_timing_internal()
286 err = update_sample_pnt(total_tq, sample_pnt, &tmp_res, min, max); in can_calc_timing_internal()
313 res->sjw = CLAMP(res->sjw, min->sjw, max->sjw); in can_calc_timing_internal()
322 const struct can_timing *max = can_get_timing_max(dev); in z_impl_can_calc_timing() local
328 return can_calc_timing_internal(dev, res, min, max, bitrate, sample_pnt); in z_impl_can_calc_timing()
336 const struct can_timing *max = can_get_timing_data_max(dev); in z_impl_can_calc_timing_data() local
342 return can_calc_timing_internal(dev, res, min, max, bitrate, sample_pnt); in z_impl_can_calc_timing_data()
348 const struct can_timing *max) in check_timing_in_range() argument
350 if (!IN_RANGE(timing->sjw, min->sjw, max->sjw) || in check_timing_in_range()
351 !IN_RANGE(timing->prop_seg, min->prop_seg, max->prop_seg) || in check_timing_in_range()
352 !IN_RANGE(timing->phase_seg1, min->phase_seg1, max->phase_seg1) || in check_timing_in_range()
353 !IN_RANGE(timing->phase_seg2, min->phase_seg2, max->phase_seg2) || in check_timing_in_range()
354 !IN_RANGE(timing->prescaler, min->prescaler, max->prescaler)) { in check_timing_in_range()
370 const struct can_timing *max = can_get_timing_max(dev); in z_impl_can_set_timing() local
373 err = check_timing_in_range(timing, min, max); in z_impl_can_set_timing()
385 uint32_t max = can_get_bitrate_max(dev); in z_impl_can_set_bitrate() local
389 if ((bitrate < min) || (bitrate > max)) { in z_impl_can_set_bitrate()
412 const struct can_timing *max = can_get_timing_data_max(dev); in z_impl_can_set_timing_data() local
419 err = check_timing_in_range(timing_data, min, max); in z_impl_can_set_timing_data()
431 uint32_t max = can_get_bitrate_max(dev); in z_impl_can_set_bitrate_data() local
435 if ((bitrate_data < min) || (bitrate_data > max)) { in z_impl_can_set_bitrate_data()