/Zephyr-latest/drivers/sensor/st/lps22hb/ |
D | lps22hb.c | 57 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/ |
D | dht.c | 190 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/ |
D | lsm303dlhc_magn.c | 52 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/ |
D | isl29035_trigger.c | 47 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/ |
D | lps25hb.c | 70 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/ |
D | input_analog_axis.c | 115 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/ |
D | mcp970x.c | 61 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/ |
D | iis2iclx.c | 276 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/ |
D | voltage.c | 55 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/ |
D | ism330dhcx.c | 399 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/ |
D | bma280.c | 59 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/ |
D | lsm6dso.c | 395 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/ |
D | lsm6dso16is.c | 421 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/ |
D | mpu6050.c | 20 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/ |
D | current_amp.c | 46 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/ |
D | p3t1755.c | 102 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/ |
D | lps2xdf.c | 86 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/ |
D | lsm6dsl.c | 472 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/ |
D | mpu9250.c | 58 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()
|
D | ak8963.h | 16 int ak8963_convert_magn(struct sensor_value *val, int16_t raw_val,
|
/Zephyr-latest/drivers/sensor/st/lsm6dsv16x/ |
D | lsm6dsv16x.c | 627 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/ |
D | icm42605.c | 28 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/ |
D | icm42688.c | 25 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/ |
D | lps22hh.c | 86 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/ |
D | stts751.c | 51 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()
|