Lines Matching full:bitrate

213  * @brief Get the sample point location for a given bitrate
215 * @param bitrate The bitrate in bits/second.
218 static uint16_t sample_point_for_bitrate(uint32_t bitrate) in sample_point_for_bitrate() argument
222 if (bitrate > 800000) { in sample_point_for_bitrate()
225 } else if (bitrate > 500000) { in sample_point_for_bitrate()
243 * @param bitrate Target bitrate in bits/s.
247 * @retval -EINVAL if the requested bitrate or sample point is out of range.
248 * @retval -ENOTSUP if the requested bitrate is not supported.
253 uint32_t bitrate, uint16_t sample_pnt) in can_calc_timing_internal() argument
262 if (bitrate == 0 || sample_pnt >= 1000) { in can_calc_timing_internal()
272 sample_pnt = sample_point_for_bitrate(bitrate); in can_calc_timing_internal()
275 for (prescaler = MAX(core_clock / (total_tq * bitrate), min->prescaler); in can_calc_timing_internal()
279 if (core_clock % (prescaler * bitrate)) { in can_calc_timing_internal()
284 total_tq = core_clock / (prescaler * bitrate); in can_calc_timing_internal()
319 uint32_t bitrate, uint16_t sample_pnt) in z_impl_can_calc_timing() argument
324 if (bitrate > 1000000) { in z_impl_can_calc_timing()
328 return can_calc_timing_internal(dev, res, min, max, bitrate, sample_pnt); in z_impl_can_calc_timing()
333 uint32_t bitrate, uint16_t sample_pnt) in z_impl_can_calc_timing_data() argument
338 if (bitrate > 8000000) { in z_impl_can_calc_timing_data()
342 return can_calc_timing_internal(dev, res, min, max, bitrate, sample_pnt); in z_impl_can_calc_timing_data()
381 int z_impl_can_set_bitrate(const struct device *dev, uint32_t bitrate) in z_impl_can_set_bitrate() argument
389 if ((bitrate < min) || (bitrate > max)) { in z_impl_can_set_bitrate()
393 sample_pnt = sample_point_for_bitrate(bitrate); in z_impl_can_set_bitrate()
394 ret = can_calc_timing(dev, &timing, bitrate, sample_pnt); in z_impl_can_set_bitrate()