Class that stores state and functions for interacting with the PCF8575 I2C Expander.
More...
#include <Adafruit_PCF8575.h>
Class that stores state and functions for interacting with the PCF8575 I2C Expander.
◆ begin()
Sets up the hardware and initializes I2C.
- Parameters
-
i2c_address | The I2C address to be used. |
wire | The Wire object to be used for I2C connections. |
- Returns
- True if initialization was successful, otherwise false.
◆ digitalWriteWord()
bool Adafruit_PCF8575::digitalWriteWord |
( |
uint16_t |
d | ) |
|
Write one 'word' of data directly to the GPIO control register.
- Parameters
-
- Returns
- True if we were able to write the data successfully over I2C
◆ digitalWrite()
bool Adafruit_PCF8575::digitalWrite |
( |
uint8_t |
pinnum, |
|
|
bool |
val |
|
) |
| |
Set one GPIO expander pin to 'high' (weak pullup) or 'low' (grounded)
- Parameters
-
pinnum | The GPIO pin number, from 0 to 7 inclusive |
val | The boolean value to write: true means activate the pullup and false means turn on the sinking transistor. |
- Returns
- True if we were able to write the data successfully over I2C
◆ digitalReadWord()
uint16_t Adafruit_PCF8575::digitalReadWord |
( |
void |
| ) |
|
Read one 'word' of data directly from the GPIO control register.
- Returns
- The byte of data read from the device
◆ digitalRead()
bool Adafruit_PCF8575::digitalRead |
( |
uint8_t |
pinnum | ) |
|
Get a GPIO expander pin value.
- Parameters
-
pinnum | The GPIO pin number, from 0 to 7 inclusive |
- Returns
- True if the pin logic is NOT ground, false if the pin logic is ground
◆ pinMode()
bool Adafruit_PCF8575::pinMode |
( |
uint8_t |
pinnum, |
|
|
uint8_t |
val |
|
) |
| |
Set one GPIO expander pin to 'output' (grounded) or 'input' (weak pullup)
- Parameters
-
pinnum | The GPIO pin number, from 0 to 15 inclusive |
val | The value to write: INPUT or INPUT_PULLUP means activate the pullup and OUTPUT means turn on the sinking transistor, as this is an open drain device |
- Returns
- True if we were able to write the data successfully over I2C
The documentation for this class was generated from the following files: