Arduino-TWI
Two-Wire Interface (TWI) library for Arduino
PCF8574::GPIO< PIN > Class Template Reference

#include <PCF8574.h>

Collaboration diagram for PCF8574::GPIO< PIN >:
Collaboration graph

Public Member Functions

 GPIO (PCF8574 &dev)
 
void input ()
 
void output ()
 
bool read ()
 
 operator bool ()
 
void write (int value)
 
void operator= (int value)
 

Static Public Attributes

static const uint8_t MASK = (1 << (PIN & 0x7))
 

Protected Attributes

PCF8574m_dev
 

Detailed Description

template<uint8_t PIN>
class PCF8574::GPIO< PIN >

PCF8574 based General Purpose Digital I/O pin template class.

Parameters
[in]PINindex on device (0..7).

Definition at line 136 of file PCF8574.h.

Constructor & Destructor Documentation

template<uint8_t PIN>
PCF8574::GPIO< PIN >::GPIO ( PCF8574 dev)
inline

Construct pin handler with given PCF8574 device driver.

Definition at line 144 of file PCF8574.h.

Member Function Documentation

template<uint8_t PIN>
void PCF8574::GPIO< PIN >::input ( )
inline

Set input mode.

Definition at line 149 of file PCF8574.h.

template<uint8_t PIN>
PCF8574::GPIO< PIN >::operator bool ( )
inline

Read pin state. Return true is set otherwise false. Shorthand for read().

Returns
bool.

Definition at line 180 of file PCF8574.h.

template<uint8_t PIN>
void PCF8574::GPIO< PIN >::operator= ( int  value)
inline

Assign pin state one(1) if given value is non-zero, otherwise zero(0). Shorthand for write().

Definition at line 205 of file PCF8574.h.

template<uint8_t PIN>
void PCF8574::GPIO< PIN >::output ( )
inline

Set output mode.

Definition at line 158 of file PCF8574.h.

template<uint8_t PIN>
bool PCF8574::GPIO< PIN >::read ( )
inline

Read pin state. Return true is set otherwise false.

Returns
bool.

Definition at line 168 of file PCF8574.h.

template<uint8_t PIN>
void PCF8574::GPIO< PIN >::write ( int  value)
inline

Write pin state one(1) if given value is non-zero, otherwise zero(0).

Parameters
[in]valueto write.

Definition at line 191 of file PCF8574.h.

Member Data Documentation

template<uint8_t PIN>
PCF8574& PCF8574::GPIO< PIN >::m_dev
protected

Definition at line 212 of file PCF8574.h.

template<uint8_t PIN>
const uint8_t PCF8574::GPIO< PIN >::MASK = (1 << (PIN & 0x7))
static

Pin bit position mask.

Definition at line 139 of file PCF8574.h.


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