Lines Matching +full:resistance +full:- +full:based

10  * SPDX-License-Identifier: Apache-2.0
42 * and can be obtained using the formula val1 + val2 * 10^(-6). Negative
47 * -0.5: val1 = 0, val2 = -500000
48 * -1.0: val1 = -1, val2 = 0
49 * -1.5: val1 = -1, val2 = -500000
54 /** Fractional part of the value (in one-millionth parts). */
101 /** Illuminance in infra-red spectrum, in lux. */
112 /** 1.0 micro-meters Particulate Matter, in ug/m^3 */
114 /** 2.5 micro-meters Particulate Matter, in ug/m^3 */
116 /** 10 micro-meters Particulate Matter, in ug/m^3 */
127 /** Gas sensor resistance in ohms. */
133 /** Current Shunt Voltage in milli-volts **/
141 /** Resistance , in Ohm **/
227 * Timer-based trigger, useful when the sensor does not have an
235 * This includes any-motion detection when the channel is
236 * acceleration or gyro. If detection is based on slope between
312 /** Threshold for any-motion (slope) trigger. */
343 /** Free-fall duration represented in milliseconds.
480 * @return -ENOTSUP if the channel/channel_idx aren't found
495 * @return -ENOTSUP if the channel is not supported
509 * decoder->decode(buffer, SENSOR_CHAN_DISTANCE, 0, &fit, 5, out);
513 * decoder->decode(buffer, SENSOR_CHAN_DISTANCE, 1, &fit, 5, out);
590 return ctx->decoder->decode(ctx->buffer, ctx->channel, &ctx->fit, max_count, out); in sensor_decode()
740 (const struct sensor_driver_api *)dev->api; in z_impl_sensor_attr_set()
742 if (api->attr_set == NULL) { in z_impl_sensor_attr_set()
743 return -ENOSYS; in z_impl_sensor_attr_set()
746 return api->attr_set(dev, chan, attr, val); in z_impl_sensor_attr_set()
772 (const struct sensor_driver_api *)dev->api; in z_impl_sensor_attr_get()
774 if (api->attr_get == NULL) { in z_impl_sensor_attr_get()
775 return -ENOSYS; in z_impl_sensor_attr_get()
778 return api->attr_get(dev, chan, attr, val); in z_impl_sensor_attr_get()
789 * The user-allocated trigger will be stored by the driver as a pointer, rather
808 (const struct sensor_driver_api *)dev->api; in sensor_trigger_set()
810 if (api->trigger_set == NULL) { in sensor_trigger_set()
811 return -ENOSYS; in sensor_trigger_set()
814 return api->trigger_set(dev, trig, handler); in sensor_trigger_set()
840 (const struct sensor_driver_api *)dev->api; in z_impl_sensor_sample_fetch()
842 return api->sample_fetch(dev, SENSOR_CHAN_ALL); in z_impl_sensor_sample_fetch()
873 (const struct sensor_driver_api *)dev->api; in z_impl_sensor_sample_fetch_chan()
875 return api->sample_fetch(dev, type); in z_impl_sensor_sample_fetch_chan()
908 (const struct sensor_driver_api *)dev->api; in z_impl_sensor_channel_get()
910 return api->channel_get(dev, chan, val); in z_impl_sensor_channel_get()
932 int8_t _padding[sizeof(struct sensor_chan_spec) - 1];
939 * @brief checks if a given channel is a 3-axis channel
988 const struct sensor_driver_api *api = (const struct sensor_driver_api *)dev->api; in z_impl_sensor_get_decoder()
992 if (api->get_decoder == NULL) { in z_impl_sensor_get_decoder()
997 return api->get_decoder(dev, decoder); in z_impl_sensor_get_decoder()
1027 struct sensor_read_config *cfg = (struct sensor_read_config *)iodev->data; in z_impl_sensor_reconfigure_read_iodev()
1029 if (cfg->max < num_channels || cfg->is_streaming) { in z_impl_sensor_reconfigure_read_iodev()
1030 return -ENOMEM; in z_impl_sensor_reconfigure_read_iodev()
1033 cfg->sensor = sensor; in z_impl_sensor_reconfigure_read_iodev()
1034 memcpy(cfg->channels, channels, num_channels * sizeof(struct sensor_chan_spec)); in z_impl_sensor_reconfigure_read_iodev()
1035 cfg->count = num_channels; in z_impl_sensor_reconfigure_read_iodev()
1051 return -ENOMEM; in sensor_stream()
1088 return -ENOMEM; in sensor_read()
1095 int res = cqe->result; in sensor_read()
1097 __ASSERT(cqe->userdata == buf, in sensor_read()
1098 "consumed non-matching completion for sensor read into buffer %p\n", buf); in sensor_read()
1106 * @brief One shot non-blocking read with pool allocated buffer
1130 return -ENOMEM; in sensor_read_async_mempool()
1187 int64_t micro_ms2 = ms2->val1 * 1000000LL + ms2->val2; in sensor_ms2_to_g()
1192 return (micro_ms2 - SENSOR_G / 2) / SENSOR_G; in sensor_ms2_to_g()
1204 ms2->val1 = ((int64_t)g * SENSOR_G) / 1000000LL; in sensor_g_to_ms2()
1205 ms2->val2 = ((int64_t)g * SENSOR_G) % 1000000LL; in sensor_g_to_ms2()
1218 int64_t micro_ms2 = (ms2->val1 * INT64_C(1000000)) + ms2->val2; in sensor_ms2_to_ug()
1231 ms2->val1 = ((int64_t)ug * SENSOR_G / 1000000LL) / 1000000LL; in sensor_ug_to_ms2()
1232 ms2->val2 = ((int64_t)ug * SENSOR_G / 1000000LL) % 1000000LL; in sensor_ug_to_ms2()
1244 int64_t micro_rad_s = rad->val1 * 1000000LL + rad->val2; in sensor_rad_to_degrees()
1249 return (micro_rad_s * 180LL - SENSOR_PI / 2) / SENSOR_PI; in sensor_rad_to_degrees()
1261 rad->val1 = ((int64_t)d * SENSOR_PI / 180LL) / 1000000LL; in sensor_degrees_to_rad()
1262 rad->val2 = ((int64_t)d * SENSOR_PI / 180LL) % 1000000LL; in sensor_degrees_to_rad()
1269 * +/-2147.483 degrees. In order to increase this range, here we use 10 micro
1278 int64_t micro_rad_s = rad->val1 * 1000000LL + rad->val2; in sensor_rad_to_10udegrees()
1291 rad->val1 = ((int64_t)d * SENSOR_PI / 180LL / 100000LL) / 1000000LL; in sensor_10udegrees_to_rad()
1292 rad->val2 = ((int64_t)d * SENSOR_PI / 180LL / 100000LL) % 1000000LL; in sensor_10udegrees_to_rad()
1303 return (double)val->val1 + (double)val->val2 / 1000000; in sensor_value_to_double()
1314 return (float)val->val1 + (float)val->val2 / 1000000; in sensor_value_to_float()
1327 return -ERANGE; in sensor_value_from_double()
1330 double val2 = (inp - (int32_t)inp) * 1000000.0; in sensor_value_from_double()
1333 return -ERANGE; in sensor_value_from_double()
1336 val->val1 = (int32_t)inp; in sensor_value_from_double()
1337 val->val2 = (int32_t)val2; in sensor_value_from_double()
1351 float val2 = (inp - (int32_t)inp) * 1000000.0f; in sensor_value_from_float()
1353 if (val2 < INT32_MIN || val2 > (float)(INT32_MAX - 1)) { in sensor_value_from_float()
1354 return -ERANGE; in sensor_value_from_float()
1357 val->val1 = (int32_t)inp; in sensor_value_from_float()
1358 val->val2 = (int32_t)val2; in sensor_value_from_float()
1457 return ((int64_t)val->val1 * 1000) + val->val2 / 1000; in sensor_value_to_milli()
1468 return ((int64_t)val->val1 * 1000000) + val->val2; in sensor_value_to_micro()
1480 if (milli < ((int64_t)INT32_MIN - 1) * 1000LL || in sensor_value_from_milli()
1482 return -ERANGE; in sensor_value_from_milli()
1485 val->val1 = (int32_t)(milli / 1000); in sensor_value_from_milli()
1486 val->val2 = (int32_t)(milli % 1000) * 1000; in sensor_value_from_milli()
1500 if (micro < ((int64_t)INT32_MIN - 1) * 1000000LL || in sensor_value_from_micro()
1502 return -ERANGE; in sensor_value_from_micro()
1505 val->val1 = (int32_t)(micro / 1000000LL); in sensor_value_from_micro()
1506 val->val2 = (int32_t)(micro % 1000000LL); in sensor_value_from_micro()