| bgardner@wabtec.com | 69dd204 | 2005-06-07 08:55:38 -0500 | [diff] [blame] | 1 | Kernel driver pca9539 | 
 | 2 | ===================== | 
 | 3 |  | 
| eric miao | b72540c | 2008-02-04 22:28:27 -0800 | [diff] [blame] | 4 | NOTE: this driver is deprecated and will be dropped soon, use | 
 | 5 | drivers/gpio/pca9539.c instead. | 
 | 6 |  | 
| bgardner@wabtec.com | 69dd204 | 2005-06-07 08:55:38 -0500 | [diff] [blame] | 7 | Supported chips: | 
 | 8 |   * Philips PCA9539 | 
 | 9 |     Prefix: 'pca9539' | 
 | 10 |     Addresses scanned: 0x74 - 0x77 | 
 | 11 |     Datasheet: | 
 | 12 |         http://www.semiconductors.philips.com/acrobat/datasheets/PCA9539_2.pdf | 
 | 13 |  | 
 | 14 | Author: Ben Gardner <bgardner@wabtec.com> | 
 | 15 |  | 
 | 16 |  | 
 | 17 | Description | 
 | 18 | ----------- | 
 | 19 |  | 
 | 20 | The Philips PCA9539 is a 16 bit low power I/O device. | 
 | 21 | All 16 lines can be individually configured as an input or output. | 
 | 22 | The input sense can also be inverted. | 
 | 23 | The 16 lines are split between two bytes. | 
 | 24 |  | 
 | 25 |  | 
 | 26 | Sysfs entries | 
 | 27 | ------------- | 
 | 28 |  | 
 | 29 | Each is a byte that maps to the 8 I/O bits. | 
 | 30 | A '0' suffix is for bits 0-7, while '1' is for bits 8-15. | 
 | 31 |  | 
 | 32 | input[01]     - read the current value | 
 | 33 | output[01]    - sets the output value | 
 | 34 | direction[01] - direction of each bit: 1=input, 0=output | 
 | 35 | invert[01]    - toggle the input bit sense | 
 | 36 |  | 
 | 37 | input reads the actual state of the line and is always available. | 
 | 38 | The direction defaults to input for all channels. | 
 | 39 |  | 
 | 40 |  | 
 | 41 | General Remarks | 
 | 42 | --------------- | 
 | 43 |  | 
 | 44 | Note that each output, direction, and invert entry controls 8 lines. | 
 | 45 | You should use the read, modify, write sequence. | 
 | 46 | For example. to set output bit 0 of 1. | 
 | 47 |   val=$(cat output0) | 
 | 48 |   val=$(( $val | 1 )) | 
 | 49 |   echo $val > output0 | 
 | 50 |  |