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

GPIO controller. More...

#include <io-expander.hpp>

+ Inheritance diagram for rpihw::driver::io_expander:

Public Member Functions

virtual void setup (uint8_t pin, uint8_t mode, uint8_t pull_mode=PULL_OFF)
 Sets the mode of a GPIO pin. More...
 
virtual void write (uint8_t pin, bool value)
 Sets the value of a output pin. More...
 
virtual bool read (uint8_t pin)
 Returns the value of a input pin. More...
 
virtual bool checkEvent (uint8_t pin)
 Returns the event state of a GPIO pin. More...
 
virtual void setRisingEvent (uint8_t pin, bool enabled)
 Enables/disables the rising edge event on a GPIO pin. More...
 
virtual void setFallingEvent (uint8_t pin, bool enabled)
 Enables/disables the falling edge event on a GPIO pin. More...
 
virtual void setHighEvent (uint8_t pin, bool enabled)
 Enables/disables the high event on a GPIO pin. More...
 
virtual void setLowEvent (uint8_t pin, bool enabled)
 Enables/disables the low event on a GPIO pin. More...
 
virtual void setPullUpDown (uint8_t pin, uint8_t mode)
 Enables/disables the pull-up/down control on a GPIO pin. More...
 

Detailed Description

GPIO controller.

Definition at line 40 of file io-expander.hpp.

Member Function Documentation

virtual bool rpihw::driver::io_expander::checkEvent ( uint8_t  pin)
virtual

Returns the event state of a GPIO pin.

Parameters
[in]pinThe GPIO pin.
Returns
The event state.
virtual bool rpihw::driver::io_expander::read ( uint8_t  pin)
virtual

Returns the value of a input pin.

Parameters
[in]pinThe input pin.
Returns
The value of input pin.

Reimplemented in rpihw::driver::mcp23x08, and rpihw::driver::mcp23x17.

virtual void rpihw::driver::io_expander::setFallingEvent ( uint8_t  pin,
bool  enabled 
)
virtual

Enables/disables the falling edge event on a GPIO pin.

Parameters
[in]pinThe GPIO pin.
[in]enabledIf true enable the falling edge event.
virtual void rpihw::driver::io_expander::setHighEvent ( uint8_t  pin,
bool  enabled 
)
virtual

Enables/disables the high event on a GPIO pin.

Parameters
[in]pinThe GPIO pin.
[in]enabledIf true enable the high event.
virtual void rpihw::driver::io_expander::setLowEvent ( uint8_t  pin,
bool  enabled 
)
virtual

Enables/disables the low event on a GPIO pin.

Parameters
[in]pinThe GPIO pin.
[in]enabledIf true enable the low event.
virtual void rpihw::driver::io_expander::setPullUpDown ( uint8_t  pin,
uint8_t  mode 
)
virtual

Enables/disables the pull-up/down control on a GPIO pin.

Parameters
[in]pinThe GPIO pin.
[in]modeThe pull resistor mode.

Reimplemented in rpihw::driver::mcp23x08, and rpihw::driver::mcp23x17.

virtual void rpihw::driver::io_expander::setRisingEvent ( uint8_t  pin,
bool  enabled 
)
virtual

Enables/disables the rising edge event on a GPIO pin.

Parameters
[in]pinThe GPIO pin.
[in]enabledIf true enable the rising edge event.
virtual void rpihw::driver::io_expander::setup ( uint8_t  pin,
uint8_t  mode,
uint8_t  pull_mode = PULL_OFF 
)
virtual

Sets the mode of a GPIO pin.

Parameters
[in]pinThe GPIO pin.
[in]modeThe GPIO mode.
[in]pull_modeThe pull resistor mode.

Reimplemented in rpihw::driver::mcp23x08, and rpihw::driver::mcp23x17.

virtual void rpihw::driver::io_expander::write ( uint8_t  pin,
bool  value 
)
virtual

Sets the value of a output pin.

Parameters
[in]pinThe output pin.
[in]valueThe value of output pin.

Reimplemented in rpihw::driver::mcp23x08, and rpihw::driver::mcp23x17.


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