PCA9555

Dependents:   Telliskivi2_2014 PowerManagementBoard_Rev_A_2017

Committer:
Reiko
Date:
Mon Jul 29 20:36:59 2013 +0000
Revision:
0:011622696878
Child:
1:a6699cd826bb
Created PCA9555 library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Reiko 0:011622696878 1 #include "mbed.h"
Reiko 0:011622696878 2
Reiko 0:011622696878 3 #ifndef MBED_PCA9555_H
Reiko 0:011622696878 4 #define MBED_PCA9555_H
Reiko 0:011622696878 5
Reiko 0:011622696878 6 /** Interface to the PCA9555 I2C 16 Bit IO expander */
Reiko 0:011622696878 7 class PCA9555 {
Reiko 0:011622696878 8 public:
Reiko 0:011622696878 9 /** Create an instance of the PCA9555 connected to specfied I2C pins, with the specified address.
Reiko 0:011622696878 10 *
Reiko 0:011622696878 11 * @param sda The I2C data pin
Reiko 0:011622696878 12 * @param scl The I2C clock pin
Reiko 0:011622696878 13 * @param address The I2C address for this PCA9555
Reiko 0:011622696878 14 */
Reiko 0:011622696878 15 PCA9555(PinName sda, PinName scl, int address);
Reiko 0:011622696878 16
Reiko 0:011622696878 17 /** Read the IO pin level
Reiko 0:011622696878 18 *
Reiko 0:011622696878 19 * @return The two bytes read
Reiko 0:011622696878 20 */
Reiko 0:011622696878 21 int read();
Reiko 0:011622696878 22
Reiko 0:011622696878 23 /** Write to the IO pins
Reiko 0:011622696878 24 *
Reiko 0:011622696878 25 * @param data The 16 bits to write to the IO port
Reiko 0:011622696878 26 */
Reiko 0:011622696878 27 void write(int data);
Reiko 0:011622696878 28
Reiko 0:011622696878 29 private:
Reiko 0:011622696878 30 I2C _i2c;
Reiko 0:011622696878 31 int _address;
Reiko 0:011622696878 32 };
Reiko 0:011622696878 33
Reiko 0:011622696878 34 #endif