2016-03-14 22:58:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 by Jonathan Naylor G4KLX
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if !defined(HD44780_H)
|
|
|
|
#define HD44780_H
|
|
|
|
|
|
|
|
#include "Display.h"
|
|
|
|
|
|
|
|
#include <string>
|
2016-04-06 16:43:20 +00:00
|
|
|
#include <vector>
|
2016-03-14 22:58:09 +00:00
|
|
|
|
2016-04-17 11:11:05 +00:00
|
|
|
#include <mcp23017.h>
|
|
|
|
|
|
|
|
// Defines for the Adafruit Pi LCD interface board
|
|
|
|
#ifdef ADAFRUIT_DISPLAY
|
|
|
|
#define AF_BASE 100
|
|
|
|
#define AF_RED (AF_BASE + 6)
|
|
|
|
#define AF_RW (AF_BASE + 14)
|
|
|
|
#define MCP23017 0x20
|
|
|
|
#endif
|
|
|
|
|
2016-03-14 22:58:09 +00:00
|
|
|
class CHD44780 : public IDisplay
|
|
|
|
{
|
|
|
|
public:
|
2016-04-21 10:03:55 +00:00
|
|
|
CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector<unsigned int>& pins);
|
2016-03-14 22:58:09 +00:00
|
|
|
virtual ~CHD44780();
|
|
|
|
|
|
|
|
virtual bool open();
|
|
|
|
|
|
|
|
virtual void setIdle();
|
|
|
|
|
2016-03-21 22:47:58 +00:00
|
|
|
virtual void setError(const char* text);
|
2016-03-14 22:58:09 +00:00
|
|
|
virtual void setLockout();
|
|
|
|
|
2016-04-16 19:45:49 +00:00
|
|
|
virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
2016-03-14 22:58:09 +00:00
|
|
|
virtual void clearDStar();
|
|
|
|
|
2016-04-21 12:01:53 +00:00
|
|
|
virtual void writeDMR(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
|
2016-03-14 22:58:09 +00:00
|
|
|
virtual void clearDMR(unsigned int slotNo);
|
|
|
|
|
|
|
|
virtual void writeFusion(const char* source, const char* dest);
|
|
|
|
virtual void clearFusion();
|
|
|
|
|
|
|
|
virtual void close();
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int m_rows;
|
|
|
|
unsigned int m_cols;
|
2016-04-21 10:03:55 +00:00
|
|
|
std::string m_callsign;
|
2016-04-08 11:47:05 +00:00
|
|
|
unsigned int m_dmrid;
|
2016-04-06 16:43:20 +00:00
|
|
|
unsigned int m_rb;
|
|
|
|
unsigned int m_strb;
|
|
|
|
unsigned int m_d0;
|
|
|
|
unsigned int m_d1;
|
|
|
|
unsigned int m_d2;
|
|
|
|
unsigned int m_d3;
|
2016-03-14 22:58:09 +00:00
|
|
|
int m_fd;
|
2016-04-11 11:21:46 +00:00
|
|
|
bool m_dmr;
|
2016-04-17 11:11:05 +00:00
|
|
|
|
|
|
|
#ifdef ADAFRUIT_DISPLAY
|
|
|
|
void adafruitLCDSetup();
|
|
|
|
#endif
|
|
|
|
|
2016-03-14 22:58:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|