1*84943d6fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*84943d6fSEmmanuel Vadot%YAML 1.2 3*84943d6fSEmmanuel Vadot--- 4*84943d6fSEmmanuel Vadot$id: http://devicetree.org/schemas/iio/resolver/adi,ad2s1210.yaml# 5*84943d6fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*84943d6fSEmmanuel Vadot 7*84943d6fSEmmanuel Vadottitle: Analog Devices AD2S1210 Resolver-to-Digital Converter 8*84943d6fSEmmanuel Vadot 9*84943d6fSEmmanuel Vadotmaintainers: 10*84943d6fSEmmanuel Vadot - Michael Hennerich <michael.hennerich@analog.com> 11*84943d6fSEmmanuel Vadot 12*84943d6fSEmmanuel Vadotdescription: | 13*84943d6fSEmmanuel Vadot The AD2S1210 is a complete 10-bit to 16-bit resolution tracking 14*84943d6fSEmmanuel Vadot resolver-to-digital converter, integrating an on-board programmable 15*84943d6fSEmmanuel Vadot sinusoidal oscillator that provides sine wave excitation for 16*84943d6fSEmmanuel Vadot resolvers. 17*84943d6fSEmmanuel Vadot 18*84943d6fSEmmanuel Vadot The AD2S1210 allows the user to read the angular position or the 19*84943d6fSEmmanuel Vadot angular velocity data directly from the parallel outputs or through 20*84943d6fSEmmanuel Vadot the serial interface. 21*84943d6fSEmmanuel Vadot 22*84943d6fSEmmanuel Vadot The mode of operation of the communication channel (parallel or serial) is 23*84943d6fSEmmanuel Vadot selected by the A0 and A1 input pins. In normal mode, data is latched by 24*84943d6fSEmmanuel Vadot toggling the SAMPLE line and can then be read directly. In configuration mode, 25*84943d6fSEmmanuel Vadot data is read or written using a register access scheme (address byte with 26*84943d6fSEmmanuel Vadot read/write flag and data byte). 27*84943d6fSEmmanuel Vadot 28*84943d6fSEmmanuel Vadot A1 A0 Result 29*84943d6fSEmmanuel Vadot 0 0 Normal mode - position output 30*84943d6fSEmmanuel Vadot 0 1 Normal mode - velocity output 31*84943d6fSEmmanuel Vadot 1 0 Reserved 32*84943d6fSEmmanuel Vadot 1 1 Configuration mode 33*84943d6fSEmmanuel Vadot 34*84943d6fSEmmanuel Vadot In normal mode, the resolution of the digital output is selected using 35*84943d6fSEmmanuel Vadot the RES0 and RES1 input pins. In configuration mode, the resolution is 36*84943d6fSEmmanuel Vadot selected by setting the RES0 and RES1 bits in the control register. 37*84943d6fSEmmanuel Vadot 38*84943d6fSEmmanuel Vadot RES1 RES0 Resolution (Bits) 39*84943d6fSEmmanuel Vadot 0 0 10 40*84943d6fSEmmanuel Vadot 0 1 12 41*84943d6fSEmmanuel Vadot 1 0 14 42*84943d6fSEmmanuel Vadot 1 1 16 43*84943d6fSEmmanuel Vadot 44*84943d6fSEmmanuel Vadot Note on SPI connections: The CS line on the AD2S1210 should hard-wired to 45*84943d6fSEmmanuel Vadot logic low and the WR/FSYNC line on the AD2S1210 should be connected to the 46*84943d6fSEmmanuel Vadot SPI CSn output of the SPI controller. 47*84943d6fSEmmanuel Vadot 48*84943d6fSEmmanuel Vadot Datasheet: 49*84943d6fSEmmanuel Vadot https://www.analog.com/media/en/technical-documentation/data-sheets/ad2s1210.pdf 50*84943d6fSEmmanuel Vadot 51*84943d6fSEmmanuel Vadotproperties: 52*84943d6fSEmmanuel Vadot compatible: 53*84943d6fSEmmanuel Vadot const: adi,ad2s1210 54*84943d6fSEmmanuel Vadot 55*84943d6fSEmmanuel Vadot reg: 56*84943d6fSEmmanuel Vadot maxItems: 1 57*84943d6fSEmmanuel Vadot 58*84943d6fSEmmanuel Vadot spi-max-frequency: 59*84943d6fSEmmanuel Vadot maximum: 25000000 60*84943d6fSEmmanuel Vadot 61*84943d6fSEmmanuel Vadot spi-cpha: true 62*84943d6fSEmmanuel Vadot 63*84943d6fSEmmanuel Vadot avdd-supply: 64*84943d6fSEmmanuel Vadot description: 65*84943d6fSEmmanuel Vadot A 4.75 to 5.25 V regulator that powers the Analog Supply Voltage (AVDD) 66*84943d6fSEmmanuel Vadot pin. 67*84943d6fSEmmanuel Vadot 68*84943d6fSEmmanuel Vadot dvdd-supply: 69*84943d6fSEmmanuel Vadot description: 70*84943d6fSEmmanuel Vadot A 4.75 to 5.25 V regulator that powers the Digital Supply Voltage (DVDD) 71*84943d6fSEmmanuel Vadot pin. 72*84943d6fSEmmanuel Vadot 73*84943d6fSEmmanuel Vadot vdrive-supply: 74*84943d6fSEmmanuel Vadot description: 75*84943d6fSEmmanuel Vadot A 2.3 to 5.25 V regulator that powers the Logic Power Supply Input 76*84943d6fSEmmanuel Vadot (VDrive) pin. 77*84943d6fSEmmanuel Vadot 78*84943d6fSEmmanuel Vadot clocks: 79*84943d6fSEmmanuel Vadot maxItems: 1 80*84943d6fSEmmanuel Vadot description: External oscillator clock (CLKIN). 81*84943d6fSEmmanuel Vadot 82*84943d6fSEmmanuel Vadot reset-gpios: 83*84943d6fSEmmanuel Vadot description: 84*84943d6fSEmmanuel Vadot GPIO connected to the /RESET pin. As the line needs to be low for the 85*84943d6fSEmmanuel Vadot reset to be active, it should be configured as GPIO_ACTIVE_LOW. 86*84943d6fSEmmanuel Vadot maxItems: 1 87*84943d6fSEmmanuel Vadot 88*84943d6fSEmmanuel Vadot sample-gpios: 89*84943d6fSEmmanuel Vadot description: 90*84943d6fSEmmanuel Vadot GPIO connected to the /SAMPLE pin. As the line needs to be low to trigger 91*84943d6fSEmmanuel Vadot a sample, it should be configured as GPIO_ACTIVE_LOW. 92*84943d6fSEmmanuel Vadot maxItems: 1 93*84943d6fSEmmanuel Vadot 94*84943d6fSEmmanuel Vadot mode-gpios: 95*84943d6fSEmmanuel Vadot description: 96*84943d6fSEmmanuel Vadot GPIO lines connected to the A0 and A1 pins. These pins select the data 97*84943d6fSEmmanuel Vadot transfer mode. 98*84943d6fSEmmanuel Vadot minItems: 2 99*84943d6fSEmmanuel Vadot maxItems: 2 100*84943d6fSEmmanuel Vadot 101*84943d6fSEmmanuel Vadot resolution-gpios: 102*84943d6fSEmmanuel Vadot description: 103*84943d6fSEmmanuel Vadot GPIO lines connected to the RES0 and RES1 pins. These pins select the 104*84943d6fSEmmanuel Vadot resolution of the digital output. If omitted, it is assumed that the 105*84943d6fSEmmanuel Vadot RES0 and RES1 pins are hard-wired to match the assigned-resolution-bits 106*84943d6fSEmmanuel Vadot property. 107*84943d6fSEmmanuel Vadot minItems: 2 108*84943d6fSEmmanuel Vadot maxItems: 2 109*84943d6fSEmmanuel Vadot 110*84943d6fSEmmanuel Vadot fault-gpios: 111*84943d6fSEmmanuel Vadot description: 112*84943d6fSEmmanuel Vadot GPIO lines connected to the LOT and DOS pins. These pins combined indicate 113*84943d6fSEmmanuel Vadot the type of fault present, if any. As these pins a pulled low to indicate 114*84943d6fSEmmanuel Vadot a fault condition, they should be configured as GPIO_ACTIVE_LOW. 115*84943d6fSEmmanuel Vadot minItems: 2 116*84943d6fSEmmanuel Vadot maxItems: 2 117*84943d6fSEmmanuel Vadot 118*84943d6fSEmmanuel Vadot adi,fixed-mode: 119*84943d6fSEmmanuel Vadot description: 120*84943d6fSEmmanuel Vadot This is used to indicate the selected mode if A0 and A1 are hard-wired 121*84943d6fSEmmanuel Vadot instead of connected to GPIOS (i.e. mode-gpios is omitted). 122*84943d6fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string 123*84943d6fSEmmanuel Vadot enum: [config, velocity, position] 124*84943d6fSEmmanuel Vadot 125*84943d6fSEmmanuel Vadot assigned-resolution-bits: 126*84943d6fSEmmanuel Vadot description: 127*84943d6fSEmmanuel Vadot Resolution of the digital output required by the application. This 128*84943d6fSEmmanuel Vadot determines the precision of the angle and/or the maximum speed that can 129*84943d6fSEmmanuel Vadot be measured. If resolution-gpios is omitted, it is assumed that RES0 and 130*84943d6fSEmmanuel Vadot RES1 are hard-wired to match this value. 131*84943d6fSEmmanuel Vadot enum: [10, 12, 14, 16] 132*84943d6fSEmmanuel Vadot 133*84943d6fSEmmanuel Vadotrequired: 134*84943d6fSEmmanuel Vadot - compatible 135*84943d6fSEmmanuel Vadot - reg 136*84943d6fSEmmanuel Vadot - spi-cpha 137*84943d6fSEmmanuel Vadot - avdd-supply 138*84943d6fSEmmanuel Vadot - dvdd-supply 139*84943d6fSEmmanuel Vadot - vdrive-supply 140*84943d6fSEmmanuel Vadot - clocks 141*84943d6fSEmmanuel Vadot - sample-gpios 142*84943d6fSEmmanuel Vadot - assigned-resolution-bits 143*84943d6fSEmmanuel Vadot 144*84943d6fSEmmanuel VadotoneOf: 145*84943d6fSEmmanuel Vadot - required: 146*84943d6fSEmmanuel Vadot - mode-gpios 147*84943d6fSEmmanuel Vadot - required: 148*84943d6fSEmmanuel Vadot - adi,fixed-mode 149*84943d6fSEmmanuel Vadot 150*84943d6fSEmmanuel VadotallOf: 151*84943d6fSEmmanuel Vadot - $ref: /schemas/spi/spi-peripheral-props.yaml# 152*84943d6fSEmmanuel Vadot 153*84943d6fSEmmanuel VadotunevaluatedProperties: false 154*84943d6fSEmmanuel Vadot 155*84943d6fSEmmanuel Vadotexamples: 156*84943d6fSEmmanuel Vadot - | 157*84943d6fSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 158*84943d6fSEmmanuel Vadot 159*84943d6fSEmmanuel Vadot spi { 160*84943d6fSEmmanuel Vadot #address-cells = <1>; 161*84943d6fSEmmanuel Vadot #size-cells = <0>; 162*84943d6fSEmmanuel Vadot 163*84943d6fSEmmanuel Vadot resolver@0 { 164*84943d6fSEmmanuel Vadot compatible = "adi,ad2s1210"; 165*84943d6fSEmmanuel Vadot reg = <0>; 166*84943d6fSEmmanuel Vadot spi-max-frequency = <20000000>; 167*84943d6fSEmmanuel Vadot spi-cpha; 168*84943d6fSEmmanuel Vadot avdd-supply = <&avdd_regulator>; 169*84943d6fSEmmanuel Vadot dvdd-supply = <&dvdd_regulator>; 170*84943d6fSEmmanuel Vadot vdrive-supply = <&vdrive_regulator>; 171*84943d6fSEmmanuel Vadot clocks = <&ext_osc>; 172*84943d6fSEmmanuel Vadot sample-gpios = <&gpio0 90 GPIO_ACTIVE_LOW>; 173*84943d6fSEmmanuel Vadot mode-gpios = <&gpio0 86 0>, <&gpio0 87 0>; 174*84943d6fSEmmanuel Vadot resolution-gpios = <&gpio0 88 0>, <&gpio0 89 0>; 175*84943d6fSEmmanuel Vadot assigned-resolution-bits = <16>; 176*84943d6fSEmmanuel Vadot }; 177*84943d6fSEmmanuel Vadot }; 178