Lines Matching +full:hold +full:- +full:time +full:- +full:2 +full:x

10  * SPDX-License-Identifier: Apache-2.0
17 #include <zephyr/dt-bindings/adc/adc.h>
35 ADC_GAIN_1_6, /**< x 1/6. */
36 ADC_GAIN_1_5, /**< x 1/5. */
37 ADC_GAIN_1_4, /**< x 1/4. */
38 ADC_GAIN_1_3, /**< x 1/3. */
39 ADC_GAIN_2_5, /**< x 2/5. */
40 ADC_GAIN_1_2, /**< x 1/2. */
41 ADC_GAIN_2_3, /**< x 2/3. */
42 ADC_GAIN_4_5, /**< x 4/5. */
43 ADC_GAIN_1, /**< x 1. */
44 ADC_GAIN_2, /**< x 2. */
45 ADC_GAIN_3, /**< x 3. */
46 ADC_GAIN_4, /**< x 4. */
47 ADC_GAIN_6, /**< x 6. */
48 ADC_GAIN_8, /**< x 8. */
49 ADC_GAIN_12, /**< x 12. */
50 ADC_GAIN_16, /**< x 16. */
51 ADC_GAIN_24, /**< x 24. */
52 ADC_GAIN_32, /**< x 32. */
53 ADC_GAIN_64, /**< x 64. */
54 ADC_GAIN_128, /**< x 128. */
71 * @retval -EINVAL if the gain could not be interpreted
79 ADC_REF_VDD_1_2, /**< VDD/2. */
98 * Acquisition time.
102 * acquisition time).
104 * Value range is 0-16383 for a given unit.
110 * This value primarily identifies the channel within the ADC API - when
125 * While this API allows identifiers from range 0-31, particular drivers
132 /** Channel type: single-ended or differential. */
159 uint8_t current_source_pin[2];
185 * #address-cells = <1>;
186 * #size-cells = <0>;
192 * zephyr,acquisition-time = <ADC_ACQ_TIME(ADC_ACQ_TIME_MICROSECONDS, 20)>;
193 * zephyr,input-positive = <NRF_SAADC_AIN6>;
194 * zephyr,input-negative = <NRF_SAADC_AIN7>;
201 * zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
202 * zephyr,input-positive = <NRF_SAADC_AIN0>;
223 * // .input-negative = NRF_SAADC_AIN7,
267 * used by this io-channel.
271 /** ADC channel identifier used by this io-channel. */
337 * @brief Get ADC io-channel information from devicetree by name.
341 * the "io-channels" property defined.
348 * io-channels = <&adc0 1>, <&adc0 3>;
349 * io-channel-names = "A0", "A1";
354 * #address-cells = <1>;
355 * #size-cells = <0>;
361 * zephyr,vref-mv = <750>;
362 * zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
408 /** @brief Get ADC io-channel information from a DT_DRV_COMPAT devicetree
422 * @brief Get ADC io-channel information from devicetree.
426 * the "io-channels" property defined.
433 * io-channels = <&adc0 1>, <&adc0 3>;
438 * #address-cells = <1>;
439 * #size-cells = <0>;
445 * zephyr,vref-mv = <750>;
446 * zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
494 /** @brief Get ADC io-channel information from a DT_DRV_COMPAT devicetree
563 * @param sampling_index Index (0-65535) of the sampling done.
588 * Optional - set to NULL if it is not needed.
616 * Bit-mask indicating the channels to be included in each sampling
641 * turns out to be not large enough to hold all the requested samples.
647 * For single-ended channels the sample values are from range:
648 * 0 .. 2^resolution - 1,
650 * - 2^(resolution-1) .. 2^(resolution-1) - 1.
656 * Each sample is averaged from 2^oversampling conversion results.
721 * @retval -EINVAL If a parameter with an invalid value has been provided.
729 return DEVICE_API_GET(adc, dev)->channel_setup(dev, channel_cfg); in z_impl_adc_channel_setup()
737 * @return A value from adc_channel_setup() or -ENOTSUP if information from
743 if (!spec->channel_cfg_dt_node_exists) { in adc_channel_setup_dt()
744 return -ENOTSUP; in adc_channel_setup_dt()
747 return adc_channel_setup(spec->dev, &spec->channel_cfg); in adc_channel_setup_dt()
760 * @retval -EINVAL If a parameter with an invalid value has been provided.
761 * @retval -ENOMEM If the provided buffer is to small to hold the results
763 * @retval -ENOTSUP If the requested mode of operation is not supported.
764 * @retval -EBUSY If another sampling was triggered while the previous one
777 return DEVICE_API_GET(adc, dev)->read(dev, sequence); in z_impl_adc_read()
792 return adc_read(spec->dev, sequence); in adc_read_dt()
825 return DEVICE_API_GET(adc, dev)->read_async(dev, sequence, async); in z_impl_adc_read_async()
840 return DEVICE_API_GET(adc, dev)->ref_internal; in adc_ref_internal()
864 * @retval -EINVAL if the gain is not reversible
890 * @return A value from adc_raw_to_millivolts() or -ENOTSUP if information from
900 if (!spec->channel_cfg_dt_node_exists) { in adc_raw_to_millivolts_dt()
901 return -ENOTSUP; in adc_raw_to_millivolts_dt()
904 if (spec->channel_cfg.reference == ADC_REF_INTERNAL) { in adc_raw_to_millivolts_dt()
905 vref_mv = (int32_t)adc_ref_internal(spec->dev); in adc_raw_to_millivolts_dt()
907 vref_mv = spec->vref_mv; in adc_raw_to_millivolts_dt()
910 resolution = spec->resolution; in adc_raw_to_millivolts_dt()
916 if (spec->channel_cfg.differential) { in adc_raw_to_millivolts_dt()
917 resolution -= 1U; in adc_raw_to_millivolts_dt()
920 return adc_raw_to_millivolts(vref_mv, spec->channel_cfg.gain, in adc_raw_to_millivolts_dt()
930 * - @ref adc_sequence.channels
931 * - @ref adc_sequence.resolution
932 * - @ref adc_sequence.oversampling
940 * @retval -ENOTSUP If @p spec does not have valid channel configuration
945 if (!spec->channel_cfg_dt_node_exists) { in adc_sequence_init_dt()
946 return -ENOTSUP; in adc_sequence_init_dt()
949 seq->channels = BIT(spec->channel_id); in adc_sequence_init_dt()
950 seq->resolution = spec->resolution; in adc_sequence_init_dt()
951 seq->oversampling = spec->oversampling; in adc_sequence_init_dt()
965 return device_is_ready(spec->dev); in adc_is_ready_dt()