1
- #include " Adafruit_SSD1676 .h"
1
+ #include " Adafruit_SSD1680 .h"
2
2
#include " Adafruit_EPD.h"
3
3
4
4
#define BUSY_WAIT 500
18
18
@param BUSY the busy pin to use
19
19
*/
20
20
/* *************************************************************************/
21
- Adafruit_SSD1676::Adafruit_SSD1676 (int width, int height, int8_t SID,
21
+ Adafruit_SSD1680::Adafruit_SSD1680 (int width, int height, int8_t SID,
22
22
int8_t SCLK, int8_t DC, int8_t RST,
23
23
int8_t CS, int8_t SRCS, int8_t MISO,
24
24
int8_t BUSY)
@@ -57,7 +57,7 @@ Adafruit_SSD1676::Adafruit_SSD1676(int width, int height, int8_t SID,
57
57
@param BUSY the busy pin to use
58
58
*/
59
59
/* *************************************************************************/
60
- Adafruit_SSD1676::Adafruit_SSD1676 (int width, int height, int8_t DC, int8_t RST,
60
+ Adafruit_SSD1680::Adafruit_SSD1680 (int width, int height, int8_t DC, int8_t RST,
61
61
int8_t CS, int8_t SRCS, int8_t BUSY)
62
62
: Adafruit_EPD(width, height, DC, RST, CS, SRCS, BUSY) {
63
63
if ((height % 8 ) != 0 ) {
@@ -85,7 +85,7 @@ Adafruit_SSD1676::Adafruit_SSD1676(int width, int height, int8_t DC, int8_t RST,
85
85
@brief wait for busy signal to end
86
86
*/
87
87
/* *************************************************************************/
88
- void Adafruit_SSD1676 ::busy_wait (void ) {
88
+ void Adafruit_SSD1680 ::busy_wait (void ) {
89
89
if (_busy_pin >= 0 ) {
90
90
while (digitalRead (_busy_pin)) { // wait for busy low
91
91
delay (10 );
@@ -101,7 +101,7 @@ void Adafruit_SSD1676::busy_wait(void) {
101
101
@param reset if true the reset pin will be toggled.
102
102
*/
103
103
/* *************************************************************************/
104
- void Adafruit_SSD1676 ::begin (bool reset) {
104
+ void Adafruit_SSD1680 ::begin (bool reset) {
105
105
Adafruit_EPD::begin (reset);
106
106
setBlackBuffer (0 , true ); // black defaults to inverted
107
107
setColorBuffer (1 , false ); // red defaults to un inverted
@@ -113,14 +113,14 @@ void Adafruit_SSD1676::begin(bool reset) {
113
113
@brief signal the display to update
114
114
*/
115
115
/* *************************************************************************/
116
- void Adafruit_SSD1676 ::update () {
116
+ void Adafruit_SSD1680 ::update () {
117
117
uint8_t buf[1 ];
118
118
119
119
// display update sequence
120
120
buf[0 ] = 0xF4 ;
121
- EPD_command (SSD1676_DISP_CTRL2 , buf, 1 );
121
+ EPD_command (SSD1680_DISP_CTRL2 , buf, 1 );
122
122
123
- EPD_command (SSD1676_MASTER_ACTIVATE );
123
+ EPD_command (SSD1680_MASTER_ACTIVATE );
124
124
busy_wait ();
125
125
126
126
if (_busy_pin <= -1 ) {
@@ -133,72 +133,72 @@ void Adafruit_SSD1676::update() {
133
133
@brief start up the display
134
134
*/
135
135
/* *************************************************************************/
136
- void Adafruit_SSD1676 ::powerUp () {
136
+ void Adafruit_SSD1680 ::powerUp () {
137
137
uint8_t buf[5 ];
138
138
139
139
hardwareReset ();
140
140
delay (100 );
141
141
busy_wait ();
142
142
143
143
// soft reset
144
- EPD_command (SSD1676_SW_RESET );
144
+ EPD_command (SSD1680_SW_RESET );
145
145
busy_wait ();
146
146
147
147
// Set display size and driver output control
148
148
buf[0 ] = (WIDTH-1 );
149
149
buf[1 ] = (WIDTH-1 ) >> 8 ;
150
150
buf[2 ] = 0x00 ;
151
- EPD_command (SSD1676_DRIVER_CONTROL , buf, 3 );
151
+ EPD_command (SSD1680_DRIVER_CONTROL , buf, 3 );
152
152
153
153
// Ram data entry mode
154
154
buf[0 ] = 0x03 ;
155
- EPD_command (SSD1676_DATA_MODE , buf, 1 );
155
+ EPD_command (SSD1680_DATA_MODE , buf, 1 );
156
156
157
157
// Set ram X start/end postion
158
158
buf[0 ] = 0x01 ;
159
159
buf[1 ] = HEIGHT / 8 ;
160
- EPD_command (SSD1676_SET_RAMXPOS , buf, 2 );
160
+ EPD_command (SSD1680_SET_RAMXPOS , buf, 2 );
161
161
162
162
// Set ram Y start/end postion
163
163
buf[2 ] = (WIDTH-1 );
164
164
buf[3 ] = (WIDTH-1 ) >> 8 ;
165
165
buf[0 ] = 0x00 ;
166
166
buf[1 ] = 0x00 ;
167
- EPD_command (SSD1676_SET_RAMYPOS , buf, 4 );
167
+ EPD_command (SSD1680_SET_RAMYPOS , buf, 4 );
168
168
169
169
// border color
170
170
buf[0 ] = 0x05 ;
171
- EPD_command (SSD1676_WRITE_BORDER , buf, 1 );
171
+ EPD_command (SSD1680_WRITE_BORDER , buf, 1 );
172
172
173
173
// Vcom Voltage
174
174
buf[0 ] = 0x36 ;
175
- EPD_command (SSD1676_WRITE_VCOM , buf, 1 );
175
+ EPD_command (SSD1680_WRITE_VCOM , buf, 1 );
176
176
177
177
// Set gate voltage
178
178
buf[0 ] = 0x17 ;
179
- EPD_command (SSD1676_GATE_VOLTAGE , buf, 1 );
179
+ EPD_command (SSD1680_GATE_VOLTAGE , buf, 1 );
180
180
181
181
// Set source voltage
182
182
buf[0 ] = 0x41 ;
183
183
buf[1 ] = 0x00 ;
184
184
buf[2 ] = 0x32 ;
185
- EPD_command (SSD1676_SOURCE_VOLTAGE , buf, 3 );
185
+ EPD_command (SSD1680_SOURCE_VOLTAGE , buf, 3 );
186
186
187
187
// Set LUT
188
188
/*
189
189
buf[0] = LUT_DATA[74];
190
- EPD_command(SSD1676_WRITE_LUT , buf, 1);
191
- EPD_command(SSD1676_WRITE_LUT , LUT_DATA, 70);
190
+ EPD_command(SSD1680_WRITE_LUT , buf, 1);
191
+ EPD_command(SSD1680_WRITE_LUT , LUT_DATA, 70);
192
192
*/
193
193
194
194
// set RAM x address count
195
195
buf[0 ] = 1 ;
196
- EPD_command (SSD1676_SET_RAMXCOUNT , buf, 1 );
196
+ EPD_command (SSD1680_SET_RAMXCOUNT , buf, 1 );
197
197
198
198
// set RAM y address count
199
199
buf[0 ] = 0 ;
200
200
buf[1 ] = 0 ;
201
- EPD_command (SSD1676_SET_RAMYCOUNT , buf, 2 );
201
+ EPD_command (SSD1680_SET_RAMYCOUNT , buf, 2 );
202
202
203
203
}
204
204
@@ -207,16 +207,16 @@ void Adafruit_SSD1676::powerUp() {
207
207
@brief wind down the display
208
208
*/
209
209
/* *************************************************************************/
210
- void Adafruit_SSD1676 ::powerDown () {
210
+ void Adafruit_SSD1680 ::powerDown () {
211
211
uint8_t buf[1 ];
212
212
// Only deep sleep if we can get out of it
213
213
if (_reset_pin >= 0 ) {
214
214
// deep sleep
215
215
buf[0 ] = 0x01 ;
216
- EPD_command (SSD1676_DEEP_SLEEP , buf, 1 );
216
+ EPD_command (SSD1680_DEEP_SLEEP , buf, 1 );
217
217
delay (100 );
218
218
} else {
219
- EPD_command (SSD1676_SW_RESET );
219
+ EPD_command (SSD1680_SW_RESET );
220
220
busy_wait ();
221
221
}
222
222
}
@@ -230,12 +230,12 @@ void Adafruit_SSD1676::powerDown() {
230
230
command
231
231
*/
232
232
/* *************************************************************************/
233
- uint8_t Adafruit_SSD1676 ::writeRAMCommand (uint8_t index) {
233
+ uint8_t Adafruit_SSD1680 ::writeRAMCommand (uint8_t index) {
234
234
if (index == 0 ) {
235
- return EPD_command (SSD1676_WRITE_RAM1 , false );
235
+ return EPD_command (SSD1680_WRITE_RAM1 , false );
236
236
}
237
237
if (index == 1 ) {
238
- return EPD_command (SSD1676_WRITE_RAM2 , false );
238
+ return EPD_command (SSD1680_WRITE_RAM2 , false );
239
239
}
240
240
return 0 ;
241
241
}
@@ -247,15 +247,15 @@ uint8_t Adafruit_SSD1676::writeRAMCommand(uint8_t index) {
247
247
@param y Y address counter value
248
248
*/
249
249
/* *************************************************************************/
250
- void Adafruit_SSD1676 ::setRAMAddress (uint16_t x, uint16_t y) {
250
+ void Adafruit_SSD1680 ::setRAMAddress (uint16_t x, uint16_t y) {
251
251
uint8_t buf[2 ];
252
252
253
253
// set RAM x address count
254
254
buf[0 ] = 1 ;
255
- EPD_command (SSD1676_SET_RAMXCOUNT , buf, 1 );
255
+ EPD_command (SSD1680_SET_RAMXCOUNT , buf, 1 );
256
256
257
257
// set RAM y address count
258
258
buf[0 ] =0 ;
259
259
buf[1 ] = 0 ;
260
- EPD_command (SSD1676_SET_RAMYCOUNT , buf, 2 );
260
+ EPD_command (SSD1680_SET_RAMYCOUNT , buf, 2 );
261
261
}
0 commit comments