trennen
This commit is contained in:
42
FlippR-Driver/src/utilities/GPIOInterface.h
Normal file
42
FlippR-Driver/src/utilities/GPIOInterface.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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_H_
|
||||
#define SRC_UTILITIES_GPIOINTERFACE_H_
|
||||
|
||||
#include <fstream>
|
||||
#include "config.h"
|
||||
|
||||
#include "../lib/wiringPi/wiringPi.h"
|
||||
#include "../lib/json/json.hpp"
|
||||
|
||||
class GPIOInterface
|
||||
{
|
||||
public:
|
||||
GPIOInterface();
|
||||
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_H_ */
|
||||
Reference in New Issue
Block a user