PCF8574 I2C IO Expander Interface

Dependents:   PCF8574_HelloWorld PCF8574_I2C_4x4_Keypad PCF8574_I2C_4x4_Keypad_interface PCF8574_ButtonPress

Embed: (wiki syntax)

« Back to documentation index

PCF8574 Class Reference

PCF8574 Class Reference

Interface to the popular PCF8574 I2C 8 Bit IO expander. More...

#include <PCF8574.h>

Public Member Functions

 PCF8574 (PinName sda, PinName scl, int address)
 Create an instance of the PCF8574 connected to specfied I2C pins, with the specified address.
int read ()
 Read the IO pin level.
void write (int data)
 Write to the IO pins.

Detailed Description

Interface to the popular PCF8574 I2C 8 Bit IO expander.

Definition at line 29 of file PCF8574.h.


Constructor & Destructor Documentation

PCF8574 ( PinName  sda,
PinName  scl,
int  address 
)

Create an instance of the PCF8574 connected to specfied I2C pins, with the specified address.

Parameters:
sdaThe I2C data pin
sclThe I2C clock pin
addressThe I2C address for this PCF8574

Definition at line 26 of file PCF8574.cpp.


Member Function Documentation

int read (  )

Read the IO pin level.

Returns:
The byte read

Definition at line 31 of file PCF8574.cpp.

void write ( int  data )

Write to the IO pins.

Parameters:
dataThe 8 bits to write to the IO port

Definition at line 37 of file PCF8574.cpp.