brintos

brintos / linux-shallow public Read only

0
0
Text · 3.1 KiB · 5c4e85f Raw
99 lines · plain
1Kernel driver pcf85912=====================3 4Supported chips:5 6  * Philips/NXP PCF85917 8    Prefix: 'pcf8591'9 10    Addresses scanned: none11 12    Datasheet: Publicly available at the NXP website13 14	       http://www.nxp.com/pip/PCF8591_6.html15 16Authors:17      - Aurelien Jarno <aurelien@aurel32.net>18      - valuable contributions by Jan M. Sendler <sendler@sendler.de>,19      - Jean Delvare <jdelvare@suse.de>20 21 22Description23-----------24 25The PCF8591 is an 8-bit A/D and D/A converter (4 analog inputs and one26analog output) for the I2C bus produced by Philips Semiconductors (now NXP).27It is designed to provide a byte I2C interface to up to 4 separate devices.28 29The PCF8591 has 4 analog inputs programmable as single-ended or30differential inputs:31 32- mode 0 : four single ended inputs33	Pins AIN0 to AIN3 are single ended inputs for channels 0 to 334 35- mode 1 : three differential inputs36	Pins AIN3 is the common negative differential input37	Pins AIN0 to AIN2 are positive differential inputs for channels 0 to 238 39- mode 2 : single ended and differential mixed40	Pins AIN0 and AIN1 are single ended inputs for channels 0 and 141	Pins AIN2 is the positive differential input for channel 342	Pins AIN3 is the negative differential input for channel 343 44- mode 3 : two differential inputs45	Pins AIN0 is the positive differential input for channel 046	Pins AIN1 is the negative differential input for channel 047	Pins AIN2 is the positive differential input for channel 148	Pins AIN3 is the negative differential input for channel 149 50See the datasheet for details.51 52Module parameters53-----------------54 55* input_mode int56 57    Analog input mode:58 59	 - 0 = four single ended inputs60	 - 1 = three differential inputs61	 - 2 = single ended and differential mixed62	 - 3 = two differential inputs63 64 65Accessing PCF8591 via /sys interface66-------------------------------------67 68The PCF8591 is plainly impossible to detect! Thus the driver won't even69try. You have to explicitly instantiate the device at the relevant70address (in the interval [0x48..0x4f]) either through platform data, or71using the sysfs interface. See Documentation/i2c/instantiating-devices.rst72for details.73 74Directories are being created for each instantiated PCF8591:75 76/sys/bus/i2c/devices/<0>-<1>/77   where <0> is the bus the chip is connected to (e. g. i2c-0)78   and <1> the chip address ([48..4f])79 80Inside these directories, there are such files:81 82   in0_input, in1_input, in2_input, in3_input, out0_enable, out0_output, name83 84Name contains chip name.85 86The in0_input, in1_input, in2_input and in3_input files are RO. Reading gives87the value of the corresponding channel. Depending on the current analog inputs88configuration, files in2_input and in3_input may not exist. Values range89from 0 to 255 for single ended inputs and -128 to +127 for differential inputs90(8-bit ADC).91 92The out0_enable file is RW. Reading gives "1" for analog output enabled and93"0" for analog output disabled. Writing accepts "0" and "1" accordingly.94 95The out0_output file is RW. Writing a number between 0 and 255 (8-bit DAC), send96the value to the digital-to-analog converter. Note that a voltage will97only appears on AOUT pin if aout0_enable equals 1. Reading returns the last98value written.99