mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 22:45:44 +08:00
Support for HD44780 via PCF8574
This commit is contained in:
33
HD44780.h
33
HD44780.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user