Lines Matching +full:in +full:- +full:min

3  * SPDX-License-Identifier: Apache-2.0
22 * These are for internal use only, so skip these in public documentation.
40 enum sensor_attribute attribute, q31_t *min, q31_t *max,
56 return target && target->backend_api; in emul_sensor_backend_is_supported()
64 * @param value Expected value in fixed-point format using standard SI unit for sensor type
68 * @return -ENOTSUP if no backend API or if channel not supported by emul
69 * @return -ERANGE if provided value is not in the sensor's supported range
75 if (!target || !target->backend_api) { in emul_sensor_backend_set_channel()
76 return -ENOTSUP; in emul_sensor_backend_set_channel()
79 struct emul_sensor_driver_api *api = (struct emul_sensor_driver_api *)target->backend_api; in emul_sensor_backend_set_channel()
81 if (api->set_channel) { in emul_sensor_backend_set_channel()
82 return api->set_channel(target, ch, value, shift); in emul_sensor_backend_set_channel()
84 return -ENOTSUP; in emul_sensor_backend_set_channel()
91 * @param ch The channel to request info for. If \p ch is unsupported, return `-ENOTSUP`
92 * @param[out] lower Minimum supported sample value in SI units, fixed-point format
93 * @param[out] upper Maximum supported sample value in SI units, fixed-point format
96 * size. Uses SI units and fixed-point format.
101 * @return -ENOTSUP if no backend API or if channel not supported by emul
108 if (!target || !target->backend_api) { in emul_sensor_backend_get_sample_range()
109 return -ENOTSUP; in emul_sensor_backend_get_sample_range()
112 struct emul_sensor_driver_api *api = (struct emul_sensor_driver_api *)target->backend_api; in emul_sensor_backend_get_sample_range()
114 if (api->get_sample_range) { in emul_sensor_backend_get_sample_range()
115 return api->get_sample_range(target, ch, lower, upper, epsilon, shift); in emul_sensor_backend_get_sample_range()
117 return -ENOTSUP; in emul_sensor_backend_get_sample_range()
123 * @param[in] target Pointer to emulator instance to operate on
124 * @param[in] ch The channel to request info for. If \p ch is unsupported, return `-ENOTSUP`
125 * @param[in] attribute The attribute to set
126 * @param[in] value the value to use (cast according to the channel/attribute pair)
135 if (!target || !target->backend_api) { in emul_sensor_backend_set_attribute()
136 return -ENOTSUP; in emul_sensor_backend_set_attribute()
139 struct emul_sensor_driver_api *api = (struct emul_sensor_driver_api *)target->backend_api; in emul_sensor_backend_set_attribute()
141 if (api->set_attribute == NULL) { in emul_sensor_backend_set_attribute()
142 return -ENOTSUP; in emul_sensor_backend_set_attribute()
144 return api->set_attribute(target, ch, attribute, value); in emul_sensor_backend_set_attribute()
153 * @param[in] target Pointer to emulator instance to operate on
154 * @param[in] ch The channel to request info for. If \p ch is unsupported, return '-ENOTSUP'
155 * @param[in] attribute The attribute to request info for. If \p attribute is unsupported, return
156 * '-ENOTSUP'
157 * @param[out] min The minimum value the attribute can be set to
160 * @param[out] shift The shift for \p min, \p max, and \p increment
167 q31_t *min, q31_t *max, in emul_sensor_backend_get_attribute_metadata() argument
170 if (!target || !target->backend_api) { in emul_sensor_backend_get_attribute_metadata()
171 return -ENOTSUP; in emul_sensor_backend_get_attribute_metadata()
174 struct emul_sensor_driver_api *api = (struct emul_sensor_driver_api *)target->backend_api; in emul_sensor_backend_get_attribute_metadata()
176 if (api->get_attribute_metadata == NULL) { in emul_sensor_backend_get_attribute_metadata()
177 return -ENOTSUP; in emul_sensor_backend_get_attribute_metadata()
179 return api->get_attribute_metadata(target, ch, attribute, min, max, increment, shift); in emul_sensor_backend_get_attribute_metadata()