Home
last modified time | relevance | path

Searched refs:DIV_ROUND_CLOSEST (Results 1 – 11 of 11) sorted by relevance

/Zephyr-latest/drivers/input/
Dinput_analog_axis.c123 int16_t in_mid = DIV_ROUND_CLOSEST(cal->in_min + cal->in_max, 2); in analog_axis_out_deadzone()
127 return DIV_ROUND_CLOSEST(axis_cfg->out_max + axis_cfg->out_min, 2); in analog_axis_out_deadzone()
138 return DIV_ROUND_CLOSEST((raw_val - in_min) * out_range, in_range) + axis_cfg->out_min; in analog_axis_out_deadzone()
152 return DIV_ROUND_CLOSEST((raw_val - cal->in_min) * out_range, in_range) + axis_cfg->out_min; in analog_axis_out_linear()
/Zephyr-latest/tests/unit/util/
Dmain.c667 zassert_equal(DIV_ROUND_CLOSEST(0, 1), 0); in ZTEST()
669 zassert_equal(DIV_ROUND_CLOSEST(5, 2), 3); in ZTEST()
670 zassert_equal(DIV_ROUND_CLOSEST(5, -2), -3); in ZTEST()
671 zassert_equal(DIV_ROUND_CLOSEST(-5, 2), -3); in ZTEST()
672 zassert_equal(DIV_ROUND_CLOSEST(-5, -2), 3); in ZTEST()
674 zassert_equal(DIV_ROUND_CLOSEST(7, 3), 2); in ZTEST()
675 zassert_equal(DIV_ROUND_CLOSEST(-7, 3), -2); in ZTEST()
/Zephyr-latest/drivers/sensor/ens160/
Dens160.c38 sys_put_le16(DIV_ROUND_CLOSEST(temp, 1000000U), buf); in ens160_set_temperature()
65 sys_put_le16(DIV_ROUND_CLOSEST(rh, 1000000U), buf); in ens160_set_humidity()
/Zephyr-latest/drivers/video/
Dvideo_common.c123 match->numerator = min + DIV_ROUND_CLOSEST(goal - min, step) * step; in video_closest_frmival_stepwise()
Dvideo_sw_generator.c285 data->frame_rate = MIN(DIV_ROUND_CLOSEST(frmival->denominator, frmival->numerator), in video_sw_generator_set_frmival()
Dov5640.c512 desired_frmrate = DIV_ROUND_CLOSEST(frmival->denominator, frmival->numerator); in ov5640_set_frmival()
/Zephyr-latest/include/zephyr/sys/
Dutil.h369 #define DIV_ROUND_CLOSEST(n, d) \ macro
/Zephyr-latest/drivers/mfd/
Dmfd_npm2100.c298 uint32_t ticks = (uint32_t)DIV_ROUND_CLOSEST(((uint64_t)time_ms * TIMER_PRESCALER_MUL), in mfd_npm2100_set_timer()
/Zephyr-latest/drivers/rtc/
Drtc_ll_stm32.c60 #define PPB_TO_NB_PULSES(ppb) DIV_ROUND_CLOSEST((ppb) * 2048, 1953125)
67 #define NB_PULSES_TO_PPB(pulses) DIV_ROUND_CLOSEST((pulses) * 1953125, 2048)
/Zephyr-latest/drivers/sensor/bosch/bmi160/
Demul_bmi160.c367 CLAMP(DIV_ROUND_CLOSEST(intermediate * INT16_MAX, scale), INT16_MIN, INT16_MAX); in bmi160_emul_backend_set_channel()
/Zephyr-latest/drivers/sensor/nordic/npm1300_charger/
Dnpm1300_charger.c355 uint16_t code = DIV_ROUND_CLOSEST(numerator, DIETEMP_FACTOR_MUL); in set_dietemp_thresholds()