Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Telliskivi2_2014 PowerManagementBoard_Rev_A_2017
PCA9555 Class Reference
Interface to the PCA9555 I2C 16 Bit IO expander. More...
#include <PCA9555.h>
Public Member Functions | |
| PCA9555 (PinName sda, PinName scl, PinName interrupPin, int address) | |
| Create an instance of the PCA9555 connected to specfied I2C pins, with the specified address. | |
| int | read () |
| Read the IO pin levels. | |
| void | write (int data) |
| Write to the IO pins. | |
| void | setPin (unsigned int pinNumber) |
| Set one pin. | |
| void | clearPin (unsigned int pinNumber) |
| Clear one pin. | |
| void | togglePin (unsigned int pinNumber) |
| Toggle one pin. | |
| bool | getPin (unsigned int pinNumber) |
| Get state of pin. | |
| void | setDirection (int data) |
| Set direction of pin. | |
Detailed Description
Interface to the PCA9555 I2C 16 Bit IO expander.
Definition at line 7 of file PCA9555.h.
Constructor & Destructor Documentation
| PCA9555 | ( | PinName | sda, |
| PinName | scl, | ||
| PinName | interrupPin, | ||
| int | address | ||
| ) |
Create an instance of the PCA9555 connected to specfied I2C pins, with the specified address.
- Parameters:
-
sda The I2C data pin scl The I2C clock pin interruptPin The pin connected to PCA9555 interrupt address The I2C address for this PCA9555
Definition at line 3 of file PCA9555.cpp.
Member Function Documentation
| void clearPin | ( | unsigned int | pinNumber ) |
Clear one pin.
- Parameters:
-
pinNumber The number of pin to clear
Definition at line 72 of file PCA9555.cpp.
| bool getPin | ( | unsigned int | pinNumber ) |
| int read | ( | ) |
| void setDirection | ( | int | data ) |
Set direction of pin.
- Parameters:
-
pinNumber The number of pin to set
Definition at line 13 of file PCA9555.cpp.
| void setPin | ( | unsigned int | pinNumber ) |
Set one pin.
- Parameters:
-
pinNumber The number of pin to set
Definition at line 67 of file PCA9555.cpp.
| void togglePin | ( | unsigned int | pinNumber ) |
Toggle one pin.
- Parameters:
-
pinNumber The number of pin to toggle
Definition at line 77 of file PCA9555.cpp.
| void write | ( | int | data ) |
Write to the IO pins.
- Parameters:
-
data The 16 bits to write to the IO port
Definition at line 52 of file PCA9555.cpp.
Generated on Wed Jul 13 2022 02:33:02 by
1.7.2