@@ -63,6 +63,16 @@ enum {
63
63
BB_PANEL_CUSTOM,
64
64
BB_PANEL_COUNT
65
65
};
66
+
67
+ // Pre-configured displays
68
+ enum {
69
+ BBEP_DISPLAY_EC060TC1,
70
+ BBEP_DISPLAY_ED0970TC1,
71
+ BBEP_DISPLAY_ED103TC2,
72
+ BBEP_DISPLAY_ED052TC4,
73
+ BBEP_DISPLAY_COUNT
74
+ };
75
+
66
76
// A complete description of an EPD panel
67
77
typedef struct _paneldef {
68
78
uint16_t width;
@@ -96,6 +106,14 @@ typedef struct bbepr {
96
106
int h;
97
107
} BBEPRECT;
98
108
109
+ // To access external IO through a single function pointer
110
+ // This enum defines the operation
111
+ enum {
112
+ BB_EXTIO_SET_MODE=0 ,
113
+ BB_EXTIO_WRITE,
114
+ BB_EXTIO_READ
115
+ };
116
+
99
117
// Display clearing pass type
100
118
enum {
101
119
BB_CLEAR_LIGHTEN = 0 ,
@@ -143,13 +161,16 @@ typedef int (BB_IO_INIT)(void *pBBEP);
143
161
typedef void (BB_IO_DEINIT)(void *pBBEP);
144
162
// Callback function for controlling the row start/step
145
163
typedef void (BB_ROW_CONTROL)(void *pBBEP, int iMode);
164
+ // Callback function to access external IO expanders
165
+ typedef uint8_t (BB_EXT_IO)(uint8_t iOP, uint8_t iPin, uint8_t iValue);
146
166
147
167
typedef struct tag_bbeppanelprocs
148
168
{
149
169
BB_EINK_POWER *pfnEinkPower;
150
170
BB_IO_INIT *pfnIOInit;
151
171
BB_ROW_CONTROL *pfnRowControl;
152
172
BB_IO_DEINIT *pfnIODeInit;
173
+ BB_EXT_IO *pfnExtIO;
153
174
} BBPANELPROCS;
154
175
155
176
typedef struct tag_fastepdstate
@@ -172,6 +193,7 @@ typedef struct tag_fastepdstate
172
193
BB_SET_PIXEL *pfnSetPixel;
173
194
BB_SET_PIXEL_FAST *pfnSetPixelFast;
174
195
BB_EINK_POWER *pfnEinkPower;
196
+ BB_EXT_IO *pfnExtIO;
175
197
BB_IO_INIT *pfnIOInit;
176
198
BB_IO_DEINIT *pfnIODeInit;
177
199
BB_ROW_CONTROL *pfnRowControl;
@@ -188,10 +210,14 @@ class FASTEPD
188
210
FASTEPD () {memset (&_state, 0 , sizeof (_state)); _state.iFont = FONT_8x8; _state.iFG = BBEP_BLACK;}
189
211
int initPanel (int iPanelType);
190
212
int initCustomPanel (BBPANELDEF *pPanel, BBPANELPROCS *pProcs);
213
+ int setPanelSize (int iPanel);
191
214
int setCustomMatrix (const uint8_t *pMatrix, size_t matrix_size);
192
215
int setPanelSize (int width, int height, int flags = BB_PANEL_FLAG_NONE);
193
216
int getStringBox (const char *text, BBEPRECT *pRect);
194
217
int setMode (int iMode); // set graphics mode
218
+ void ioPinMode (uint8_t u8Pin, uint8_t iMode);
219
+ void ioWrite (uint8_t u8Pin, uint8_t iValue);
220
+ uint8_t ioRead (uint8_t u8Pin);
195
221
int getMode (void ) {return _state.mode ;}
196
222
uint8_t *previousBuffer (void ) { return _state.pPrevious ;}
197
223
uint8_t *currentBuffer (void ) { return _state.pCurrent ;}
0 commit comments