1# Copyright (c) 2018, Endre Karlson 2# Copyright (c) 2018, Song Qiang <songqiang1304521@gmail.com> 3# SPDX-License-Identifier: Apache-2.0 4 5description: ST STM32 family ADC 6 7compatible: "st,stm32-adc" 8 9include: [adc-controller.yaml, pinctrl-device.yaml] 10 11properties: 12 reg: 13 required: true 14 15 clocks: 16 required: true 17 18 interrupts: 19 required: true 20 21 "#io-channel-cells": 22 const: 1 23 24 st,adc-clock-source: 25 type: string 26 required: true 27 enum: 28 - "SYNC" 29 - "ASYNC" 30 description: | 31 Type of ADC clock source : 32 - "SYNC": derived from the bus clock. 33 - "ASYNC" : independent and asynchronous with the bus clock 34 One of the two values may not apply to some series. Refer to the RefMan. 35 If an asynchronous clock is selected, a domain clock in the clock property 36 has to be defined explicitly. 37 38 st,adc-prescaler: 39 type: int 40 required: true 41 enum: 42 - 1 # not divided 43 - 2 44 - 4 45 - 6 46 - 8 47 - 10 48 - 12 49 - 16 50 - 32 51 - 64 52 - 128 53 - 256 54 description: | 55 Clock prescaler at the input of the ADC: 56 Apply to synchronous or asynchronous clock depending on the STM32 57 st,adc-clock-source. 58 Some of the values may not apply to some series, and may depend on the 59 selected clock source. Refer to the RefMan. 60 On STM32F3x (except STM32F37x), this configures only the synchronous 61 prescaler (see properties adcXX-prescaler in st,stm32f3-rcc bindings to 62 set asynchronous prescaler). 63 64 vref-mv: 65 type: int 66 default: 3300 67 description: Indicates the reference voltage of the ADC in mV (on the target board). 68 69 resolutions: 70 type: array 71 required: true 72 description: | 73 List of the resolutions supported by the ADC instance. They should be 74 values created with STM32_ADC_RES macro or similar. Their order is not 75 important. For example for STM32F4: 76 <STM32_ADC_RES(12, 0x00) STM32_ADC_RES(10, 0x01) 77 STM32_ADC_RES(8, 0x02) STM32_ADC_RES(6, 0x03)> 78 The two parameters are the resolution (for example 10 bits) and the 79 corresponding register value (0x01 for a 10-bit resolution). 80 By design, these macros also contains all register information (address, 81 field offset and field mask) necessary to properly set the resolution. 82 83 sampling-times: 84 type: array 85 required: true 86 description: | 87 List all the sampling times supported by the ADC instance. 88 Rounded up if needed. Order is important: their index matches their binary 89 value in the register. 90 91 num-sampling-time-common-channels: 92 type: int 93 description: | 94 Number of sampling time common channels for this ADC instance, if any. 95 96 st,adc-sequencer: 97 type: string 98 required: true 99 enum: 100 - "NOT_FULLY_CONFIGURABLE" 101 - "FULLY_CONFIGURABLE" 102 description: | 103 Type of ADC sequencer: 104 - "NOT_FULLY_CONFIGURABLE": Not fully configurable sequencer 105 - "FULLY_CONFIGURABLE": Fully configurable sequencer 106 107 st,adc-oversampler: 108 type: string 109 required: true 110 enum: 111 - "OVERSAMPLER_NONE" 112 - "OVERSAMPLER_MINIMAL" 113 - "OVERSAMPLER_EXTENDED" 114 description: | 115 Type of ADC oversampler: 116 - "OVERSAMPLER_NONE": No oversampler 117 - "OVERSAMPLER_MINIMAL": Oversampler with 8 possible oversampling values (2, 4, 8, ..., 256) 118 - "OVERSAMPLER_EXTENDED": Oversampler with 1024 possible oversampling values (1..1024) 119 120io-channel-cells: 121 - input 122