This commit is contained in:
10
lib/DisplayProxy/DisplayProxy.h
Normal file
10
lib/DisplayProxy/DisplayProxy.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef DISPLAYPROXY_H
|
||||
#define DISPLAYPROXY_H
|
||||
class DisplayProxy
|
||||
{
|
||||
public:
|
||||
virtual bool write(int x, int y, const char *text) = 0;
|
||||
virtual bool clear() = 0;
|
||||
virtual bool setOffset(int x, int y) = 0;
|
||||
};
|
||||
#endif
|
24
lib/DisplayProxy/DisplayProxyMAX7456.cpp
Normal file
24
lib/DisplayProxy/DisplayProxyMAX7456.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include "DisplayProxyMAX7456.h"
|
||||
|
||||
DisplayProxyMAX7456::DisplayProxyMAX7456(Max7456 *osd)
|
||||
{
|
||||
this->osd = osd;
|
||||
}
|
||||
|
||||
bool DisplayProxyMAX7456::write(int x, int y, const char *text)
|
||||
{
|
||||
this->osd->print(text, x, y);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DisplayProxyMAX7456::clear()
|
||||
{
|
||||
this->osd->clearScreen();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DisplayProxyMAX7456::setOffset(int x, int y)
|
||||
{
|
||||
this->osd->setDisplayOffsets(x, y);
|
||||
return true;
|
||||
}
|
19
lib/DisplayProxy/DisplayProxyMAX7456.h
Normal file
19
lib/DisplayProxy/DisplayProxyMAX7456.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef DISPLAYPROXYMAX7456_H
|
||||
#define DISPLAYPROXYMAX7456_H
|
||||
|
||||
#include "DisplayProxy.h"
|
||||
#include "max7456.h"
|
||||
|
||||
class DisplayProxyMAX7456 : public DisplayProxy
|
||||
{
|
||||
public:
|
||||
DisplayProxyMAX7456(Max7456 *osd);
|
||||
|
||||
bool write(int x, int y, const char *text);
|
||||
bool clear() ;
|
||||
bool setOffset(int x, int y);
|
||||
private:
|
||||
Max7456 *osd;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user