periph 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/examples/accelerometer/bma150/complete.js +62 -0
- package/examples/accelerometer/bma150/demo.js +65 -0
- package/examples/accelerometer/bma150/minimal.js +18 -0
- package/examples/adc_dac/hy3131/complete.js +66 -0
- package/examples/adc_dac/hy3131/demo.js +37 -0
- package/examples/adc_dac/hy3131/minimal.js +18 -0
- package/examples/discovery/complete.js +25 -0
- package/examples/discovery/demo.js +30 -0
- package/examples/discovery/minimal.js +12 -0
- package/examples/display/il0373/complete.js +71 -0
- package/examples/display/il0373/demo.js +49 -0
- package/examples/display/il0373/minimal.js +26 -0
- package/examples/display/ssd1331/complete.js +83 -0
- package/examples/display/ssd1331/demo.js +49 -0
- package/examples/display/ssd1331/minimal.js +27 -0
- package/examples/display/st7036/complete.js +71 -0
- package/examples/display/st7036/demo.js +56 -0
- package/examples/display/st7036/minimal.js +21 -0
- package/examples/display/uc1611s/complete.js +135 -0
- package/examples/display/uc1611s/complete_spi.js +128 -0
- package/examples/display/uc1611s/demo.js +90 -0
- package/examples/display/uc1611s/demo_spi.js +91 -0
- package/examples/display/uc1611s/minimal.js +28 -0
- package/examples/display/uc1611s/minimal_spi.js +30 -0
- package/examples/display/uc8159/complete.js +64 -0
- package/examples/display/uc8159/demo.js +41 -0
- package/examples/display/uc8159/minimal.js +28 -0
- package/examples/display/uc8276c/complete.js +73 -0
- package/examples/display/uc8276c/demo.js +49 -0
- package/examples/display/uc8276c/minimal.js +26 -0
- package/examples/environmental/bme280/complete.js +1 -1
- package/examples/environmental/bme280/demo.js +1 -1
- package/examples/environmental/bme280/minimal.js +1 -1
- package/examples/gyroscope/l3g4200d/complete.js +1 -1
- package/examples/gyroscope/l3g4200d/demo.js +1 -1
- package/examples/gyroscope/l3g4200d/minimal.js +1 -1
- package/examples/memory/23x1024/complete.js +54 -0
- package/examples/memory/23x1024/demo.js +51 -0
- package/examples/memory/23x1024/minimal.js +22 -0
- package/examples/memory/mx25l12845e/complete.js +66 -0
- package/examples/memory/mx25l12845e/demo.js +66 -0
- package/examples/memory/mx25l12845e/minimal.js +27 -0
- package/examples/memory/sd_spi/complete.js +55 -0
- package/examples/memory/sd_spi/demo.js +67 -0
- package/examples/memory/sd_spi/minimal.js +32 -0
- package/examples/motor/drv8830/complete.js +50 -0
- package/examples/motor/drv8830/demo.js +57 -0
- package/examples/motor/drv8830/minimal.js +23 -0
- package/examples/pressure/bmp280/complete.js +1 -1
- package/examples/pressure/bmp280/demo.js +1 -1
- package/examples/pressure/bmp280/minimal.js +1 -1
- package/examples/pressure/bmp581/complete.js +1 -1
- package/examples/pressure/bmp581/demo.js +1 -1
- package/examples/pressure/bmp581/minimal.js +1 -1
- package/examples/pressure/lps22df/complete.js +1 -1
- package/examples/pressure/lps22df/demo.js +1 -1
- package/examples/pressure/lps22df/minimal.js +1 -1
- package/examples/rtc/ds3231/complete.js +77 -0
- package/examples/rtc/ds3231/demo.js +60 -0
- package/examples/rtc/ds3231/minimal.js +23 -0
- package/examples/rtc/pcf8523/complete.js +66 -0
- package/examples/rtc/pcf8523/demo.js +65 -0
- package/examples/rtc/pcf8523/minimal.js +20 -0
- package/examples/temperature/mcp9808/complete.js +89 -0
- package/examples/temperature/mcp9808/demo.js +62 -0
- package/examples/temperature/mcp9808/minimal.js +21 -0
- package/examples/temperature/tmp117/complete.js +90 -0
- package/examples/temperature/tmp117/demo.js +73 -0
- package/examples/temperature/tmp117/minimal.js +21 -0
- package/examples/tof/vl53l0x/complete.js +118 -0
- package/examples/tof/vl53l0x/demo.js +83 -0
- package/examples/tof/vl53l0x/minimal.js +25 -0
- package/examples/tof/vl53l1x/complete.js +151 -0
- package/examples/tof/vl53l1x/demo.js +100 -0
- package/examples/tof/vl53l1x/minimal.js +25 -0
- package/package.json +1 -1
- package/src/chips/accelerometer/adxl345.js +10 -31
- package/src/chips/accelerometer/adxl362.js +7 -7
- package/src/chips/accelerometer/bma150.js +419 -0
- package/src/chips/adc_dac/ad7705.js +36 -9
- package/src/chips/adc_dac/ad7706.js +39 -9
- package/src/chips/adc_dac/hy3131.js +311 -0
- package/src/chips/display/il0373.js +607 -0
- package/src/chips/display/ssd1331.js +412 -0
- package/src/chips/display/st7036.js +401 -0
- package/src/chips/display/uc1611s.js +648 -0
- package/src/chips/display/uc8159.js +394 -0
- package/src/chips/display/uc8276c.js +658 -0
- package/src/chips/environmental/bme280.js +31 -46
- package/src/chips/environmental/bme680.js +38 -43
- package/src/chips/gas/ens160.js +18 -26
- package/src/chips/gyroscope/l3g4200d.js +34 -50
- package/src/chips/gyroscope/l3gd20h.js +24 -40
- package/src/chips/imu/mpu6050.js +29 -41
- package/src/chips/imu/mpu9250.js +45 -69
- package/src/chips/imu/mpu9255.js +54 -78
- package/src/chips/io_expander/mcp23017.js +24 -33
- package/src/chips/light/apds-9930.js +52 -60
- package/src/chips/light/apds9960.js +69 -77
- package/src/chips/magnetometer/as5600.js +13 -27
- package/src/chips/magnetometer/hmc5883l.js +32 -29
- package/src/chips/memory/_23x1024.js +228 -0
- package/src/chips/memory/_24aa02uid.js +8 -11
- package/src/chips/memory/mx25l12845e.js +467 -0
- package/src/chips/memory/sd_spi.js +486 -0
- package/src/chips/motor/drv8830.js +239 -0
- package/src/chips/other/mpr121.js +7 -7
- package/src/chips/power/ina219.js +5 -8
- package/src/chips/power/ina226.js +5 -8
- package/src/chips/power/ina3221.js +5 -8
- package/src/chips/pressure/bmp085.js +17 -11
- package/src/chips/pressure/bmp180.js +7 -7
- package/src/chips/pressure/bmp280.js +21 -33
- package/src/chips/pressure/bmp384.js +28 -39
- package/src/chips/pressure/bmp581.js +59 -70
- package/src/chips/pressure/lps22df.js +50 -52
- package/src/chips/pressure/lps28dfw.js +15 -13
- package/src/chips/pressure/lps33hw.js +7 -5
- package/src/chips/rtc/ds3231.js +504 -0
- package/src/chips/rtc/pcf8523.js +533 -0
- package/src/chips/temperature/mcp9808.js +490 -0
- package/src/chips/temperature/tmp117.js +471 -0
- package/src/chips/tof/_vl53_base.js +160 -0
- package/src/chips/tof/vl53l0x.js +816 -0
- package/src/chips/tof/vl53l1x.js +816 -0
- package/src/connection/connection.js +6 -4
- package/src/connection/dhtxx.js +5 -3
- package/src/connection/display.js +278 -0
- package/src/connection/display_mock.js +77 -0
- package/src/connection/hx711.js +5 -3
- package/src/connection/i2c.js +6 -4
- package/src/connection/i2c_mock.js +47 -0
- package/src/connection/input_pin.js +36 -5
- package/src/connection/register.js +14 -0
- package/src/connection/register_connection.js +65 -0
- package/src/connection/sipo.js +4 -2
- package/src/connection/sipo_mock.js +49 -0
- package/src/connection/smbus.js +6 -4
- package/src/connection/softspi.js +73 -0
- package/src/connection/spi.js +110 -23
- package/src/connection/spi_mock.js +50 -0
- package/src/connection/uart.js +2 -1
- package/src/discovery/discovery.js +218 -0
- package/src/discovery/registry.js +85 -0
- package/src/storage/block_device.js +95 -0
- package/src/storage/ram_block_device.js +72 -0
- package/examples/motor/.gitkeep +0 -0
- package/examples/temperature/.gitkeep +0 -0
- package/examples/tof/.gitkeep +0 -0
- package/src/chips/motor/.gitkeep +0 -0
- package/src/chips/temperature/.gitkeep +0 -0
- package/src/chips/tof/.gitkeep +0 -0
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const WIDTH = 240;
|
|
4
|
+
const HEIGHT = 128;
|
|
5
|
+
const I2C_CHUNK = 32;
|
|
6
|
+
const SPI_CHUNK = 240;
|
|
7
|
+
const MAX_ATTEMPTS = 8;
|
|
8
|
+
const RETRY_DELAY_MS = 2;
|
|
9
|
+
|
|
10
|
+
const _PAGES_RAM = 20; // RAM pages cleared at init (160 rows / 8)
|
|
11
|
+
const _CMD_TEMP = 0x24; // | TC[1:0]
|
|
12
|
+
const _CMD_PANEL = 0x28; // | PC[1:0]
|
|
13
|
+
const _CMD_PUMP = 0x2C; // | PC[3:2]
|
|
14
|
+
const _CMD_SCROLL_LO = 0x40; // | SL[3:0]
|
|
15
|
+
const _CMD_SCROLL_HI = 0x50; // | SL[7:4]
|
|
16
|
+
const _CMD_PAGE_LO = 0x60; // | PA[3:0]
|
|
17
|
+
const _CMD_PAGE_HI = 0x70; // | PA[6:4]
|
|
18
|
+
const _CMD_POTENTIOMETER = 0x81;
|
|
19
|
+
const _CMD_ISOLATION = 0x82;
|
|
20
|
+
const _CMD_PARTIAL = 0x84; // | LC[9:8]
|
|
21
|
+
const _CMD_RAM_ADDR = 0x88; // | AC[2:0]
|
|
22
|
+
const _CMD_FIXED = 0x90; // | FL[3:0]
|
|
23
|
+
const _CMD_LINE_RATE = 0xA0; // | LC[5:4]
|
|
24
|
+
const _CMD_ALL_ON = 0xA4; // | DC1
|
|
25
|
+
const _CMD_INVERSE = 0xA6; // | DC0
|
|
26
|
+
const _CMD_DISPLAY = 0xA8; // | DC[4:2]
|
|
27
|
+
const _CMD_MAPPING = 0xC0;
|
|
28
|
+
const _CMD_NLINE = 0xC8;
|
|
29
|
+
const _CMD_PATTERN = 0xD0; // | DC[7:5]
|
|
30
|
+
const _CMD_RESET = 0xE2;
|
|
31
|
+
const _CMD_NOP = 0xE3;
|
|
32
|
+
const _CMD_BIAS = 0xE8; // | BR[1:0]
|
|
33
|
+
const _CMD_COM_END = 0xF1;
|
|
34
|
+
const _CMD_PART_START = 0xF2;
|
|
35
|
+
const _CMD_PART_END = 0xF3;
|
|
36
|
+
|
|
37
|
+
const sleepMs = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
38
|
+
|
|
39
|
+
/** I²C transport: commands on the command address, RAM data on the data address (chunked). */
|
|
40
|
+
class I2CBus {
|
|
41
|
+
constructor(command, data) {
|
|
42
|
+
this._cmd = command;
|
|
43
|
+
this._data = data;
|
|
44
|
+
this.canRead = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
writeCommand(bytes) { return this._cmd.write(bytes); }
|
|
48
|
+
|
|
49
|
+
async writeData(data) {
|
|
50
|
+
for (let i = 0; i < data.length; i += I2C_CHUNK) {
|
|
51
|
+
await this._data.write(data.subarray(i, i + I2C_CHUNK));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async readStatus() {
|
|
56
|
+
await this._cmd.write(Buffer.from([_CMD_NOP]));
|
|
57
|
+
return Buffer.from(await this._cmd.read(3));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async readRam(n) {
|
|
61
|
+
return Buffer.from(await this._data.read(n + 1)).subarray(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async hardwareReset() {}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 4-wire SPI transport on a display connection: D/C# low for every command byte, high for RAM data. */
|
|
68
|
+
class SpiBus {
|
|
69
|
+
constructor(connection) {
|
|
70
|
+
this._conn = connection;
|
|
71
|
+
this.canRead = false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async writeCommand(bytes) {
|
|
75
|
+
for (const b of bytes) await this._conn.sendCommand(b);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async writeData(data) {
|
|
79
|
+
for (let i = 0; i < data.length; i += SPI_CHUNK) {
|
|
80
|
+
await this._conn.sendData(data.subarray(i, i + SPI_CHUNK));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
hardwareReset() { return this._conn.reset(); }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* UC1611s graphic LCD controller-driver — minimal interface.
|
|
89
|
+
*
|
|
90
|
+
* Drives an EA DOGXL240-7 (240 x 128 dots, 3.3 V) in 1 bit per pixel black/white mode over I²C.
|
|
91
|
+
* The chip carries the command/data bit in its I²C address, so it answers on two consecutive
|
|
92
|
+
* 7-bit addresses: 0x38 + 2n for commands and 0x39 + 2n for display RAM data (n = A3 << 1 | A2,
|
|
93
|
+
* the two address pins). The driver therefore takes two connections on the same bus.
|
|
94
|
+
*
|
|
95
|
+
* All drawing goes into a framebuffer of width * height / 8 bytes (page-major, bit 0 = top pixel
|
|
96
|
+
* of the page, 3840 bytes at 240 x 128); `show()` sends it to the display RAM. The initialization
|
|
97
|
+
* follows the DOG module's bottom-view example: System Reset, temperature compensation
|
|
98
|
+
* -0.10 %/degC, COM end 127, potentiometer (contrast) 0x8F, 1 bit per pixel, RAM cleared, display on.
|
|
99
|
+
* The constructor starts the initialisation; every method that talks to the chip waits for it,
|
|
100
|
+
* and `ready()` resolves (or rejects) when it is done.
|
|
101
|
+
*
|
|
102
|
+
* Error handling: the chip occasionally NACKs a transfer (seen on long cables and for about 6 ms
|
|
103
|
+
* while the charge pump restarts), which the bus layer reports as a rejected promise. Every
|
|
104
|
+
* transfer is retried up to MAX_ATTEMPTS times, RETRY_DELAY_MS apart: a command stream is
|
|
105
|
+
* repeated and a RAM page is rewritten from its address command (a partial write cannot be
|
|
106
|
+
* continued). Repeated attempts are counted (`retryCount()`); a transfer that still fails
|
|
107
|
+
* rejects with its error and is counted in `errorCount()`.
|
|
108
|
+
*
|
|
109
|
+
* @param {object} command - I2CConnection at the command address (0x38, 0x3A, 0x3C, 0x3E).
|
|
110
|
+
* @param {object} data - I2CConnection at the data address (command address + 1).
|
|
111
|
+
* @param {number} [width=240] - Columns, 1..240.
|
|
112
|
+
* @param {number} [height=128] - Rows, a multiple of 8 and at most 128.
|
|
113
|
+
* @param {object} [options] - Used by UC1611sFull: `{ topView, contrast }`.
|
|
114
|
+
*/
|
|
115
|
+
class UC1611sMinimal {
|
|
116
|
+
constructor(command, data, width = WIDTH, height = HEIGHT, options = {}) {
|
|
117
|
+
if (!(width >= 1 && width <= WIDTH)) throw new RangeError('width must be 1..240');
|
|
118
|
+
if (!(height >= 8 && height <= HEIGHT && height % 8 === 0)) throw new RangeError('height must be a multiple of 8, 8..128');
|
|
119
|
+
this._bus = options.bus || new I2CBus(command, data);
|
|
120
|
+
this.width = width;
|
|
121
|
+
this.height = height;
|
|
122
|
+
this._pages = height / 8;
|
|
123
|
+
this._fb = Buffer.alloc(width * this._pages);
|
|
124
|
+
const topView = !!options.topView;
|
|
125
|
+
this._contrast = options.contrast === undefined ? 0x8F : options.contrast;
|
|
126
|
+
this._mx = topView ? 0 : 1;
|
|
127
|
+
this._my = topView ? 1 : 0;
|
|
128
|
+
this._pattern = 0;
|
|
129
|
+
this._retries = 0;
|
|
130
|
+
this._errors = 0;
|
|
131
|
+
this._ready = this._initSequence();
|
|
132
|
+
this._ready.catch(() => {}); // surfaced through ready() and the first awaited call
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Resolves when initialisation has finished; rejects if it failed (for example when the
|
|
137
|
+
* chip does not acknowledge the System Reset).
|
|
138
|
+
* @returns {Promise<void>}
|
|
139
|
+
*/
|
|
140
|
+
ready() { return this._ready; }
|
|
141
|
+
|
|
142
|
+
/** @returns {boolean} True if no transfer has failed after all retries since construction or clearErrors(). */
|
|
143
|
+
ok() { return this._errors === 0; }
|
|
144
|
+
|
|
145
|
+
/** @returns {number} Number of transfer attempts that had to be repeated. */
|
|
146
|
+
retryCount() { return this._retries; }
|
|
147
|
+
|
|
148
|
+
/** @returns {number} Number of transfers that still failed after MAX_ATTEMPTS attempts. */
|
|
149
|
+
errorCount() { return this._errors; }
|
|
150
|
+
|
|
151
|
+
/** Reset the retry and error counters. */
|
|
152
|
+
clearErrors() {
|
|
153
|
+
this._retries = 0;
|
|
154
|
+
this._errors = 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ---- internals -------------------------------------------------------------------------
|
|
158
|
+
|
|
159
|
+
/** Run `fn` up to MAX_ATTEMPTS times (RETRY_DELAY_MS apart); count retries and the final failure. */
|
|
160
|
+
async _retry(fn) {
|
|
161
|
+
let err;
|
|
162
|
+
for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
|
|
163
|
+
try {
|
|
164
|
+
return await fn();
|
|
165
|
+
} catch (e) {
|
|
166
|
+
err = e;
|
|
167
|
+
this._retries++;
|
|
168
|
+
await sleepMs(RETRY_DELAY_MS);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
this._errors++;
|
|
172
|
+
throw err;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Send bytes as one command transaction on the command address, retried on failure. */
|
|
176
|
+
_command(...values) {
|
|
177
|
+
const bytes = Buffer.from(values);
|
|
178
|
+
return this._retry(() => this._bus.writeCommand(bytes));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** One pass over the data in transport-sized chunks (rejects on a NACK). */
|
|
182
|
+
_writeChunks(data) {
|
|
183
|
+
return this._bus.writeData(data);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Send RAM data without retry (the write position of a partial write is unknown). */
|
|
187
|
+
async _writeData(data) {
|
|
188
|
+
try {
|
|
189
|
+
await this._writeChunks(data);
|
|
190
|
+
} catch (e) {
|
|
191
|
+
this._errors++;
|
|
192
|
+
throw e;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
_addressBytes(page, column) {
|
|
197
|
+
const pa = (this._pattern << 5) | (page & 0x1F);
|
|
198
|
+
return Buffer.from([_CMD_PAGE_LO | (pa & 0x0F), _CMD_PAGE_HI | ((pa >> 4) & 0x07), column & 0x0F, 0x10 | (column >> 4)]);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Write one page: address command, then the data; a failure repeats both. */
|
|
202
|
+
_writePage(page, data) {
|
|
203
|
+
return this._retry(async () => {
|
|
204
|
+
await this._bus.writeCommand(this._addressBytes(page, 0));
|
|
205
|
+
await this._writeChunks(data);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Read Status1..3; a NOP write first restarts the chip's status cycle (it advances by n + 1 per read). */
|
|
210
|
+
_readStatus() {
|
|
211
|
+
if (!this._bus.canRead) return Promise.reject(new Error('the SPI interface of the module is write-only'));
|
|
212
|
+
return this._retry(() => this._bus.readStatus());
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Poll Status1.DE until the pump is up (SPI cannot read it: wait a fixed 10 ms); NACKs while it starts are not counted. */
|
|
216
|
+
async _waitDisplayEnabled(timeoutMs) {
|
|
217
|
+
if (!this._bus.canRead) {
|
|
218
|
+
await sleepMs(Math.min(timeoutMs, 10));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
for (let waited = 0; waited <= timeoutMs; waited += RETRY_DELAY_MS) {
|
|
222
|
+
try {
|
|
223
|
+
const s = await this._bus.readStatus();
|
|
224
|
+
if (s[0] & 0x08) return;
|
|
225
|
+
} catch (e) {
|
|
226
|
+
// expected while the charge pump restarts
|
|
227
|
+
}
|
|
228
|
+
await sleepMs(RETRY_DELAY_MS);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
_mapping() {
|
|
233
|
+
return (this._my << 2) | (this._mx << 1);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** System Reset in its own transaction, then the conservative 150 ms wait. */
|
|
237
|
+
async _resetChip() {
|
|
238
|
+
await this._command(_CMD_RESET);
|
|
239
|
+
await sleepMs(150);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Configuration stream of the DOG bottom-view example (display stays off). */
|
|
243
|
+
_configure() {
|
|
244
|
+
const last = this.height - 1;
|
|
245
|
+
return this._command(
|
|
246
|
+
_CMD_TEMP | 1,
|
|
247
|
+
_CMD_MAPPING, this._mapping(),
|
|
248
|
+
_CMD_LINE_RATE | 3,
|
|
249
|
+
_CMD_COM_END, last,
|
|
250
|
+
_CMD_PART_START, 0,
|
|
251
|
+
_CMD_PART_END, last,
|
|
252
|
+
_CMD_POTENTIOMETER, this._contrast,
|
|
253
|
+
_CMD_RAM_ADDR | 1,
|
|
254
|
+
_CMD_PATTERN | 1);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
_enable() {
|
|
258
|
+
return this._command(_CMD_DISPLAY | 1);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Power-up wait, System Reset, configuration, RAM clear, display on. */
|
|
262
|
+
async _initSequence() {
|
|
263
|
+
await sleepMs(150);
|
|
264
|
+
await this._bus.hardwareReset();
|
|
265
|
+
await this._resetChip();
|
|
266
|
+
await this._configure();
|
|
267
|
+
const blank = Buffer.alloc(this.width);
|
|
268
|
+
for (let page = 0; page < _PAGES_RAM; page++) await this._writePage(page, blank);
|
|
269
|
+
await this._enable();
|
|
270
|
+
await this._waitDisplayEnabled(200);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
_showPage(page) {
|
|
274
|
+
const start = page * this.width;
|
|
275
|
+
return this._writePage(page, this._fb.subarray(start, start + this.width));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ---- public API ------------------------------------------------------------------------
|
|
279
|
+
|
|
280
|
+
/** Zero the framebuffer. Call `show()` to update the panel. */
|
|
281
|
+
clear() {
|
|
282
|
+
this._fb.fill(0);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Set or clear one pixel in the framebuffer. Out-of-range coordinates are ignored.
|
|
287
|
+
* @param {number} x - Column, 0 .. width - 1.
|
|
288
|
+
* @param {number} y - Row, 0 .. height - 1.
|
|
289
|
+
* @param {boolean} [on=true] - True to set the pixel, false to clear it.
|
|
290
|
+
*/
|
|
291
|
+
setPixel(x, y, on = true) {
|
|
292
|
+
if (x < 0 || y < 0 || x >= this.width || y >= this.height) return;
|
|
293
|
+
const i = (y >> 3) * this.width + x;
|
|
294
|
+
if (on) this._fb[i] |= 1 << (y & 7);
|
|
295
|
+
else this._fb[i] &= ~(1 << (y & 7)) & 0xFF;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Write the whole framebuffer to the display RAM (page + column, then width data bytes per page).
|
|
300
|
+
* @returns {Promise<void>}
|
|
301
|
+
*/
|
|
302
|
+
async show() {
|
|
303
|
+
await this._ready;
|
|
304
|
+
for (let page = 0; page < this._pages; page++) await this._showPage(page);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* UC1611s graphic LCD controller-driver — full interface.
|
|
310
|
+
*
|
|
311
|
+
* Extends UC1611sMinimal with drawing primitives, contrast, sleep, invert, flip / top view,
|
|
312
|
+
* hardware scroll with fixed lines, bias ratio, temperature compensation, line rate, charge
|
|
313
|
+
* pump / external VLCD, panel loading, partial display, N-line inversion, isolation clock, the
|
|
314
|
+
* four RAM patterns, status and RAM reads, and raw commands.
|
|
315
|
+
*
|
|
316
|
+
* @param {object} command - I2CConnection at the command address.
|
|
317
|
+
* @param {object} data - I2CConnection at the data address (command address + 1).
|
|
318
|
+
* @param {number} [width=240] - Columns, 1..240.
|
|
319
|
+
* @param {number} [height=128] - Rows, a multiple of 8 and at most 128.
|
|
320
|
+
* @param {boolean} [topView=false] - True for the 12:00 viewing direction (MY = 1, MX = 0).
|
|
321
|
+
* @param {number} [contrast=0x8F] - Potentiometer PM 0..255 (the DOG example value).
|
|
322
|
+
*/
|
|
323
|
+
class UC1611sFull extends UC1611sMinimal {
|
|
324
|
+
constructor(command, data, width = WIDTH, height = HEIGHT, topView = false, contrast = 0x8F, bus = null) {
|
|
325
|
+
if (!(contrast >= 0 && contrast <= 255)) throw new RangeError('contrast must be 0..255');
|
|
326
|
+
super(command, data, width, height, { topView, contrast, bus });
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// ---- framebuffer -----------------------------------------------------------------------
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Return a framebuffer pixel; out-of-range coordinates read as false.
|
|
333
|
+
* @param {number} x - Column.
|
|
334
|
+
* @param {number} y - Row.
|
|
335
|
+
* @returns {boolean} True if the pixel is set.
|
|
336
|
+
*/
|
|
337
|
+
getPixel(x, y) {
|
|
338
|
+
if (x < 0 || y < 0 || x >= this.width || y >= this.height) return false;
|
|
339
|
+
return (this._fb[(y >> 3) * this.width + x] & (1 << (y & 7))) !== 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** Set (or clear) the whole framebuffer. @param {boolean} [on=true] */
|
|
343
|
+
fill(on = true) {
|
|
344
|
+
this._fb.fill(on ? 0xFF : 0);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Draw a Bresenham line into the framebuffer.
|
|
349
|
+
* @param {number} x0 - Start column.
|
|
350
|
+
* @param {number} y0 - Start row.
|
|
351
|
+
* @param {number} x1 - End column.
|
|
352
|
+
* @param {number} y1 - End row.
|
|
353
|
+
* @param {boolean} [on=true] - True to set pixels, false to clear them.
|
|
354
|
+
*/
|
|
355
|
+
drawLine(x0, y0, x1, y1, on = true) {
|
|
356
|
+
const dx = Math.abs(x1 - x0);
|
|
357
|
+
const dy = -Math.abs(y1 - y0);
|
|
358
|
+
const sx = x0 < x1 ? 1 : -1;
|
|
359
|
+
const sy = y0 < y1 ? 1 : -1;
|
|
360
|
+
let err = dx + dy;
|
|
361
|
+
for (;;) {
|
|
362
|
+
this.setPixel(x0, y0, on);
|
|
363
|
+
if (x0 === x1 && y0 === y1) break;
|
|
364
|
+
const e2 = 2 * err;
|
|
365
|
+
if (e2 >= dy) { err += dy; x0 += sx; }
|
|
366
|
+
if (e2 <= dx) { err += dx; y0 += sy; }
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Draw a rectangle outline or a filled rectangle into the framebuffer.
|
|
372
|
+
* @param {number} x - Left column.
|
|
373
|
+
* @param {number} y - Top row.
|
|
374
|
+
* @param {number} w - Width in pixels.
|
|
375
|
+
* @param {number} h - Height in pixels.
|
|
376
|
+
* @param {boolean} [on=true] - True to set pixels, false to clear them.
|
|
377
|
+
* @param {boolean} [fill=false] - True for a filled rectangle.
|
|
378
|
+
*/
|
|
379
|
+
drawRect(x, y, w, h, on = true, fill = false) {
|
|
380
|
+
if (w <= 0 || h <= 0) return;
|
|
381
|
+
if (fill) {
|
|
382
|
+
for (let yy = y; yy < y + h; yy++) for (let xx = x; xx < x + w; xx++) this.setPixel(xx, yy, on);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
this.drawLine(x, y, x + w - 1, y, on);
|
|
386
|
+
this.drawLine(x, y + h - 1, x + w - 1, y + h - 1, on);
|
|
387
|
+
this.drawLine(x, y, x, y + h - 1, on);
|
|
388
|
+
this.drawLine(x + w - 1, y, x + w - 1, y + h - 1, on);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Copy a column-major bitmap (8 pixels per byte, bit 0 = top) into the framebuffer. `columns`
|
|
393
|
+
* holds `heightPages` groups of columns, page by page: byte p * n + c is column c of page row p
|
|
394
|
+
* (n = length / heightPages). The bitmap is clipped to the framebuffer; y must be a multiple of 8.
|
|
395
|
+
* @param {number} x - Left column of the bitmap.
|
|
396
|
+
* @param {number} y - Top row, a multiple of 8.
|
|
397
|
+
* @param {Buffer|number[]} columns - Bitmap bytes.
|
|
398
|
+
* @param {number} [heightPages=1] - Number of 8-pixel-high rows of the bitmap.
|
|
399
|
+
*/
|
|
400
|
+
blit(x, y, columns, heightPages = 1) {
|
|
401
|
+
if (y % 8 !== 0) throw new RangeError('y must be a multiple of 8');
|
|
402
|
+
const n = Math.floor(columns.length / heightPages);
|
|
403
|
+
for (let p = 0; p < heightPages; p++) {
|
|
404
|
+
const page = y / 8 + p;
|
|
405
|
+
if (page < 0 || page >= this._pages) continue;
|
|
406
|
+
for (let c = 0; c < n; c++) {
|
|
407
|
+
const xx = x + c;
|
|
408
|
+
if (xx >= 0 && xx < this.width) this._fb[page * this.width + xx] = columns[p * n + c];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Write one framebuffer page to the display RAM (cheaper partial update).
|
|
415
|
+
* @param {number} page - Page 0 .. height / 8 - 1.
|
|
416
|
+
* @returns {Promise<void>}
|
|
417
|
+
*/
|
|
418
|
+
async showPage(page) {
|
|
419
|
+
await this._ready;
|
|
420
|
+
if (page >= 0 && page < this._pages) await this._showPage(page);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// ---- display control -------------------------------------------------------------------
|
|
424
|
+
|
|
425
|
+
/** Set the potentiometer PM that adjusts VLCD (contrast). @param {number} value - PM, 0..255. @returns {Promise<void>} */
|
|
426
|
+
async setContrast(value) {
|
|
427
|
+
await this._ready;
|
|
428
|
+
this._contrast = value & 0xFF;
|
|
429
|
+
await this._command(_CMD_POTENTIOMETER, this._contrast);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** Switch the display on, or into sleep (registers and RAM kept, below 1 uA). @param {boolean} on @returns {Promise<void>} */
|
|
433
|
+
async setDisplay(on) {
|
|
434
|
+
await this._ready;
|
|
435
|
+
await this._command(_CMD_DISPLAY | (on ? 1 : 0));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** Enter sleep mode: drivers, charge pump and clock stop; the host interface stays active. @returns {Promise<void>} */
|
|
439
|
+
sleep() { return this.setDisplay(false); }
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Leave sleep mode. The chip NACKs and Status1.DE stays 0 for about 6 ms while the charge pump
|
|
443
|
+
* restarts, so the driver polls DE (at most 50 ms) instead of sleeping.
|
|
444
|
+
* @returns {Promise<void>}
|
|
445
|
+
*/
|
|
446
|
+
async wake() {
|
|
447
|
+
await this.setDisplay(true);
|
|
448
|
+
await this._waitDisplayEnabled(50);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/** Invert the displayed image without changing RAM. @param {boolean} on @returns {Promise<void>} */
|
|
452
|
+
async setInvert(on) {
|
|
453
|
+
await this._ready;
|
|
454
|
+
await this._command(_CMD_INVERSE | (on ? 1 : 0));
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** Force all pixels on (test mode, RAM unchanged). @param {boolean} on @returns {Promise<void>} */
|
|
458
|
+
async setAllOn(on) {
|
|
459
|
+
await this._ready;
|
|
460
|
+
await this._command(_CMD_ALL_ON | (on ? 1 : 0));
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Mirror columns and/or rows. MY acts at once; MX is applied to RAM writes, so call `show()`
|
|
465
|
+
* afterwards to re-send the framebuffer.
|
|
466
|
+
* @param {boolean} mirrorX - True to mirror the columns (SEG order; the bottom-view default).
|
|
467
|
+
* @param {boolean} mirrorY - True to mirror the rows (COM order).
|
|
468
|
+
* @returns {Promise<void>}
|
|
469
|
+
*/
|
|
470
|
+
async setFlip(mirrorX, mirrorY) {
|
|
471
|
+
await this._ready;
|
|
472
|
+
this._mx = mirrorX ? 1 : 0;
|
|
473
|
+
this._my = mirrorY ? 1 : 0;
|
|
474
|
+
await this._command(_CMD_MAPPING, this._mapping());
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/** Scroll the image up by `line` rows (hardware scroll, wraps at 160 rows). @param {number} line - SL, 0 .. 159 - 2 * fixed lines. @returns {Promise<void>} */
|
|
478
|
+
async setScrollLine(line) {
|
|
479
|
+
await this._ready;
|
|
480
|
+
await this._command(_CMD_SCROLL_LO | (line & 0x0F), _CMD_SCROLL_HI | ((line >> 4) & 0x0F));
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** Keep the first 2 * lines rows out of the scroll (soft-icon area). @param {number} lines - FL, 0..15. @returns {Promise<void>} */
|
|
484
|
+
async setFixedLines(lines) {
|
|
485
|
+
await this._ready;
|
|
486
|
+
await this._command(_CMD_FIXED | (lines & 0x0F));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** Select the LCD bias ratio. @param {number} ratio - 0 = 1/5, 1 = 1/10, 2 = 1/11 (reset), 3 = 1/12. @returns {Promise<void>} */
|
|
490
|
+
async setBiasRatio(ratio) {
|
|
491
|
+
await this._ready;
|
|
492
|
+
await this._command(_CMD_BIAS | (ratio & 3));
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/** Select the VBIAS temperature compensation. @param {number} curve - 0 = -0.05 %/degC, 1 = -0.10, 2 = -0.15, 3 = 0.00. @returns {Promise<void>} */
|
|
496
|
+
async setTemperatureCompensation(curve) {
|
|
497
|
+
await this._ready;
|
|
498
|
+
await this._command(_CMD_TEMP | (curve & 3));
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/** Select the line rate (On/Off mode). @param {number} rate - 0 = 5.9, 1 = 7.1, 2 = 8.2, 3 = 9.4 kilo-lines per second. @returns {Promise<void>} */
|
|
502
|
+
async setLineRate(rate) {
|
|
503
|
+
await this._ready;
|
|
504
|
+
await this._command(_CMD_LINE_RATE | (rate & 3));
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** Internal 11x charge pump or an external VLCD supply. @param {boolean} internal @returns {Promise<void>} */
|
|
508
|
+
async setPump(internal) {
|
|
509
|
+
await this._ready;
|
|
510
|
+
await this._command(_CMD_PUMP | (internal ? 3 : 0));
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/** Tell the chip the panel capacitance. @param {boolean} high - True for 33..55 nF (reset), false for up to 33 nF. @returns {Promise<void>} */
|
|
514
|
+
async setPanelLoading(high) {
|
|
515
|
+
await this._ready;
|
|
516
|
+
await this._command(_CMD_PANEL | (high ? 3 : 0));
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Scan only rows `start` .. `end` (the rest sleeps), or return to full scan.
|
|
521
|
+
* @param {boolean} on - True to enable partial display.
|
|
522
|
+
* @param {number} [start=0] - First scanned row (DST).
|
|
523
|
+
* @param {number} [end] - Last scanned row (DEN); default height - 1.
|
|
524
|
+
* @returns {Promise<void>}
|
|
525
|
+
*/
|
|
526
|
+
async setPartialDisplay(on, start = 0, end = undefined) {
|
|
527
|
+
await this._ready;
|
|
528
|
+
if (on) {
|
|
529
|
+
await this._command(_CMD_PART_START, start & 0xFF,
|
|
530
|
+
_CMD_PART_END, (end === undefined ? this.height - 1 : end) & 0xFF,
|
|
531
|
+
_CMD_PARTIAL | 3);
|
|
532
|
+
} else {
|
|
533
|
+
await this._command(_CMD_PARTIAL);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/** Set N-line inversion (cross-talk tuning). @param {number} lines - 0 (off) .. 63. @param {boolean} [xor=false] @returns {Promise<void>} */
|
|
538
|
+
async setNLineInversion(lines, xor = false) {
|
|
539
|
+
await this._ready;
|
|
540
|
+
await this._command(_CMD_NLINE, (xor ? 0x40 : 0) | (lines & 0x3F));
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** Set the isolation clock before (front) and after (back) the COM pulse, 0..15 each. @returns {Promise<void>} */
|
|
544
|
+
async setIsolationClock(front, back) {
|
|
545
|
+
await this._ready;
|
|
546
|
+
await this._command(_CMD_ISOLATION, 0x13, front & 0x0F);
|
|
547
|
+
await this._command(_CMD_ISOLATION, 0x14, back & 0x0F);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/** Select which of the four RAM screens (patterns) is displayed. @param {number} pattern - 0..3. @returns {Promise<void>} */
|
|
551
|
+
async setDisplayPattern(pattern) {
|
|
552
|
+
await this._ready;
|
|
553
|
+
await this._command(_CMD_PATTERN | ((pattern & 3) << 1) | 1);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/** Select the RAM screen that `show()` / `showPage()` write to (PA[6:5]). @param {number} pattern - 0..3. */
|
|
557
|
+
setWritePattern(pattern) {
|
|
558
|
+
this._pattern = pattern & 3;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
// ---- reads and raw access ----------------------------------------------------------------
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Read the three status bytes (a NOP is sent first to restart the chip's status cycle).
|
|
565
|
+
* @returns {Promise<Buffer>} Status1 (Ver, MX, MY, WA, DE, WS, MD, MS), Status2 (ID[1:0], PMO[5:0]),
|
|
566
|
+
* Status3 (product code 1 in bits 7..4, ESD flag in bit 0).
|
|
567
|
+
*/
|
|
568
|
+
async readStatus() {
|
|
569
|
+
await this._ready;
|
|
570
|
+
return this._readStatus();
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Read `n` bytes of display RAM (the dummy byte after an address change is discarded).
|
|
575
|
+
* @param {number} page - RAM page.
|
|
576
|
+
* @param {number} column - Start column.
|
|
577
|
+
* @param {number} n - Number of bytes.
|
|
578
|
+
* @returns {Promise<Buffer>} The RAM bytes.
|
|
579
|
+
*/
|
|
580
|
+
async readRam(page, column, n) {
|
|
581
|
+
await this._ready;
|
|
582
|
+
if (!this._bus.canRead) throw new Error('the SPI interface of the module is write-only');
|
|
583
|
+
return this._retry(async () => {
|
|
584
|
+
await this._bus.writeCommand(this._addressBytes(page, column));
|
|
585
|
+
return this._bus.readRam(n);
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/** System Reset and reconfigure with the cached contrast and mapping (RAM is kept). @returns {Promise<void>} */
|
|
590
|
+
async reset() {
|
|
591
|
+
await this._ready;
|
|
592
|
+
await this._resetChip();
|
|
593
|
+
await this._configure();
|
|
594
|
+
await this._enable();
|
|
595
|
+
await this._waitDisplayEnabled(50);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/** Send raw bytes as one command transaction. @param {...number} bytes @returns {Promise<void>} */
|
|
599
|
+
async sendCommand(...bytes) {
|
|
600
|
+
await this._ready;
|
|
601
|
+
await this._command(...bytes);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/** Send raw bytes to the display RAM (chunked) at the current RAM address. @param {Buffer|number[]} bytes @returns {Promise<void>} */
|
|
605
|
+
async sendData(bytes) {
|
|
606
|
+
await this._ready;
|
|
607
|
+
await this._writeData(Buffer.from(bytes));
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* UC1611s over 4-wire SPI — minimal interface.
|
|
613
|
+
*
|
|
614
|
+
* Same framebuffer, drawing and initialization as UC1611sMinimal, but the module is driven through
|
|
615
|
+
* a display connection (CS#, D/C# = CD, RES# = RST, optional). The module must be strapped for
|
|
616
|
+
* 4-wire SPI (BM0 = D13 = VSS). SPI mode 0, up to 8 MHz. Every command byte, including the arguments
|
|
617
|
+
* of two- and three-byte commands, is sent with D/C# low as its own CS window; RAM data goes out
|
|
618
|
+
* with D/C# high. There is no read-back and no acknowledge: nothing is retried (`retryCount()` stays
|
|
619
|
+
* 0), the driver waits a fixed 10 ms for the charge pump after reset or wake instead of polling, and
|
|
620
|
+
* `readStatus()` / `readRam()` of the full class reject.
|
|
621
|
+
*
|
|
622
|
+
* @param {object} connection - DisplayConnection (4-wire, D/C# required, RES# optional, no BUSY).
|
|
623
|
+
* @param {number} [width=240] - Columns, 1..240.
|
|
624
|
+
* @param {number} [height=128] - Rows, a multiple of 8 and at most 128.
|
|
625
|
+
* @param {object} [options] - Used by UC1611sSpiFull: `{ topView, contrast }`.
|
|
626
|
+
*/
|
|
627
|
+
class UC1611sSpiMinimal extends UC1611sMinimal {
|
|
628
|
+
constructor(connection, width = WIDTH, height = HEIGHT, options = {}) {
|
|
629
|
+
super(null, null, width, height, { ...options, bus: new SpiBus(connection) });
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* UC1611s over 4-wire SPI — full interface (see UC1611sFull; `readStatus()` and `readRam()` reject).
|
|
635
|
+
*
|
|
636
|
+
* @param {object} connection - DisplayConnection (4-wire, D/C# required, RES# optional, no BUSY).
|
|
637
|
+
* @param {number} [width=240] - Columns, 1..240.
|
|
638
|
+
* @param {number} [height=128] - Rows, a multiple of 8 and at most 128.
|
|
639
|
+
* @param {boolean} [topView=false] - True for the 12:00 viewing direction (MY = 1, MX = 0).
|
|
640
|
+
* @param {number} [contrast=0x8F] - Potentiometer PM 0..255 (the DOG example value).
|
|
641
|
+
*/
|
|
642
|
+
class UC1611sSpiFull extends UC1611sFull {
|
|
643
|
+
constructor(connection, width = WIDTH, height = HEIGHT, topView = false, contrast = 0x8F) {
|
|
644
|
+
super(null, null, width, height, topView, contrast, new SpiBus(connection));
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
module.exports = { UC1611sMinimal, UC1611sFull, UC1611sSpiMinimal, UC1611sSpiFull, WIDTH, HEIGHT, I2C_CHUNK, SPI_CHUNK, MAX_ATTEMPTS, RETRY_DELAY_MS };
|