PCA9555
Dependents: Telliskivi2_2014 PowerManagementBoard_Rev_A_2017
Diff: PCA9555.h
- Revision:
- 6:0373a167d58b
- Parent:
- 5:73884f49ed97
- Parent:
- 4:fe1637c9409f
- Child:
- 7:3b54389686ca
diff -r 73884f49ed97 -r 0373a167d58b PCA9555.h --- a/PCA9555.h Mon Sep 16 16:09:56 2013 +0000 +++ b/PCA9555.h Mon Sep 16 16:11:32 2013 +0000 @@ -2,7 +2,6 @@ #define MBED_PCA9555_H #include "mbed.h" -//#include "PinDetect.h" /** Interface to the PCA9555 I2C 16 Bit IO expander */ class PCA9555 { @@ -14,11 +13,12 @@ * * @param sda The I2C data pin * @param scl The I2C clock pin + * @param interruptPin The pin connected to PCA9555 interrupt * @param address The I2C address for this PCA9555 */ PCA9555(PinName sda, PinName scl, PinName interrupPin, int address); - /** Read the IO pin level + /** Read the IO pin levels * * @return The two bytes read */ @@ -30,12 +30,35 @@ */ void write(int data); + /** Set one pin + * + * @param pinNumber The number of pin to set + */ void setPin(unsigned int pinNumber); + + /** Clear one pin + * + * @param pinNumber The number of pin to clear + */ void clearPin(unsigned int pinNumber); + + /** Toggle one pin + * + * @param pinNumber The number of pin to toggle + */ void togglePin(unsigned int pinNumber); + + /** Get state of pin + * + * @param pinNumber The number of pin + */ bool getPin(unsigned int pinNumber); void writePins(); + /** Set direction of pin + * + * @param pinNumber The number of pin to set + */ void setDirection(int data); void change(void (*function)(void));