feat(LED Matrix Display): Added support for a LED Matrix display
This commit adds support for a specific LED Matrix display, which can be used to show the number of found devices on a rather large display. We (hackerspace Brixel) used this on the mini Maker Faire Gent 2019 to show the number of found devices throughout the event
This commit is contained in:
1 parent
43a37ee0c0
commit
0060b101df
10 files changed
+1160
-3
No files matched your search
+5
-1
@@ -113,7 +113,7 @@ extern uint16_t volatile macs_total, macs_wifi, macs_ble,
|
||||
batt_voltage; // display values
|
||||
extern bool volatile TimePulseTick; // 1sec pps flag set by GPS or RTC
|
||||
extern timesource_t timeSource;
|
||||
extern hw_timer_t *displayIRQ, *ppsIRQ, *gpsIRQ;
|
||||
extern hw_timer_t *displayIRQ, *matrixDisplayIRQ, *ppsIRQ, *gpsIRQ;
|
||||
extern SemaphoreHandle_t I2Caccess;
|
||||
extern TaskHandle_t irqHandlerTask, ClockTask;
|
||||
extern TimerHandle_t WifiChanTimer;
|
||||
@@ -138,6 +138,10 @@ extern time_t volatile gps_pps_time;
|
||||
#include "display.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_MATRIX_DISPLAY
|
||||
#include "ledmatrixdisplay.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_BUTTON
|
||||
#include "button.h"
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#define DISPLAY_IRQ 0x01
|
||||
#define BUTTON_IRQ 0x02
|
||||
#define MATRIX_DISPLAY_IRQ 0x03
|
||||
#define SENDCYCLE_IRQ 0x04
|
||||
#define CYCLIC_IRQ 0x08
|
||||
#define TIMESYNC_IRQ 0x10
|
||||
@@ -23,6 +24,10 @@ int unmask_user_IRQ();
|
||||
void IRAM_ATTR DisplayIRQ();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_MATRIX_DISPLAY
|
||||
void IRAM_ATTR MatrixDisplayIRQ();
|
||||
#endif
|
||||
|
||||
#ifdef HAS_BUTTON
|
||||
void IRAM_ATTR ButtonIRQ();
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef _MATRIX_DISPLAY_H
|
||||
#define _MATRIX_DISPLAY_H
|
||||
|
||||
#include "LEDMatrix.h"
|
||||
#include "ledmatrixfonts.h"
|
||||
|
||||
extern uint8_t MatrixDisplayIsOn;
|
||||
|
||||
extern LEDMatrix matrix;
|
||||
|
||||
void init_matrix_display(const char *Productname, const char *Version);
|
||||
void refreshTheMatrixDisplay(void);
|
||||
void DrawNumber(String strNum, uint8_t iDotPos = 0);
|
||||
uint8_t GetCharFromFont(char cChar);
|
||||
uint8_t GetCharWidth(char cChar);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
// Fonts.h
|
||||
|
||||
#ifndef _FONTS_h
|
||||
#define _FONTS_h
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
struct FONT_CHAR_INFO {
|
||||
uint8_t width; // width in bits
|
||||
uint8_t height;
|
||||
uint16_t offset; // offset of char into char array
|
||||
};
|
||||
|
||||
struct FONT_INFO {
|
||||
uint8_t CharHeight;
|
||||
char StartChar;
|
||||
char EndChar;
|
||||
uint8_t SpaceWidth;
|
||||
const FONT_CHAR_INFO *Descriptors;
|
||||
const uint8_t *Bitmap;
|
||||
};
|
||||
|
||||
// Font data for Microsoft Sans Serif 11pt
|
||||
extern const uint8_t arialNarrow_17ptBitmaps[];
|
||||
|
||||
extern const uint8_t gillSansMTCondensed_18ptBitmaps[];
|
||||
extern const FONT_INFO gillSansMTCondensed_18ptFontInfo;
|
||||
extern const FONT_CHAR_INFO gillSansMTCondensed_18ptDescriptors[];
|
||||
|
||||
// Font data for Gill Sans MT Condensed 16pt
|
||||
extern const uint8_t gillSansMTCondensed_16ptBitmaps[];
|
||||
extern const FONT_INFO gillSansMTCondensed_16ptFontInfo;
|
||||
extern const FONT_CHAR_INFO gillSansMTCondensed_16ptDescriptors[];
|
||||
|
||||
// Font data for Digital-7 18pt
|
||||
extern const uint8_t digital7_18ptBitmaps[];
|
||||
extern const FONT_INFO digital7_18ptFontInfo;
|
||||
extern const FONT_CHAR_INFO digital7_18ptDescriptors[];
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user