Support for HD44780 via PCF8574

This commit is contained in:
Tony Corbett G0WFV
2016-06-27 18:48:13 +01:00
parent 084e39c1de
commit 04b297de20
3 changed files with 85 additions and 8 deletions

View File

@@ -26,6 +26,7 @@
#include <vector>
#include <mcp23017.h>
#include <pcf8574.h>
enum ADAFRUIT_COLOUR {
AC_OFF,
@@ -40,14 +41,28 @@ enum ADAFRUIT_COLOUR {
// Defines for the Adafruit Pi LCD interface board
#ifdef ADAFRUIT_DISPLAY
#define AF_BASE 100
#define AF_RED (AF_BASE + 6)
#define AF_GREEN (AF_BASE + 7)
#define AF_BLUE (AF_BASE + 8)
#define AF_RW (AF_BASE + 14)
#define AF_ON LOW
#define AF_BASE 100
#define AF_RED (AF_BASE + 6)
#define AF_GREEN (AF_BASE + 7)
#define AF_BLUE (AF_BASE + 8)
#define AF_RW (AF_BASE + 14)
#define AF_ON LOW
#define AF_OFF HIGH
#define MCP23017 0x20
#define MCP23017 0x20
#endif
// Define for HD44780 connected via a PCF8574 GPIO extender
#ifdef PCF8574_DISPLAY
#define AF_BASE 100
#define AF_RS (AF_BASE + 0)
#define AF_RW (AF_BASE + 1)
#define AF_E (AF_BASE + 2)
#define AF_BL (AF_BASE + 3)
#define AF_D1 (AF_BASE + 4)
#define AF_D2 (AF_BASE + 5)
#define AF_D3 (AF_BASE + 6)
#define AF_D4 (AF_BASE + 7)
#define PCF8547 0x27
#endif
class CHD44780 : public CDisplay
@@ -105,6 +120,10 @@ private:
void adafruitLCDSetup();
void adafruitLCDColour(ADAFRUIT_COLOUR colour);
#endif
#ifdef PCF8574_DISPLAY
void pcf8574LCDSetup();
#endif
};
#endif