41 lines
747 B
C++
41 lines
747 B
C++
/*
|
|
* GPIOInterface.hpp
|
|
*
|
|
* Responsible for communicating with the actual GPIO hardware.
|
|
*
|
|
* Gets a JSON file with following style:
|
|
* TODO
|
|
*
|
|
* Created on: May 6, 2018
|
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
|
*/
|
|
|
|
#ifndef SRC_UTILITIES_GPIOINTERFACE_HPP_
|
|
#define SRC_UTILITIES_GPIOINTERFACE_HPP_
|
|
|
|
#include <fstream>
|
|
|
|
#include "../lib/wiringPi/wiringPi.h"
|
|
|
|
class GPIOInterface
|
|
{
|
|
public:
|
|
GPIOInterface(std::string config_path);
|
|
virtual ~GPIOInterface();
|
|
|
|
static void write_pin(char address, char data)
|
|
{
|
|
digitalWrite(address, data);
|
|
}
|
|
|
|
static bool read_pin(char address)
|
|
{
|
|
return digitalRead(address);
|
|
}
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* SRC_UTILITIES_GPIOINTERFACE_HPP_ */
|