Home
last modified time | relevance | path

Searched refs:raw_val (Results 1 – 25 of 55) sorted by relevance

123

/Zephyr-latest/drivers/sensor/st/lps22hb/
Dlps22hb.c57 int32_t raw_val) in lps22hb_press_convert() argument
61 val->val1 = (raw_val >> 12) / 10; in lps22hb_press_convert()
62 val->val2 = (raw_val >> 12) % 10 * 100000 + in lps22hb_press_convert()
63 (((int32_t)((raw_val) & 0x0FFF) * 100000L) >> 12); in lps22hb_press_convert()
67 int16_t raw_val) in lps22hb_temp_convert() argument
70 val->val1 = raw_val / 100; in lps22hb_temp_convert()
71 val->val2 = ((int32_t)raw_val % 100) * 10000; in lps22hb_temp_convert()
/Zephyr-latest/drivers/sensor/aosong/dht/
Ddht.c190 int16_t raw_val, sign; in dht_channel_get() local
193 raw_val = (drv_data->sample[0] << 8) in dht_channel_get()
195 val->val1 = raw_val / 10; in dht_channel_get()
196 val->val2 = (raw_val % 10) * 100000; in dht_channel_get()
198 raw_val = (drv_data->sample[2] << 8) in dht_channel_get()
201 sign = raw_val & 0x8000; in dht_channel_get()
202 raw_val = raw_val & ~0x8000; in dht_channel_get()
204 val->val1 = raw_val / 10; in dht_channel_get()
205 val->val2 = (raw_val % 10) * 100000; in dht_channel_get()
/Zephyr-latest/drivers/sensor/st/lsm303dlhc_magn/
Dlsm303dlhc_magn.c52 int64_t raw_val) in lsm303dlhc_convert_xy() argument
54 val->val1 = raw_val / LSM303DLHC_MAGN_LSB_GAUSS_XY; in lsm303dlhc_convert_xy()
55 val->val2 = (1000000 * raw_val / LSM303DLHC_MAGN_LSB_GAUSS_XY) % 1000000; in lsm303dlhc_convert_xy()
59 int64_t raw_val) in lsm303dlhc_convert_z() argument
61 val->val1 = raw_val / LSM303DLHC_MAGN_LSB_GAUSS_Z; in lsm303dlhc_convert_z()
62 val->val2 = (1000000 * raw_val / LSM303DLHC_MAGN_LSB_GAUSS_Z) % 1000000; in lsm303dlhc_convert_z()
/Zephyr-latest/drivers/sensor/renesas/isl29035/
Disl29035_trigger.c47 uint64_t raw_val; in isl29035_lux_processed_to_raw() local
50 raw_val = (((uint64_t)val->val1) << ISL29035_ADC_DATA_BITS) + in isl29035_lux_processed_to_raw()
53 return raw_val / ISL29035_LUX_RANGE; in isl29035_lux_processed_to_raw()
63 uint16_t raw_val; in isl29035_attr_set() local
79 raw_val = isl29035_lux_processed_to_raw(val); in isl29035_attr_set()
82 lsb_reg, raw_val & 0xFF) < 0 || in isl29035_attr_set()
84 msb_reg, raw_val >> 8) < 0) { in isl29035_attr_set()
/Zephyr-latest/drivers/sensor/st/lps25hb/
Dlps25hb.c70 int32_t raw_val) in lps25hb_press_convert() argument
74 val->val1 = raw_val / 40960; in lps25hb_press_convert()
79 val->val2 = (raw_val % 40960) * 3125 / 128; in lps25hb_press_convert()
83 int16_t raw_val) in lps25hb_temp_convert() argument
88 uval = (int32_t)raw_val * 1000000 / 480 + 42500000; in lps25hb_temp_convert()
89 val->val1 = (raw_val * 10 / 480 + 425) / 10; in lps25hb_temp_convert()
/Zephyr-latest/drivers/input/
Dinput_analog_axis.c115 int32_t raw_val) in analog_axis_out_deadzone() argument
126 if (abs(raw_val - in_mid) < cal->in_deadzone) { in analog_axis_out_deadzone()
132 if (raw_val < in_mid) { in analog_axis_out_deadzone()
133 raw_val += cal->in_deadzone; in analog_axis_out_deadzone()
135 raw_val -= cal->in_deadzone; 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()
143 int32_t raw_val) in analog_axis_out_linear() argument
152 return DIV_ROUND_CLOSEST((raw_val - cal->in_min) * out_range, in_range) + axis_cfg->out_min; in analog_axis_out_linear()
189 int32_t raw_val = bufs[i]; in analog_axis_loop() local
192 raw_val *= -1; in analog_axis_loop()
[all …]
/Zephyr-latest/drivers/sensor/microchip/mcp970x/
Dmcp970x.c61 int32_t raw_val = data->raw; in get() local
71 ret = adc_raw_to_millivolts_dt(&config->adc, &raw_val); in get()
78 t = (MC_PER_C * (raw_val - MV_AT_0C_MCP9700_9700A)) / T_COEFF_MCP9700_9700A; in get()
82 t = (MC_PER_C * 10 * (raw_val - MV_AT_0C_MCP9701_9701A)) / t_coeff; in get()
88 LOG_DBG("%d of %d, %dmV, %dmC", data->raw, (1 << data->sequence.resolution) - 1, raw_val, in get()
/Zephyr-latest/drivers/sensor/st/iis2iclx/
Diis2iclx.c276 static inline void iis2iclx_accel_convert(struct sensor_value *val, int raw_val, in iis2iclx_accel_convert() argument
283 dval = (int64_t)(raw_val) * sensitivity; in iis2iclx_accel_convert()
331 static inline void iis2iclx_magn_convert(struct sensor_value *val, int raw_val, in iis2iclx_magn_convert() argument
337 dval = (double)(raw_val * sensitivity); in iis2iclx_magn_convert()
389 int16_t raw_val; in iis2iclx_hum_convert() local
399 raw_val = ((int16_t)(data->ext_data[idx][0] | in iis2iclx_hum_convert()
403 rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1; in iis2iclx_hum_convert()
414 int32_t raw_val; in iis2iclx_press_convert() local
423 raw_val = (int32_t)(data->ext_data[idx][0] | in iis2iclx_press_convert()
429 val->val1 = (raw_val >> 12) / 10; in iis2iclx_press_convert()
[all …]
/Zephyr-latest/drivers/sensor/voltage_divider/
Dvoltage.c55 int32_t raw_val; in get() local
66 raw_val = (int16_t)data->raw; in get()
68 raw_val = data->raw; in get()
71 ret = adc_raw_to_millivolts_dt(&config->voltage.port, &raw_val); in get()
77 v_mv = raw_val; in get()
83 (1 << data->sequence.resolution) - 1, raw_val, v_mv); in get()
/Zephyr-latest/drivers/sensor/st/ism330dhcx/
Dism330dhcx.c399 static inline void ism330dhcx_accel_convert(struct sensor_value *val, int raw_val, in ism330dhcx_accel_convert() argument
406 dval = (int64_t)(raw_val) * sensitivity; in ism330dhcx_accel_convert()
447 static inline void ism330dhcx_gyro_convert(struct sensor_value *val, int raw_val, in ism330dhcx_gyro_convert() argument
454 dval = (int64_t)(raw_val) * sensitivity / 10; in ism330dhcx_gyro_convert()
507 static inline void ism330dhcx_magn_convert(struct sensor_value *val, int raw_val, in ism330dhcx_magn_convert() argument
513 dval = (double)(raw_val * sensitivity); in ism330dhcx_magn_convert()
565 int16_t raw_val; in ism330dhcx_hum_convert() local
575 raw_val = ((int16_t)(data->ext_data[idx][0] | in ism330dhcx_hum_convert()
579 rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1; in ism330dhcx_hum_convert()
590 int32_t raw_val; in ism330dhcx_press_convert() local
[all …]
/Zephyr-latest/drivers/sensor/bosch/bma280/
Dbma280.c59 int64_t raw_val) in bma280_channel_accel_convert() argument
65 raw_val = (raw_val * BMA280_PMU_FULL_RANGE) / in bma280_channel_accel_convert()
67 val->val1 = raw_val / 1000000; in bma280_channel_accel_convert()
68 val->val2 = raw_val % 1000000; in bma280_channel_accel_convert()
/Zephyr-latest/drivers/sensor/st/lsm6dso/
Dlsm6dso.c395 static inline void lsm6dso_accel_convert(struct sensor_value *val, int raw_val, in lsm6dso_accel_convert() argument
402 dval = (int64_t)(raw_val) * sensitivity; in lsm6dso_accel_convert()
442 static inline void lsm6dso_gyro_convert(struct sensor_value *val, int raw_val, in lsm6dso_gyro_convert() argument
449 dval = (int64_t)(raw_val) * sensitivity / 10; in lsm6dso_gyro_convert()
500 static inline void lsm6dso_magn_convert(struct sensor_value *val, int raw_val, in lsm6dso_magn_convert() argument
506 dval = (double)(raw_val * sensitivity); in lsm6dso_magn_convert()
558 int16_t raw_val; in lsm6dso_hum_convert() local
568 raw_val = (int16_t)(data->ext_data[idx][0] | in lsm6dso_hum_convert()
572 rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1; in lsm6dso_hum_convert()
583 int32_t raw_val; in lsm6dso_press_convert() local
[all …]
/Zephyr-latest/drivers/sensor/st/lsm6dso16is/
Dlsm6dso16is.c421 static inline void lsm6dso16is_accel_convert(struct sensor_value *val, int raw_val, in lsm6dso16is_accel_convert() argument
428 dval = (int64_t)(raw_val) * sensitivity; in lsm6dso16is_accel_convert()
469 static inline void lsm6dso16is_gyro_convert(struct sensor_value *val, int raw_val, in lsm6dso16is_gyro_convert() argument
476 dval = (int64_t)(raw_val) * sensitivity / 10; in lsm6dso16is_gyro_convert()
533 static inline void lsm6dso16is_magn_convert(struct sensor_value *val, int raw_val, in lsm6dso16is_magn_convert() argument
539 dval = (double)(raw_val * sensitivity); in lsm6dso16is_magn_convert()
591 int16_t raw_val; in lsm6dso16is_hum_convert() local
601 raw_val = (int16_t)(data->ext_data[idx][0] | in lsm6dso16is_hum_convert()
605 rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1; in lsm6dso16is_hum_convert()
616 int32_t raw_val; in lsm6dso16is_press_convert() local
[all …]
/Zephyr-latest/drivers/sensor/tdk/mpu6050/
Dmpu6050.c20 static void mpu6050_convert_accel(struct sensor_value *val, int16_t raw_val, in mpu6050_convert_accel() argument
25 conv_val = ((int64_t)raw_val * SENSOR_G) >> sensitivity_shift; in mpu6050_convert_accel()
31 static void mpu6050_convert_gyro(struct sensor_value *val, int16_t raw_val, in mpu6050_convert_gyro() argument
36 conv_val = ((int64_t)raw_val * SENSOR_PI * 10) / in mpu6050_convert_gyro()
45 int16_t raw_val) in mpu6050_convert_temp() argument
47 int64_t tmp_val = (int64_t)raw_val * 1000000; in mpu6050_convert_temp()
/Zephyr-latest/drivers/sensor/current_amp/
Dcurrent_amp.c46 int32_t raw_val = data->raw; in get() local
56 ret = adc_raw_to_millivolts_dt(&config->port, &raw_val); in get()
62 i_ma = raw_val; in get()
66 (1 << data->sequence.resolution) - 1, raw_val, i_ma); in get()
/Zephyr-latest/drivers/sensor/nxp/p3t1755/
Dp3t1755.c102 int32_t raw_val; in p3t1755_channel_get() local
108 raw_val = p3t1755_convert_to_signed(data->sample); in p3t1755_channel_get()
111 raw_val = raw_val * P3T1755_TEMPERATURE_SCALE; in p3t1755_channel_get()
113 sensor_value_from_micro(val, raw_val); in p3t1755_channel_get()
/Zephyr-latest/drivers/sensor/st/lps2xdf/
Dlps2xdf.c86 int32_t raw_val) in lps2xdf_press_convert() argument
89 int32_t press_tmp = raw_val >> 8; /* raw value is left aligned (24 msb) */ in lps2xdf_press_convert()
111 static inline void lps2xdf_temp_convert(struct sensor_value *val, int16_t raw_val) in lps2xdf_temp_convert() argument
114 val->val1 = raw_val / 100; in lps2xdf_temp_convert()
115 val->val2 = ((int32_t)raw_val % 100) * 10000; in lps2xdf_temp_convert()
/Zephyr-latest/drivers/sensor/st/lsm6dsl/
Dlsm6dsl.c472 static inline void lsm6dsl_accel_convert(struct sensor_value *val, int raw_val, in lsm6dsl_accel_convert() argument
479 dval = (int64_t)raw_val * sensitivity; in lsm6dsl_accel_convert()
520 static inline void lsm6dsl_gyro_convert(struct sensor_value *val, int raw_val, in lsm6dsl_gyro_convert() argument
527 dval = (int64_t)raw_val * sensitivity / 10; in lsm6dsl_gyro_convert()
577 static inline void lsm6dsl_magn_convert(struct sensor_value *val, int raw_val, in lsm6dsl_magn_convert() argument
583 dval = (double)(raw_val * sensitivity); in lsm6dsl_magn_convert()
636 int32_t raw_val) in lps22hb_press_convert() argument
640 val->val1 = (raw_val >> 12) / 10; in lps22hb_press_convert()
641 val->val2 = (raw_val >> 12) % 10 * 100000 + in lps22hb_press_convert()
642 (((int32_t)((raw_val) & 0x0FFF) * 100000L) >> 12); in lps22hb_press_convert()
[all …]
/Zephyr-latest/drivers/sensor/tdk/mpu9250/
Dmpu9250.c58 static void mpu9250_convert_accel(struct sensor_value *val, int16_t raw_val, in mpu9250_convert_accel() argument
63 conv_val = ((int64_t)raw_val * SENSOR_G) >> sensitivity_shift; in mpu9250_convert_accel()
69 static void mpu9250_convert_gyro(struct sensor_value *val, int16_t raw_val, in mpu9250_convert_gyro() argument
74 conv_val = ((int64_t)raw_val * SENSOR_PI * 10) / in mpu9250_convert_gyro()
82 int16_t raw_val) in mpu9250_convert_temp() argument
85 val->val1 = (raw_val / MPU0259_TEMP_SENSITIVITY) + MPU9250_TEMP_OFFSET; in mpu9250_convert_temp()
86 val->val2 = (((int64_t)(raw_val % MPU0259_TEMP_SENSITIVITY) * 1000000) in mpu9250_convert_temp()
Dak8963.h16 int ak8963_convert_magn(struct sensor_value *val, int16_t raw_val,
/Zephyr-latest/drivers/sensor/st/lsm6dsv16x/
Dlsm6dsv16x.c627 static inline void lsm6dsv16x_accel_convert(struct sensor_value *val, int raw_val, in lsm6dsv16x_accel_convert() argument
634 dval = (int64_t)(raw_val) * sensitivity; in lsm6dsv16x_accel_convert()
674 static inline void lsm6dsv16x_gyro_convert(struct sensor_value *val, int raw_val, in lsm6dsv16x_gyro_convert() argument
681 dval = (int64_t)(raw_val) * sensitivity / 10; in lsm6dsv16x_gyro_convert()
737 static inline void lsm6dsv16x_magn_convert(struct sensor_value *val, int raw_val, in lsm6dsv16x_magn_convert() argument
743 dval = (double)(raw_val * sensitivity); in lsm6dsv16x_magn_convert()
795 int16_t raw_val; in lsm6dsv16x_hum_convert() local
805 raw_val = (int16_t)(data->ext_data[idx][0] | in lsm6dsv16x_hum_convert()
809 rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1; in lsm6dsv16x_hum_convert()
820 int32_t raw_val; in lsm6dsv16x_press_convert() local
[all …]
/Zephyr-latest/drivers/sensor/tdk/icm42605/
Dicm42605.c28 int16_t raw_val, in icm42605_convert_accel() argument
33 conv_val = ((int64_t)raw_val * SENSOR_G) >> sensitivity_shift; in icm42605_convert_accel()
40 int16_t raw_val, in icm42605_convert_gyro() argument
45 conv_val = ((int64_t)raw_val * SENSOR_PI * 10) / in icm42605_convert_gyro()
53 int16_t raw_val) in icm42605_convert_temp() argument
55 val->val1 = (((int64_t)raw_val * 100) / 207) + 25; in icm42605_convert_temp()
56 val->val2 = ((((int64_t)raw_val * 100) % 207) * 1000000) / 207; in icm42605_convert_temp()
/Zephyr-latest/drivers/sensor/tdk/icm42688/
Dicm42688.c25 static void icm42688_convert_accel(struct sensor_value *val, int16_t raw_val, in icm42688_convert_accel() argument
28 icm42688_accel_ms(cfg, (int32_t)raw_val, &val->val1, &val->val2); in icm42688_convert_accel()
31 static void icm42688_convert_gyro(struct sensor_value *val, int16_t raw_val, in icm42688_convert_gyro() argument
34 icm42688_gyro_rads(cfg, (int32_t)raw_val, &val->val1, &val->val2); in icm42688_convert_gyro()
37 static inline void icm42688_convert_temp(struct sensor_value *val, int16_t raw_val) in icm42688_convert_temp() argument
39 icm42688_temp_c((int32_t)raw_val, &val->val1, &val->val2); in icm42688_convert_temp()
/Zephyr-latest/drivers/sensor/st/lps22hh/
Dlps22hh.c86 int32_t raw_val) in lps22hh_press_convert() argument
88 int32_t press_tmp = raw_val >> 8; /* raw value is left aligned (24 msb) */ in lps22hh_press_convert()
102 int16_t raw_val) in lps22hh_temp_convert() argument
105 val->val1 = raw_val / 100; in lps22hh_temp_convert()
106 val->val2 = ((int32_t)raw_val % 100) * 10000; in lps22hh_temp_convert()
/Zephyr-latest/drivers/sensor/st/stts751/
Dstts751.c51 int16_t raw_val) in stts751_temp_convert() argument
53 val->val1 = raw_val / 256; in stts751_temp_convert()
54 val->val2 = ((int32_t)raw_val % 256) * 10000; in stts751_temp_convert()

123