Home
last modified time | relevance | path

Searched refs:CLAMP (Results 1 – 25 of 70) sorted by relevance

123

/Zephyr-Core-3.7.0/include/zephyr/usb/
Dusb_ch9.h340 #define USB_FS_INT_EP_INTERVAL(us) CLAMP(((us) / 1000U), 1U, 255U)
343 #define USB_HS_INT_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U)
346 #define USB_FS_ISO_EP_INTERVAL(us) CLAMP(((us) / 1000U), 1U, 16U)
349 #define USB_HS_ISO_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U)
/Zephyr-Core-3.7.0/include/zephyr/drivers/usb/
Dusb_bc12.h61 #define BC12_CURR_UA(val) CLAMP(val, BC12_CHARGER_MIN_CURR_UA, BC12_CHARGER_MAX_CURR_UA)
/Zephyr-Core-3.7.0/tests/unit/util/
Dmain.c243 zassert_equal(CLAMP(5, 3, 7), 5, "Unexpected clamp result"); in ZTEST()
244 zassert_equal(CLAMP(3, 3, 7), 3, "Unexpected clamp result"); in ZTEST()
245 zassert_equal(CLAMP(7, 3, 7), 7, "Unexpected clamp result"); in ZTEST()
246 zassert_equal(CLAMP(1, 3, 7), 3, "Unexpected clamp result"); in ZTEST()
247 zassert_equal(CLAMP(8, 3, 7), 7, "Unexpected clamp result"); in ZTEST()
249 zassert_equal(CLAMP(-5, -7, -3), -5, "Unexpected clamp result"); in ZTEST()
250 zassert_equal(CLAMP(-9, -7, -3), -7, "Unexpected clamp result"); in ZTEST()
251 zassert_equal(CLAMP(1, -7, -3), -3, "Unexpected clamp result"); in ZTEST()
253 zassert_equal(CLAMP(0xffffffffaULL, 0xffffffff0ULL, 0xfffffffffULL), in ZTEST()
/Zephyr-Core-3.7.0/drivers/timer/
Dmcux_os_timer.c91 ticks = CLAMP(ticks, 1, counter_get_max_top_value(counter_dev)); in mcux_lpc_ostick_set_counter_timeout()
197 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dmips_cp0_timer.c73 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dxtensa_sys_timer.c72 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dmtk_adsp_timer.c96 uint64_t end = now + CLAMP(ticks - 1, 0, MAX_TICKS) * OST64_PER_TICK; in sys_clock_set_timeout()
Dgecko_burtc_timer.c128 ticks = CLAMP(ticks - 1, 0, g_max_timeout_ticks); in sys_clock_set_timeout()
Dambiq_stimer.c125 ticks = CLAMP(ticks, 1, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dcc13xx_cc26xx_rtc_timer.c197 ticks = CLAMP(ticks - 1, 0, (int32_t) MAX_TICKS); in sys_clock_set_timeout()
Dti_dmtimer.c92 ticks = CLAMP(ticks, 1, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Desp32_sys_timer.c90 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dsmartbond_timer.c130 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dmcux_gpt_timer.c144 ticks = CLAMP((ticks - 1), 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
/Zephyr-Core-3.7.0/drivers/sensor/asahi_kasei/akm09918c/
Dakm09918c_decoder.c49 *out = CLAMP(intermediate, INT32_MIN, INT32_MAX); in akm09918c_convert_raw_to_q31()
/Zephyr-Core-3.7.0/drivers/sensor/sensirion/sgp40/
Dsgp40.c74 tmp = (int16_t)CLAMP(val->val1, SGP40_COMP_MIN_T, SGP40_COMP_MAX_T); in sgp40_attr_set()
86 tmp = (uint8_t)CLAMP(val->val1, SGP40_COMP_MIN_RH, SGP40_COMP_MAX_RH); in sgp40_attr_set()
/Zephyr-Core-3.7.0/soc/renesas/smartbond/da1469x/
Dsoc.c90 reg_cache_len = CLAMP(reg_region_size / KB(64), 0, 0x1ff); in z_renesas_configure_cache()
/Zephyr-Core-3.7.0/drivers/can/
Dcan_common.c165 tseg2 = CLAMP(tseg2, min->phase_seg2, max->phase_seg2); in update_sample_pnt()
190 res->prop_seg = CLAMP(tseg1 / 2, min->prop_seg, max->prop_seg); in update_sample_pnt()
313 res->sjw = CLAMP(res->sjw, min->sjw, max->sjw); in can_calc_timing_internal()
/Zephyr-Core-3.7.0/drivers/sensor/bosch/bme280/
Dbme280_decoder.c66 int32_t reading_q31 = CLAMP(reading_round, INT32_MIN, INT32_MAX); in bme280_convert_double_to_q31()
/Zephyr-Core-3.7.0/drivers/sensor/amd_sb_tsi/
Dsb_tsi_emul.c116 reg_value = CLAMP(millicelsius / 125, 0, 0x7ff); in sb_tsi_emul_set_channel()
/Zephyr-Core-3.7.0/include/zephyr/sys/
Dutil.h394 #ifndef CLAMP
407 #define CLAMP(val, low, high) (((val) <= (low)) ? (low) : MIN(val, high)) macro
/Zephyr-Core-3.7.0/boards/qemu/cortex_m0/
Dnrf_timer_timer.c175 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
/Zephyr-Core-3.7.0/drivers/sensor/f75303/
Df75303_emul.c134 reg_value = CLAMP(millicelsius / 125, 0, 0x7ff); in f75303_emul_set_channel()
/Zephyr-Core-3.7.0/drivers/charger/
Dcharger_bq24190.c356 current_ua = CLAMP(current_ua, BQ24190_REG_CCC_ICHG_MIN_UA, BQ24190_REG_CCC_ICHG_MAX_UA); in bq24190_set_constant_charge_current()
370 voltage_uv = CLAMP(voltage_uv, BQ24190_REG_CVC_VREG_MIN_UV, BQ24190_REG_CVC_VREG_MAX_UV); in bq24190_set_constant_charge_voltage()
/Zephyr-Core-3.7.0/subsys/net/lib/zperf/
Dzperf_common.c45 CLAMP(CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY, K_HIGHEST_APPLICATION_THREAD_PRIO, \

123