working on gpio interface and refactored author names
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"displays" :
|
||||
"display_board" :
|
||||
{
|
||||
|
||||
},
|
||||
@@ -7,7 +7,7 @@
|
||||
{
|
||||
"i2c_address" : 32,
|
||||
"pin_base" : 65,
|
||||
"latch-select" :
|
||||
"pin-select" :
|
||||
{
|
||||
"A" : 0,
|
||||
"B" : 1,
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"data" : 3,
|
||||
"CL" : 4,
|
||||
"mux-select" :
|
||||
"latch-select" :
|
||||
{
|
||||
"A" : 5,
|
||||
"B" : 6,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputEvent.h
|
||||
*
|
||||
* Created on: Apr 5, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef INPUTEVENT_H_
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Please be aware that handle must be implemented thread safe!
|
||||
*
|
||||
* Created on: Apr 5, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef INPUTEVENTHANDLER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IEventHandler.h
|
||||
*
|
||||
* Created on: Jun 13, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_IEVENTHANDLER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IInputDriver.h
|
||||
*
|
||||
* Created on: Jun 14, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_INPUT_IINPUTDRIVER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IOutputDriver.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_IOUTPUTDRIVER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ILamp.h
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_ILAMP_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IOutputDisplay.h
|
||||
*
|
||||
* Created on: Nov 20, 2018
|
||||
* Author: johannes
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_OUTPUT_IOUTPUTDISPLAY_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ISolenoid.h
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_ISOLENOID_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ISound.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_ISOUND_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Detector.cpp
|
||||
*
|
||||
* Created on: Apr 5, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "Detector.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* The other cycles over the queue and notifies input event handlers.
|
||||
*
|
||||
* Created on: Apr 5, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef DETECTOR_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ErrorEvent.h
|
||||
*
|
||||
* Created on: Aug 8, 2018
|
||||
* Author: johannes
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_INPUT_ERROREVENT_HPP_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Event.cpp
|
||||
*
|
||||
* Created on: Jun 15, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
#include "input/Event.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* EventHandler.cpp
|
||||
*
|
||||
* Created on: Jun 14, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
#include "input/EventHandler.h"
|
||||
#include "utility/config.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* EventNotifier.cpp
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputEventNotifier.h
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_INPUT_EVENTNOTIFIER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IDetector.h
|
||||
*
|
||||
* Created on: Jun 13, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_INPUT_IDETECTOR_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IEventNotifier.h
|
||||
*
|
||||
* Created on: Jun 13, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_INPUT_IEVENTNOTIFIER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputDriver.cpp
|
||||
*
|
||||
* Created on: Jun 15, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
#include "InputDriver.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputDriver.hpp
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
#ifndef SRC_INPUT_INPUTDRIVER_H_
|
||||
#define SRC_INPUT_INPUTDRIVER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputDriverFactory.cpp
|
||||
*
|
||||
* Created on: Jun 14, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputFactory.h
|
||||
*
|
||||
* Created on: Apr 5, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef INPUTFACTORY_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* DisplayController.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "DisplayController.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* DisplayController.h
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_DISPLAYCONTROLLER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IDisplayController.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_IDISPLAYCONTROLLER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* OutputDriver.cpp
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "OutputDriver.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* OutputDriver.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_OUTPUTDRIVER_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Display.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_DISPLAY_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* IDisplay.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_IDISPLAY_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ICabinetItem.h
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_ICABINETITEM_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* CabinetItem.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_CABINETITEM_H_
|
||||
@@ -25,11 +25,11 @@ namespace items
|
||||
class OutputItem : public IOutputItem
|
||||
{
|
||||
public:
|
||||
OutputItem(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin_address, std::string name);
|
||||
OutputItem(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name);
|
||||
virtual ~OutputItem();
|
||||
|
||||
public:
|
||||
const unsigned int address, i2c_address, data_pin_address;
|
||||
const u_int8_t address;
|
||||
const std::string name;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Lamp.cpp
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "Lamp.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Lamp.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_LAMP_H_
|
||||
@@ -21,7 +21,7 @@ namespace items
|
||||
class Lamp : public OutputItem, ILamp
|
||||
{
|
||||
public:
|
||||
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin, std::string name);
|
||||
Lamp(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, u_int8_t address, std::string name);
|
||||
virtual ~Lamp() = default;
|
||||
|
||||
void activate();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Solenoid.cpp
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "Solenoid.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Solenoid.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_SOLENOID_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Sound.cpp
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "Sound.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Sound.h
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef _SRC_OUTPUT_SOUND_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* BlockingQueue.hpp
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_BLOCKINGQUEUE_HPP_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* DisplayGPIOInterface.cpp
|
||||
*
|
||||
* Created on: Nov 9, 2018
|
||||
* Author: johannes
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "DisplayGPIOInterface.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* DisplayGPIOInterface.h
|
||||
*
|
||||
* Created on: Nov 9, 2018
|
||||
* Author: johannes
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITY_DISPLAYGPIOINTERFACE_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* GPIOInterface.cpp
|
||||
*
|
||||
* Created on: Jun 15, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "GPIOInterface.h"
|
||||
@@ -29,6 +29,11 @@ void GPIOInterface::initialize_input_pin(char address)
|
||||
pinMode(address, INPUT);
|
||||
}
|
||||
|
||||
void GPIOInterface::initialize_output_pin(char address)
|
||||
{
|
||||
pinMode(address, OUTPUT);
|
||||
}
|
||||
|
||||
void GPIOInterface::write_pin(char address, char data)
|
||||
{
|
||||
digitalWrite(address, data);
|
||||
@@ -39,10 +44,6 @@ bool GPIOInterface::read_pin(char address)
|
||||
return PULLDOWN == digitalRead(address);
|
||||
}
|
||||
|
||||
void GPIOInterface::initialize_output_pin(char address)
|
||||
{
|
||||
pinMode(address, OUTPUT);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* TODO
|
||||
*
|
||||
* Created on: May 6, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_GPIOINTERFACE_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* BlockingQueue.hpp
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_IBLOCKINGQUEUE_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputGPIOInterface.h
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_IINPUTGPIOINTERFACE_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputGPIOInterface.cpp
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* InputGPIOInterface.h
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_INPUTGPIOINTERFACE_H_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* LoggerFactory.hpp
|
||||
*
|
||||
* Created on: Jun 19, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_LOGGERFACTORY_HPP_
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* OutputGPIOInterface.h
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "OutputGPIOInterface.h"
|
||||
@@ -18,18 +18,56 @@ OutputGPIOInterface::OutputGPIOInterface(std::istream &output_config_stream)
|
||||
json output_config;
|
||||
output_config_stream >> output_config;
|
||||
|
||||
parse_pin_bases(output_config);
|
||||
parse_output_config(output_config);
|
||||
|
||||
initialize_i2c_addresses(output_config);
|
||||
|
||||
initialize_pins();
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::initialize_i2c_addresses(json &output_config)
|
||||
void OutputGPIOInterface::parse_output_config(json &output_config)
|
||||
{
|
||||
mcp23017Setup(i2c_address_driver_board, parse_i2c_address_driver_board(output_config));
|
||||
mcp23017Setup(i2c_address_sounds, parse_i2c_address_sound_board(output_config));
|
||||
mcp23017Setup(pin_base_displays, parse_i2c_address_display_board(output_config));
|
||||
parse_pins_driver_board(output_config.at("driver_board"));
|
||||
parse_pins_sound(output_config.at("sound_board"));
|
||||
parse_pins_sound(output_config.at("display_board"));
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::parse_pins_driver_board(json &driver_board_config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::parse_pins_sound(json &sound_board_config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::parse_pins_display(json &display_board_config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::initialize_pins()
|
||||
{
|
||||
// Since this are all outputs we just initialize everything as output conveniently
|
||||
initialize_all_pins(pins_driver_board["pin_base"]);
|
||||
initialize_all_pins(pins_sound_board["pin_base"]);
|
||||
initialize_all_pins(pins_display_board["pin_base"]);
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::initialize_all_pins(u_int8_t pin_base)
|
||||
{
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
initialize_output_pin(pin_base + i);
|
||||
}
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::initialize_i2c_addresses()
|
||||
{
|
||||
mcp23017Setup(pins_driver_board["pin_base"], pins_driver_board["i2c_address"]);
|
||||
mcp23017Setup(pins_sound_board["pin_base"], pins_sound_board["i2c_address"]);
|
||||
mcp23017Setup(pins_display_board["pin_base"], pins_display_board["i2c_address"]);
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::activate_output_item(IOutputItem *item)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* OutputGPIOInterface.h
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#ifndef SRC_UTILITIES_OUTPUTGPIOINTERFACE_H_
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <mcp23017.h>
|
||||
#include <mutex>
|
||||
|
||||
#include <map>
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace utility
|
||||
@@ -23,6 +23,7 @@ namespace utility
|
||||
|
||||
class OutputGPIOInterface : public GPIOInterface
|
||||
{
|
||||
using namespace nlohmann;
|
||||
|
||||
public:
|
||||
OutputGPIOInterface(std::istream &output_config_stream);
|
||||
@@ -40,27 +41,23 @@ public:
|
||||
void write_display(output::items::IDisplay &display);
|
||||
|
||||
private:
|
||||
void parse_pin_bases(json &output_config_stream);
|
||||
void initialize_i2c_addresses(json &output_config);
|
||||
|
||||
char parse_i2c_address_driver_board(json &output_config_stream);
|
||||
char parse_i2c_address_sound_board(json &output_config_stream);
|
||||
char parse_i2c_address_display_board(json &output_config_stream);
|
||||
void parse_output_config(json &output_config);
|
||||
void parse_pins_driver_board(json &driver_board_config);
|
||||
void parse_pins_sound(json &sound_board_config);
|
||||
void parse_pins_display(json &display_board_config);
|
||||
void initialize_i2c_addresses();
|
||||
|
||||
void initialize_pins();
|
||||
void initialize_all_pins(u_int8_t pin_base);
|
||||
|
||||
void activate(output::items::IOutputItem outputItem);
|
||||
|
||||
private:
|
||||
std::mutex output_item_mutex;
|
||||
|
||||
unsigned int pin_base_driver_board;
|
||||
unsigned int pin_base_sounds;
|
||||
unsigned int pin_base_displays;
|
||||
|
||||
|
||||
|
||||
|
||||
std::map<std::string, u_int8_t> pins_driver_board = {{"i2c_address", 0}, {"pin_base", 0}, {"data", 0}. {"CL", 0}, {"latch-select-A", "0"}, {"latch-select-B", "0"}, {"latch-select-C", 0}, {"mux1", 0}, {"mux2", 0}, {"pin-select-A", 0}, {"pin-select-B", 0}, {"pin-select-C", 0}};
|
||||
std::map<std::string, u_int8_t> pins_sound = {{"i2c_address", 0}, {"pin_base", 0}, {"fire", 0}. {"A", 0}, {"B", "0"}, {"C", "0"}, {"D", 0}, {"E", 0}, {"F", 0}, {"G", 0}};
|
||||
std::map<std::string, u_int8_t> pins_display = {{"i2c_address", 0}, {"pin_base", 0}, {"fire", 0}. {"A", 0}, {"B", "0"}, {"C", "0"}, {"D", 0}, {"E", 0}, {"F", 0}, {"G", 0}};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* BlockingQueue.hpp
|
||||
*
|
||||
* Created on: May 17, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "easylogging++.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestDetector.cpp
|
||||
*
|
||||
* Created on: Jun 27, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestEventHandler.cpp
|
||||
*
|
||||
* Created on: Jun 28, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestEventNotifier.cpp
|
||||
*
|
||||
* Created on: Jun 19, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestInputDriver.cpp
|
||||
*
|
||||
* Created on: May 31, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* tests-main.cpp
|
||||
*
|
||||
* Created on: May 6, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestDisplay.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestDisplayController.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestLamp.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestOutputDriver.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestCabinetItem.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestSolenoid.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TestSound.cpp
|
||||
*
|
||||
* Created on: Aug 7, 2018
|
||||
* Author: rhetenor
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
Reference in New Issue
Block a user