Home
last modified time | relevance | path

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

123

/Zephyr-latest/include/zephyr/usb/
Dusb_ch9.h345 #define USB_FS_INT_EP_INTERVAL(us) CLAMP(((us) / 1000U), 1U, 255U)
348 #define USB_HS_INT_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U)
351 #define USB_FS_ISO_EP_INTERVAL(us) CLAMP(((us) / 1000U), 1U, 16U)
354 #define USB_HS_ISO_EP_INTERVAL(us) CLAMP((ilog2((us) / 125U) + 1U), 1U, 16U)
/Zephyr-latest/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-latest/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-latest/drivers/timer/
Dmcux_os_timer.c93 ticks = CLAMP(ticks, 1, counter_get_max_top_value(counter_dev)); in mcux_lpc_ostick_set_counter_timeout()
199 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()
Dgecko_burtc_timer.c127 ticks = CLAMP(ticks - 1, 0, g_max_timeout_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()
Dmtk_adsp_timer.c101 uint64_t end = now + CLAMP(ticks - 1, 0, MAX_TICKS) * OST64_PER_TICK; in sys_clock_set_timeout()
Dsilabs_sleeptimer_timer.c71 ticks = CLAMP(ticks, 0, timer->max_timeout_ticks); in sleeptimer_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()
Dti_dmtimer.c93 ticks = CLAMP(ticks, 1, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
Dambiq_stimer.c140 ticks = CLAMP(ticks, 1, (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-latest/drivers/sensor/asahi_kasei/akm09918c/
Dakm09918c_decoder.c49 *out = CLAMP(intermediate, INT32_MIN, INT32_MAX); in akm09918c_convert_raw_to_q31()
/Zephyr-latest/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-latest/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-latest/soc/renesas/smartbond/da1469x/
Dsoc.c108 reg_cache_len = CLAMP(reg_region_size / KB(64), 0, 0x1ff); in z_renesas_configure_cache()
/Zephyr-latest/drivers/charger/
Dcharger_bq25180.c81 current_ma = CLAMP(current_ma, BQ25180_CURRENT_MIN_MA, BQ25180_CURRENT_MAX_MA); in bq25180_ma_to_ichg()
112 voltage_mv = CLAMP(voltage_mv, BQ25180_VOLTAGE_MIN_MV, cfg->max_voltage_microvolt); in bq25180_mv_to_vbatreg()
/Zephyr-latest/drivers/sensor/amd_sb_tsi/
Dsb_tsi_emul.c116 reg_value = CLAMP(millicelsius / 125, 0, 0x7ff); in sb_tsi_emul_set_channel()
/Zephyr-latest/include/zephyr/sys/
Dutil.h404 #ifndef CLAMP
417 #define CLAMP(val, low, high) (((val) <= (low)) ? (low) : MIN(val, high)) macro
/Zephyr-latest/drivers/sensor/f75303/
Df75303_emul.c134 reg_value = CLAMP(millicelsius / 125, 0, 0x7ff); in f75303_emul_set_channel()
/Zephyr-latest/boards/qemu/cortex_m0/
Dnrf_timer_timer.c175 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
/Zephyr-latest/subsys/net/lib/zperf/
Dzperf_common.c45 CLAMP(CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY, K_HIGHEST_APPLICATION_THREAD_PRIO, \

123