still great refactor
This commit is contained in:
45
FlippR-Driver/src/output/impl/DisplayBoardPinController.h
Normal file
45
FlippR-Driver/src/output/impl/DisplayBoardPinController.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Created by rhetenor on 14.12.18.
|
||||
//
|
||||
|
||||
#ifndef FLIPPR_DRIVER_OUTPUT_IMPL_DISPLAYPINCONTROLLER_H
|
||||
#define FLIPPR_DRIVER_OUTPUT_IMPL_DISPLAYPINCONTROLLER_H
|
||||
|
||||
#include "output/DisplayBoardPinController.h"
|
||||
|
||||
#include "PinController.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
|
||||
class DisplayBoardPinController : public output::DisplayBoardPinController, public PinController
|
||||
{
|
||||
public:
|
||||
explicit DisplayBoardPinController(std::map<std::string, uint8_t> pins_display);
|
||||
~DisplayBoardPinController() override = default;
|
||||
|
||||
void activate_displays() override;
|
||||
void deactivate_displays() override;
|
||||
|
||||
void write_display(items::IDisplay &display) override;
|
||||
|
||||
private:
|
||||
void write_display_digit(const uint8_t display_address, const char &content, const uint8_t &position);
|
||||
void select_display_segment(const uint8_t &digit);
|
||||
void select_display_digit(const char &content);
|
||||
void run_display(const uint8_t &address);
|
||||
|
||||
private:
|
||||
const std::map<std::string, uint8_t> pins_display_board;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //FLIPPR_DRIVER_DISPLAYPINCONTROLLER_H
|
||||
Reference in New Issue
Block a user