Searched refs:DIV_ROUND_CLOSEST (Results 1 – 11 of 11) sorted by relevance
/Zephyr-latest/drivers/input/ |
D | input_analog_axis.c | 123 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/ |
D | main.c | 667 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/ |
D | ens160.c | 38 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/ |
D | video_common.c | 123 match->numerator = min + DIV_ROUND_CLOSEST(goal - min, step) * step; in video_closest_frmival_stepwise()
|
D | video_sw_generator.c | 285 data->frame_rate = MIN(DIV_ROUND_CLOSEST(frmival->denominator, frmival->numerator), in video_sw_generator_set_frmival()
|
D | ov5640.c | 512 desired_frmrate = DIV_ROUND_CLOSEST(frmival->denominator, frmival->numerator); in ov5640_set_frmival()
|
/Zephyr-latest/include/zephyr/sys/ |
D | util.h | 369 #define DIV_ROUND_CLOSEST(n, d) \ macro
|
/Zephyr-latest/drivers/mfd/ |
D | mfd_npm2100.c | 298 uint32_t ticks = (uint32_t)DIV_ROUND_CLOSEST(((uint64_t)time_ms * TIMER_PRESCALER_MUL), in mfd_npm2100_set_timer()
|
/Zephyr-latest/drivers/rtc/ |
D | rtc_ll_stm32.c | 60 #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/ |
D | emul_bmi160.c | 367 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/ |
D | npm1300_charger.c | 355 uint16_t code = DIV_ROUND_CLOSEST(numerator, DIETEMP_FACTOR_MUL); in set_dietemp_thresholds()
|