refactored outpugpiointerface

This commit is contained in:
Jonas Zeunert
2018-12-04 16:28:51 +01:00
parent 6b6b185f8e
commit a60fa8bee5
17 changed files with 97 additions and 131 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
*/
#ifndef SRC_UTILITIES_GPIOINTERFACE_H_
#define SRC_UTILITIES_GPIOINTERFACE_H_
#include <mutex>
#include <fstream>
namespace flippR_driver
{
class GPIOInterface
{
public:
GPIOInterface();
virtual ~GPIOInterface() {};
protected:
static void initialize_input_pin(char address);
static void initialize_output_pin(char address);
static void write_pin(char address, char data);
static bool read_pin(char address);
public:
static std::once_flag GPIO_LIB_INITIALIZED;
private:
unsigned int pin_base;
};
}
#endif