/Zephyr-latest/drivers/sensor/nxp/mcux_acmp/ |
D | mcux_acmp.c | 126 int32_t val1; in mcux_acmp_attr_set() local 137 val1 = val->val1; in mcux_acmp_attr_set() 142 if (val1 >= kACMP_OffsetLevel0 && in mcux_acmp_attr_set() 143 val1 <= kACMP_OffsetLevel1) { in mcux_acmp_attr_set() 144 LOG_DBG("offset = %d", val1); in mcux_acmp_attr_set() 145 data->config.offsetMode = val1; in mcux_acmp_attr_set() 155 if (val1 >= kACMP_HysteresisLevel0 && in mcux_acmp_attr_set() 156 val1 <= kACMP_HysteresisLevel3) { in mcux_acmp_attr_set() 157 LOG_DBG("hysteresis = %d", val1); in mcux_acmp_attr_set() 158 data->config.hysteresisMode = val1; in mcux_acmp_attr_set() [all …]
|
/Zephyr-latest/drivers/sensor/nxp/mcux_lpcmp/ |
D | mcux_lpcmp.c | 58 int32_t val1 = val->val1; in mcux_lpcmp_attr_set() local 73 LOG_DBG("positive mux = %d", val1); in mcux_lpcmp_attr_set() 74 if (val1 >= 0 && val1 < 8) { in mcux_lpcmp_attr_set() 76 LPCMP_CCR2_PSEL(val1)); in mcux_lpcmp_attr_set() 82 LOG_DBG("negative mux = %d", val1); in mcux_lpcmp_attr_set() 83 if (val1 >= 0 && val1 < 8) { in mcux_lpcmp_attr_set() 85 LPCMP_CCR2_MSEL(val1)); in mcux_lpcmp_attr_set() 93 LOG_DBG("dac enable = %d", val1); in mcux_lpcmp_attr_set() 94 if (val1 == 1) { in mcux_lpcmp_attr_set() 96 } else if (val1 == 0) { in mcux_lpcmp_attr_set() [all …]
|
/Zephyr-latest/samples/sensor/sht3xd/src/ |
D | main.c | 58 printf("Alert outside %d..%d %%RH got %d\n", lo_thr.val1, in main() 59 hi_thr.val1, rc); in main() 81 if (lo_thr.val1 > hum.val1) { in main() 83 hum.val1, lo_thr.val1); in main() 84 } else if (hi_thr.val1 < hum.val1) { in main() 86 hum.val1, hi_thr.val1); in main() 89 lo_thr.val1, hum.val1, hi_thr.val1); in main()
|
/Zephyr-latest/drivers/sensor/ |
D | shell_battery.c | 91 shell_fprintf(sh, SHELL_NORMAL, "Temp: %.1d.%02d C\n", temp.val1, in cmd_battery() 93 shell_fprintf(sh, SHELL_NORMAL, "V: %5d.%02d V\n", volt.val1, in cmd_battery() 96 v_desired.val1, v_desired.val2 / 10000); in cmd_battery() 97 shell_fprintf(sh, SHELL_NORMAL, "I: %d mA", current.val1); in cmd_battery() 98 if (current.val1 > 0) { in cmd_battery() 100 } else if (current.val1 < 0) { in cmd_battery() 105 i_desired.val1); in cmd_battery() 106 allowed = i_desired.val1 && v_desired.val2 && charge.val1 < 100; in cmd_battery() 109 shell_fprintf(sh, SHELL_NORMAL, "Charge: %d %%\n", charge.val1); in cmd_battery() 111 v_design.val1, v_design.val2 / 10000); in cmd_battery() [all …]
|
/Zephyr-latest/samples/sensor/bmi270/src/ |
D | main.c | 28 full_scale.val1 = 2; /* G */ in main() 30 sampling_freq.val1 = 100; /* Hz. Performance mode */ in main() 32 oversampling.val1 = 1; /* Normal mode */ in main() 49 full_scale.val1 = 500; /* dps */ in main() 51 sampling_freq.val1 = 100; /* Hz. Performance mode */ in main() 53 oversampling.val1 = 1; /* Normal mode */ in main() 79 acc[0].val1, acc[0].val2, in main() 80 acc[1].val1, acc[1].val2, in main() 81 acc[2].val1, acc[2].val2, in main() 82 gyr[0].val1, gyr[0].val2, in main() [all …]
|
/Zephyr-latest/samples/sensor/tdk_apex/src/ |
D | main.c | 84 if (apex_mode.val1 == TDK_APEX_PEDOMETER) { in main() 86 } else if (apex_mode.val1 == TDK_APEX_TILT) { in main() 88 } else if (apex_mode.val1 == TDK_APEX_WOM) { in main() 90 } else if (apex_mode.val1 == TDK_APEX_SMD) { in main() 112 if (apex_mode.val1 == TDK_APEX_PEDOMETER) { in main() 119 now_str(), apex_pedometer[0].val1, in main() 121 apex_pedometer[1].val1 == 1 ? "Walk" in main() 122 : apex_pedometer[1].val1 == 2 ? "Run" in main() 124 } else if (apex_mode.val1 == TDK_APEX_TILT) { in main() 130 apex_tilt.val1 ? "TILT" : "Unknown trig"); in main() [all …]
|
/Zephyr-latest/samples/sensor/veaa_x_3/src/ |
D | main.c | 33 printk("Valve range: %u to %u kPa\n", range.val1, range.val2); in main() 40 setpoint.val1 = range.val1; in main() 46 printk("Set setpoint to %u failed: %d\n", setpoint.val1, rc); in main() 62 printk("Setpoint: %4u kPa, actual: %4u kPa\n", setpoint.val1, pressure.val1); in main() 64 setpoint.val1 += CONFIG_SAMPLE_LOOP_INCREMENT; in main() 65 if (setpoint.val1 > range.val2) { in main() 66 setpoint.val1 = range.val1; in main()
|
/Zephyr-latest/tests/drivers/sensor/generic/src/ |
D | main.c | 120 zassert_equal(data.val1, chan_elements[0].data.val1, in ZTEST() 132 zassert_equal(data.val1, chan_elements[i].data.val1, in ZTEST() 220 zassert_equal(trigger_elements[i].data.val1, in ZTEST() 221 data.val1, "read-back returned wrong val1"); in ZTEST() 238 zassert_equal(data.val1, trigger_elements[i].data.val1, in ZTEST() 280 zassert_equal(data.val1, SENSOR_G/1000000LL, in ZTEST() 282 zassert_equal(data.val2, SENSOR_G%(data.val1 * 1000000LL), in ZTEST() 287 data.val1 = -data.val1; in ZTEST() 294 zassert_equal(data.val1, SENSOR_PI/1000000LL, in ZTEST() 296 zassert_equal(data.val2, SENSOR_PI%(data.val1 * 1000000LL), in ZTEST() [all …]
|
D | dummy_sensor.c | 41 val->val1 = data->val[0].val1; in dummy_sensor_channel_get() 45 val->val1 = data->val[1].val1; in dummy_sensor_channel_get() 49 val->val1 = data->val[2].val1; in dummy_sensor_channel_get() 53 val->val1 = data->val[3].val1; in dummy_sensor_channel_get() 57 val->val1 = data->val[4].val1; in dummy_sensor_channel_get() 98 data->val[i].val1 = i; in dummy_sensor_init() 114 data->val[4].val1 = val->val1; in dummy_sensor_attr_set() 131 val->val1 = data->val[4].val1; in dummy_sensor_attr_get()
|
/Zephyr-latest/drivers/sensor/asahi_kasei/akm09918c/ |
D | akm09918c.h | 53 if (val->val1 >= 100) { in akm09918c_hz_to_reg() 55 } else if (val->val1 >= 50) { in akm09918c_hz_to_reg() 57 } else if (val->val1 >= 20) { in akm09918c_hz_to_reg() 59 } else if (val->val1 > 0) { in akm09918c_hz_to_reg() 68 val->val1 = 0; in akm09918c_reg_to_hz() 72 val->val1 = 10; in akm09918c_reg_to_hz() 75 val->val1 = 20; in akm09918c_reg_to_hz() 78 val->val1 = 50; in akm09918c_reg_to_hz() 81 val->val1 = 100; in akm09918c_reg_to_hz()
|
/Zephyr-latest/samples/sensor/mhz19b/src/ |
D | main.c | 28 val.val1 = 5000; in main() 31 printk("failed to set range to %d\n", val.val1); in main() 35 val.val1 = 1; in main() 38 printk("failed to set ABC to %d\n", val.val1); in main() 52 printk("Sensor range is set to %dppm\n", val.val1); in main() 60 printk("Sensor ABC is %s\n", val.val1 == 1 ? "enabled" : "disabled"); in main() 73 printk("sensor: co2 reading: %d\n", val.val1); in main()
|
/Zephyr-latest/samples/sensor/sgp40_sht4x/src/ |
D | main.c | 48 heater_p.val1 = CONFIG_APP_HEATER_PULSE_POWER; in main() 49 heater_d.val1 = CONFIG_APP_HEATER_PULSE_DURATION; in main() 75 if (hum.val1 > CONFIG_APP_HEATER_HUMIDITY_THRESH && in main() 76 temp.val1 < SHT4X_HEATER_MAX_TEMP) { in main() 89 comp_t.val1 = temp.val1; /* Temp [°C] */ in main() 90 comp_rh.val1 = hum.val1; /* RH [%] */ in main() 110 gas.val1); in main()
|
/Zephyr-latest/drivers/sensor/tdk/icm42688/ |
D | icm42688.h | 138 out->val1 = 32000; in icm42688_accel_reg_to_hz() 142 out->val1 = 1600; in icm42688_accel_reg_to_hz() 146 out->val1 = 8000; in icm42688_accel_reg_to_hz() 150 out->val1 = 4000; in icm42688_accel_reg_to_hz() 154 out->val1 = 2000; in icm42688_accel_reg_to_hz() 158 out->val1 = 1000; in icm42688_accel_reg_to_hz() 162 out->val1 = 500; in icm42688_accel_reg_to_hz() 166 out->val1 = 200; in icm42688_accel_reg_to_hz() 170 out->val1 = 100; in icm42688_accel_reg_to_hz() 174 out->val1 = 50; in icm42688_accel_reg_to_hz() [all …]
|
/Zephyr-latest/samples/sensor/bq274xx/src/ |
D | main.c | 14 if ((value.val2 < 0) && (value.val1 >= 0)) { in bq274xx_show_values() 16 printk("%s: -%d.%06d\n", type, value.val1, value.val2); in bq274xx_show_values() 17 } else if ((value.val2 > 0) && (value.val1 < 0)) { in bq274xx_show_values() 18 printk("%s: %d.%06d\n", type, value.val1, value.val2); in bq274xx_show_values() 19 } else if ((value.val2 < 0) && (value.val1 < 0)) { in bq274xx_show_values() 21 printk("%s: %d.%06d\n", type, value.val1, value.val2); in bq274xx_show_values() 23 printk("%s: %d.%06d\n", type, value.val1, value.val2); in bq274xx_show_values() 49 printk("Voltage: %d.%06dV\n", voltage.val1, voltage.val2); in do_main() 117 printk("State of charge: %d%%\n", state_of_charge.val1); in do_main() 134 printk("State of health: %d%%\n", state_of_health.val1); in do_main() [all …]
|
/Zephyr-latest/subsys/net/lib/lwm2m/ |
D | lwm2m_util.c | 27 int32_t val1 = (int32_t)*in; in lwm2m_float_to_b32() local 36 if (val1 == 0 && val2 == 0) { in lwm2m_float_to_b32() 42 v = abs(val1); in lwm2m_float_to_b32() 85 if (val1 == 0) { in lwm2m_float_to_b32() 88 b32[0] = val1 < 0 ? 0x80 : 0; in lwm2m_float_to_b32() 109 int64_t val1 = (int64_t)*in; in lwm2m_float_to_b64() local 118 if (val1 == 0 && val2 == 0) { in lwm2m_float_to_b64() 124 v = llabs(val1); in lwm2m_float_to_b64() 167 if (val1 == 0) { in lwm2m_float_to_b64() 170 b64[0] = val1 < 0 ? 0x80 : 0; in lwm2m_float_to_b64() [all …]
|
/Zephyr-latest/drivers/sensor/wsen/wsen_hids_2525020210002/ |
D | wsen_hids_2525020210002.c | 83 val->val1 = data->temperature / 1000; in hids_2525020210002_channel_get() 87 val->val1 = data->humidity / 1000; in hids_2525020210002_channel_get() 104 if (precision->val1 < hids_2525020210002_precision_Low || in hids_2525020210002_precision_set() 105 precision->val1 > hids_2525020210002_precision_High || precision->val2 != 0) { in hids_2525020210002_precision_set() 106 LOG_ERR("Bad precision configuration %d", precision->val1); in hids_2525020210002_precision_set() 110 data->sensor_precision = (hids_2525020210002_precision_t)precision->val1; in hids_2525020210002_precision_set() 121 if (heater->val1 < hids_2525020210002_heater_Off || in hids_2525020210002_heater_set() 122 heater->val1 > hids_2525020210002_heater_On_20mW_100ms || heater->val2 != 0) { in hids_2525020210002_heater_set() 123 LOG_ERR("Bad heater option %d", heater->val1); in hids_2525020210002_heater_set() 127 data->sensor_heater = (hids_2525020210002_heater_t)heater->val1; in hids_2525020210002_heater_set() [all …]
|
/Zephyr-latest/drivers/sensor/tdk/icm42605/ |
D | icm42605.c | 34 val->val1 = conv_val / 1000000; in icm42605_convert_accel() 47 val->val1 = conv_val / 1000000; in icm42605_convert_gyro() 55 val->val1 = (((int64_t)raw_val * 100) / 207) + 25; in icm42605_convert_temp() 59 val->val1--; in icm42605_convert_temp() 62 val->val1++; in icm42605_convert_temp() 268 if (val->val1 > 8000 || val->val1 < 1) { in icm42605_attr_set() 272 drv_data->accel_hz = val->val1; in icm42605_attr_set() 275 if (val->val1 < ACCEL_FS_16G || in icm42605_attr_set() 276 val->val1 > ACCEL_FS_2G) { in icm42605_attr_set() 280 drv_data->accel_sf = val->val1; in icm42605_attr_set() [all …]
|
/Zephyr-latest/samples/sensor/ccs811/src/ |
D | main.c | 62 now_str(), co2.val1, tvoc.val1); in do_fetch() 63 printk("Voltage: %d.%06dV; Current: %d.%06dA\n", voltage.val1, in do_fetch() 64 voltage.val2, current.val1, current.val2); in do_fetch() 141 temp.val1, humidity.val1, rc); in main() 151 .val1 = CONFIG_APP_CO2_MEDIUM_PPM, in main() 156 printk("L/M threshold to %d got %d\n", thr.val1, rc); in main() 160 .val1 = CONFIG_APP_CO2_HIGH_PPM, in main() 165 printk("M/H threshold to %d got %d\n", thr.val1, rc); in main()
|
/Zephyr-latest/samples/shields/npm1300_ek/src/ |
D | main.c | 96 printk("V: %d.%03d ", volt.val1, volt.val2 / 1000); in read_sensors() 98 printk("I: %s%d.%04d ", ((current.val1 < 0) || (current.val2 < 0)) ? "-" : "", in read_sensors() 99 abs(current.val1), abs(current.val2) / 100); in read_sensors() 101 printk("T: %s%d.%02d\n", ((temp.val1 < 0) || (temp.val2 < 0)) ? "-" : "", abs(temp.val1), in read_sensors() 104 printk("Charger Status: %d, Error: %d, VBUS: %s\n", status.val1, error.val1, in read_sensors() 105 vbus_present.val1 ? "connected" : "disconnected"); in read_sensors()
|
/Zephyr-latest/drivers/sensor/sbs_gauge/ |
D | sbs_gauge.c | 56 val->val1 = data->voltage / 1000; in sbs_gauge_channel_get() 61 val->val1 = data->avg_current / 1000; in sbs_gauge_channel_get() 68 val->val1 = int_temp / 100; in sbs_gauge_channel_get() 73 val->val1 = data->state_of_charge; in sbs_gauge_channel_get() 77 val->val1 = data->full_charge_capacity; in sbs_gauge_channel_get() 81 val->val1 = data->remaining_charge_capacity; in sbs_gauge_channel_get() 85 val->val1 = data->nom_avail_capacity; in sbs_gauge_channel_get() 89 val->val1 = data->full_avail_capacity; in sbs_gauge_channel_get() 93 val->val1 = data->time_to_empty; in sbs_gauge_channel_get() 97 val->val1 = data->time_to_full; in sbs_gauge_channel_get() [all …]
|
/Zephyr-latest/drivers/sensor/tdk/icm42670/ |
D | icm42670.c | 280 if ((val->val1 == ICM42670_LOW_POWER_MODE) && in icm42670_set_accel_power_mode() 290 drv_data->accel_pwr_mode = val->val1; in icm42670_set_accel_power_mode() 291 } else if ((val->val1 == ICM42670_LOW_NOISE_MODE) && in icm42670_set_accel_power_mode() 301 drv_data->accel_pwr_mode = val->val1; in icm42670_set_accel_power_mode() 311 if (val->val1 <= 1600 && val->val1 >= 1) { in icm42670_set_accel_odr() 315 convert_freq_to_bitfield(val->val1, &drv_data->accel_hz)); in icm42670_set_accel_odr() 324 convert_freq_to_bitfield(val->val1, &drv_data->accel_hz)); in icm42670_set_accel_odr() 326 } else if (val->val1 == 0) { in icm42670_set_accel_odr() 328 drv_data->accel_hz = val->val1; in icm42670_set_accel_odr() 338 if (val->val1 > 16 || val->val1 < 2) { in icm42670_set_accel_fs() [all …]
|
/Zephyr-latest/drivers/sensor/bosch/bmi323/ |
D | bmi323.c | 107 result->val1 = int_part; in bosch_bmi323_value_to_sensor_value() 116 result->val1 = int_part; in bosch_bmi323_sensor_value_from_micro() 280 if (val->val1) { in bosch_bmi323_driver_api_set_acc_feature_mask() 384 if (val->val1) { in bosch_bmi323_driver_api_set_gyro_feature_mask() 477 val->val1 = 0; in bosch_bmi323_driver_api_get_acc_odr() 481 val->val1 = 1; in bosch_bmi323_driver_api_get_acc_odr() 485 val->val1 = 3; in bosch_bmi323_driver_api_get_acc_odr() 489 val->val1 = 6; in bosch_bmi323_driver_api_get_acc_odr() 493 val->val1 = 12; in bosch_bmi323_driver_api_get_acc_odr() 497 val->val1 = 25; in bosch_bmi323_driver_api_get_acc_odr() [all …]
|
/Zephyr-latest/drivers/sensor/vishay/veml7700/ |
D | veml7700.c | 170 return val->val1 >= VEML7700_ALS_GAIN_1 && val->val1 <= VEML7700_ALS_GAIN_1_4; in veml7700_check_gain() 175 return val->val1 >= VEML7700_ALS_IT_25 && val->val1 <= VEML7700_ALS_IT_800; in veml7700_check_it() 180 return (val->val1 >= VEML7700_ALS_PERS_1 && val->val1 <= VEML7700_ALS_PERS_8) || in veml7700_check_int_mode() 181 val->val1 == VEML7700_INT_DISABLED; in veml7700_check_int_mode() 366 ret = veml7700_lux_to_counts(data, val->val1, &data->thresh_low); in veml7700_attr_set() 372 ret = veml7700_lux_to_counts(data, val->val1, &data->thresh_high); in veml7700_attr_set() 379 data->gain = (enum veml7700_als_gain)val->val1; in veml7700_attr_set() 386 data->it = (enum veml7700_als_it)val->val1; in veml7700_attr_set() 393 data->int_mode = (enum veml7700_int_mode)val->val1; in veml7700_attr_set() 413 val->val1 = data->thresh_low; in veml7700_attr_get() [all …]
|
/Zephyr-latest/samples/sensor/max17262/src/ |
D | main.c | 31 i_avg = avg_current.val1 + (avg_current.val2 / 1000000.0); in main() 34 voltage.val1, voltage.val2, (double)i_avg, in main() 35 temperature.val1, temperature.val2); in main()
|
/Zephyr-latest/samples/sensor/bmg160/src/ |
D | main.c | 34 val[0].val1 + val[0].val2 / 1000000.0, in print_gyro_data() 35 val[1].val1 + val[1].val2 / 1000000.0, in print_gyro_data() 36 val[2].val1 + val[2].val2 / 1000000.0); in print_gyro_data() 49 val.val1 + val.val2 / 1000000.0); in print_temp_data() 112 attr.val1 = 4; in test_trigger_mode() 141 attr.val1 = 100; in test_trigger_mode()
|