dereviated gpiointerface

This commit is contained in:
Jonas Zeunert
2018-05-31 15:46:41 +02:00
parent 4c820110d5
commit 21565631be
7 changed files with 127 additions and 98 deletions

View File

@@ -0,0 +1,46 @@
/*
* 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/json/json.hpp"
#include "../lib/wiringPi/wiringPi.h"
using namespace nlohmann;
class GPIOInterface
{
public:
GPIOInterface(std::string config_path) = 0;
~GPIOInterface();
static void write_pin(char address, char data)
{
digitalWrite(address, data);
}
static bool read_pin(char address)
{
return digitalRead(address);
}
protected:
json config;
};
#endif /* SRC_UTILITIES_GPIOINTERFACE_HPP_ */