COSA
An Object-Oriented Platform for Arduino Programming
PCF8574A Class Reference

#include <PCF8574.hh>

Inheritance diagram for PCF8574A:
Inheritance graph
Collaboration diagram for PCF8574A:
Collaboration graph

Public Member Functions

 PCF8574A (uint8_t subaddr=7)
 

Protected Member Functions

bool data_direction (uint8_t ddr)
 
bool input_pin (uint8_t pin)
 
bool output_pin (uint8_t pin)
 
bool read (uint8_t pin)
 
uint8_t read ()
 
bool write (uint8_t pin, uint8_t value)
 
bool write (uint8_t value)
 
bool write (void *buf, size_t size)
 

Protected Attributes

uint8_t m_ddr
 
uint8_t m_port
 

Static Protected Attributes

static const uint8_t PIN_MASK = 0x07
 

Detailed Description

Definition at line 158 of file PCF8574.hh.

Constructor & Destructor Documentation

PCF8574A::PCF8574A ( uint8_t  subaddr = 7)
inline

Construct connection to PCF8574A Remote 8-bit I/O expander with given sub-address.

Parameters
[in]subaddrsub-address (0..7, default 7).

Definition at line 165 of file PCF8574.hh.

Member Function Documentation

bool PCF8574::data_direction ( uint8_t  ddr)
inherited

Set data direction for port pin P0..P7; 0 for output, 1 for input. Return true if set otherwise false.

Parameters
[in]ddrdata direction mask.
Returns
bool.

Definition at line 24 of file PCF8574.cpp.

bool PCF8574::input_pin ( uint8_t  pin)
inlineinherited

Set given pin as input. Return true if set otherwise false.

Parameters
[in]pinnumber (0..7).
Returns
bool.

Definition at line 75 of file PCF8574.hh.

bool PCF8574::output_pin ( uint8_t  pin)
inlineinherited

Set given pin as output. Return true if set otherwise false.

Parameters
[in]pinnumber (0..7).
Returns
bool.

Definition at line 86 of file PCF8574.hh.

bool PCF8574::read ( uint8_t  pin)
inlineinherited

Read given pin and return true is set otherwise false.

Parameters
[in]pinnumber (0..7).
Returns
bool.

Definition at line 97 of file PCF8574.hh.

uint8_t PCF8574::read ( )
inherited

Read pins and return current values.

Returns
input pin values.

Definition at line 35 of file PCF8574.cpp.

bool PCF8574::write ( uint8_t  pin,
uint8_t  value 
)
inherited

Write set given output pin if value is non-zero, otherwise clear. Return true if successful otherwise false.

Parameters
[in]pinnumber (0..7).
[in]value.
Returns
bool.

Definition at line 45 of file PCF8574.cpp.

bool PCF8574::write ( uint8_t  value)
inherited

Write given value to the output pins. Return true if successful otherwise false. Return true if successful otherwise false.

Parameters
[in]value.
Returns
bool.

Definition at line 59 of file PCF8574.cpp.

bool PCF8574::write ( void *  buf,
size_t  size 
)
inherited

Write given values to the output pins. Return true if successful otherwise false. Return true if successful otherwise false.

Parameters
[in]bufpointer to data to write to device.
[in]sizeof buffer.
Returns
bool.

Definition at line 69 of file PCF8574.cpp.

Member Data Documentation

uint8_t PCF8574::m_ddr
protectedinherited

Data Direction Register, 0 = output, 1 = input, default all input.

Definition at line 140 of file PCF8574.hh.

uint8_t PCF8574::m_port
protectedinherited

Port Register to mask and maintain output pin values.

Definition at line 143 of file PCF8574.hh.

const uint8_t PCF8574::PIN_MASK = 0x07
staticprotectedinherited

Pin number mask.

Definition at line 137 of file PCF8574.hh.


The documentation for this class was generated from the following file: