//
// Created by rhetenor on 14.12.18.
//

#ifndef FLIPPR_DRIVER_OUTPUT_IMPL_DRIVERBOARDPINCONTROLLER_H
#define FLIPPR_DRIVER_OUTPUT_IMPL_DRIVERBOARDPINCONTROLLER_H

#include "output/DriverBoardPinController.h"

#include <map>
#include <memory>
#include <mutex>

namespace flippR_driver
{
namespace output
{
namespace detail
{

class DriverBoardPinController : public output::DriverBoardPinController
{
public:
  virtual ~DriverBoardPinController() = default;

  DriverBoardPinController(std::shared_ptr<std::mutex> output_item_mutex);

  void activate(items::DriverBoardItem & driver_board_item);
  void deactivate(items::DriverBoardItem & driver_board_item);

private:
  void write_pin(uint8_t pin, bool value) const;

private:
  std::shared_ptr<std::mutex> output_item_mutex;
};

}
}
}

#endif //FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
