Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Attributes | List of all members
rpihw::iface::input Class Reference

Input interface. More...

#include <input.hpp>

+ Inheritance diagram for rpihw::iface::input:

Public Member Functions

 input (std::initializer_list< uint8_t > pins, uint8_t pull_mode=PULL_DOWN)
 Constructor method. More...
 
 input (const std::vector< uint8_t > &pins, uint8_t pull_mode=PULL_DOWN)
 Constructor method. More...
 
virtual ~input ()
 Destructor method.
 
virtual void setPin (uint8_t index, uint8_t pin)
 Sets an input pin. More...
 
virtual size_t read () const
 Reads from the interface. More...
 
virtual bool read (uint8_t index) const
 Reads from the interface. More...
 
- Public Member Functions inherited from rpihw::iface::base
 base (std::initializer_list< uint8_t > pins)
 Constructor method. More...
 
 base (const std::vector< uint8_t > &pins)
 Constructor method. More...
 
virtual ~base ()
 Destructor method.
 
virtual uint8_t getPin (uint8_t index) const
 Returns an interface pin. More...
 
virtual uint8_t size () const
 Returns the number of the pins.
 

Protected Attributes

uint8_t m_pull_mode
 The pull resistor mode.
 
- Protected Attributes inherited from rpihw::iface::base
std::vector< uint8_t > m_pins
 Vector containing interface pins.
 
gpiom_gpio
 Virtual GPIO controller.
 

Detailed Description

Input interface.

Definition at line 43 of file input.hpp.

Constructor & Destructor Documentation

rpihw::iface::input::input ( std::initializer_list< uint8_t >  pins,
uint8_t  pull_mode = PULL_DOWN 
)

Constructor method.

Parameters
[in]pinsSequence of uint8_t containing the GPIO pins.
[in]pull_modeThe pull resistor mode.
rpihw::iface::input::input ( const std::vector< uint8_t > &  pins,
uint8_t  pull_mode = PULL_DOWN 
)

Constructor method.

Parameters
[in]pinsVector containing the GPIO pins.
[in]pull_modeThe pull resistor mode.

Member Function Documentation

virtual size_t rpihw::iface::input::read ( ) const
virtual

Reads from the interface.

Returns
The data read from the interface.

Reimplemented in rpihw::iface::decoderIn, and rpihw::iface::encoderIn.

virtual bool rpihw::iface::input::read ( uint8_t  index) const
virtual

Reads from the interface.

Parameters
[in]indexThe index position of the interface pin.
Returns
The data read from the interface.
void rpihw::iface::input::setPin ( uint8_t  index,
uint8_t  pin 
)
inlinevirtual

Sets an input pin.

Parameters
[in]indexThe index position of the input pin.
[in]pinThe new GPIO pin.

Reimplemented from rpihw::iface::base.

Definition at line 30 of file input-inl.hpp.


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