added some gpio documentation

pull/1/head
Simon Stürz 2014-01-26 18:41:42 +01:00
parent 05537d7b6a
commit 4962d7dcf9
1 changed files with 19 additions and 1 deletions

View File

@ -1,18 +1,36 @@
/*!
\class Gpio
\brief Handels the gpio pins from the Raspberry Pi for external hardware.
\inmodule libhive
This class provides some member funtions to interact with the gpio pins of the Raspberry Pi. With this
class it's possible to set a a direction (INPUT, OUTPUT) read or write a digital value ....
*/
#include "gpio.h"
#include <QDebug>
/*! Constructs a \l{Gpio} with the given \a parent and a specific \a gpio pin number.
*/
Gpio::Gpio(QObject *parent, int gpio) :
QThread(parent),m_gpio(gpio)
{
exportGpio();
}
/*! Destructor unexports the pin of the instance in the system
*/
Gpio::~Gpio()
{
unexportGpio();
}
/*! The method run is a virtual member function from the QThread class. In this method runs the while loop
* which enables an interrupt, if something on the pin changed.
*/
void Gpio::run()
{
struct pollfd fdset[2];