Skip to content

Commit e0e11fc

Browse files
authored
Merge pull request #120 from jdoubleu/update-docs
WIP: Update docs
2 parents 07925dc + dd8ff8f commit e0e11fc

File tree

5 files changed

+32
-11
lines changed

5 files changed

+32
-11
lines changed

doc/make.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ if errorlevel 9009 (
2525
exit /b 1
2626
)
2727

28+
doxygen.exe
29+
2830
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
2931
goto end
3032

doc/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
breathe>=4
22
Sphinx>=3
3+
sphinx-rtd-theme>=0.5.2

doc/source/getting_started.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The ESP module is now in boot mode.
9393
Upload the demo program to the board with
9494
::
9595

96-
idf.py build && idf.py flash -b 921600 && idf.py monitor
96+
idf.py flash -b 921600 && idf.py monitor
9797

9898
Pressing :code:`RESET` a second time should start the demo program, which will
9999
output some information on the serial monitor.
@@ -133,6 +133,13 @@ And navigate to :code:`Component config -> E-Paper driver -> Display Type`, sele
133133

134134
to make your code portable.
135135

136+
Enable SPI RAM
137+
~~~~~~~~~~~~~~~~~~~~~~~~
138+
The ESP32-WROVER-B comes with an additional 8MB external PSRAM, where the :code:`epd_driver` is going to store ~2MB for its internal frame buffers.
139+
Since it is dynamically allocated from the heap, and the built-in SRAM of ~160KB is insufficient, we need to enable external SPI RAM first.
140+
141+
Open the :code:`menuconfig` again (see above) and navigate to :code:`Component config -> ESP32-Specific -> Support for external, SPI-connected RAM` and enable it.
142+
136143
Use with Arduino
137144
----------------
138145

src/epd_driver/include/epd_driver.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void epd_copy_to_framebuffer(EpdRect image_area, const uint8_t *image_data,
252252
*
253253
* @param x: Horizontal position in pixels.
254254
* @param y: Vertical position in pixels.
255-
* @param color: The gray value of the line (0-255);
255+
* @param color: The gray value of the line (see [Colors](#Colors));
256256
* @param framebuffer: The framebuffer to draw to,
257257
*/
258258
void epd_draw_pixel(int x, int y, uint8_t color, uint8_t *framebuffer);
@@ -263,7 +263,7 @@ void epd_draw_pixel(int x, int y, uint8_t color, uint8_t *framebuffer);
263263
* @param x: Horizontal start position in pixels.
264264
* @param y: Vertical start position in pixels.
265265
* @param length: Length of the line in pixels.
266-
* @param color: The gray value of the line (0-255);
266+
* @param color: The gray value of the line (see [Colors](#Colors));
267267
* @param framebuffer: The framebuffer to draw to,
268268
* which must be `EPD_WIDTH / 2 * EPD_HEIGHT` bytes large.
269269
*/
@@ -276,7 +276,7 @@ void epd_draw_hline(int x, int y, int length, uint8_t color,
276276
* @param x: Horizontal start position in pixels.
277277
* @param y: Vertical start position in pixels.
278278
* @param length: Length of the line in pixels.
279-
* @param color: The gray value of the line (0-255);
279+
* @param color: The gray value of the line (see [Colors](#Colors));
280280
* @param framebuffer: The framebuffer to draw to,
281281
* which must be `EPD_WIDTH / 2 * EPD_HEIGHT` bytes large.
282282
*/
@@ -292,7 +292,7 @@ void epd_fill_circle_helper(int x0, int y0, int r, int corners, int delta,
292292
* @param x: Center-point x coordinate
293293
* @param y: Center-point y coordinate
294294
* @param r: Radius of the circle in pixels
295-
* @param color: The gray value of the line (0-255);
295+
* @param color: The gray value of the line (see [Colors](#Colors));
296296
* @param framebuffer: The framebuffer to draw to,
297297
*/
298298
void epd_draw_circle(int x, int y, int r, uint8_t color, uint8_t *framebuffer);
@@ -303,7 +303,7 @@ void epd_draw_circle(int x, int y, int r, uint8_t color, uint8_t *framebuffer);
303303
* @param x: Center-point x coordinate
304304
* @param y: Center-point y coordinate
305305
* @param r: Radius of the circle in pixels
306-
* @param color: The gray value of the line (0-255);
306+
* @param color: The gray value of the line (see [Colors](#Colors));
307307
* @param framebuffer: The framebuffer to draw to,
308308
*/
309309
void epd_fill_circle(int x, int y, int r, uint8_t color, uint8_t *framebuffer);
@@ -312,7 +312,7 @@ void epd_fill_circle(int x, int y, int r, uint8_t color, uint8_t *framebuffer);
312312
* Draw a rectanle with no fill color
313313
*
314314
* @param rect: The rectangle to draw.
315-
* @param color: The gray value of the line (0-255);
315+
* @param color: The gray value of the line (see [Colors](#Colors));
316316
* @param framebuffer: The framebuffer to draw to,
317317
*/
318318
void epd_draw_rect(EpdRect rect, uint8_t color, uint8_t *framebuffer);
@@ -321,7 +321,7 @@ void epd_draw_rect(EpdRect rect, uint8_t color, uint8_t *framebuffer);
321321
* Draw a rectanle with fill color
322322
*
323323
* @param rect: The rectangle to fill.
324-
* @param color: The gray value of the line (0-255);
324+
* @param color: The gray value of the line (see [Colors](#Colors));
325325
* @param framebuffer: The framebuffer to draw to,
326326
*/
327327
void epd_fill_rect(EpdRect rect, uint8_t color, uint8_t *framebuffer);
@@ -333,7 +333,7 @@ void epd_fill_rect(EpdRect rect, uint8_t color, uint8_t *framebuffer);
333333
* @param y0 Start point y coordinate
334334
* @param x1 End point x coordinate
335335
* @param y1 End point y coordinate
336-
* @param color: The gray value of the line (0-255);
336+
* @param color: The gray value of the line (see [Colors](#Colors));
337337
* @param framebuffer: The framebuffer to draw to,
338338
*/
339339
void epd_draw_line(int x0, int y0, int x1, int y1, uint8_t color,
@@ -348,7 +348,7 @@ void epd_draw_line(int x0, int y0, int x1, int y1, uint8_t color,
348348
* @param y1 Vertex #1 y coordinate
349349
* @param x2 Vertex #2 x coordinate
350350
* @param y2 Vertex #2 y coordinate
351-
* @param color: The gray value of the line (0-255);
351+
* @param color: The gray value of the line (see [Colors](#Colors));
352352
* @param framebuffer: The framebuffer to draw to,
353353
*/
354354
void epd_draw_triangle(int x0, int y0, int x1, int y1, int x2, int y2,
@@ -363,7 +363,7 @@ void epd_draw_triangle(int x0, int y0, int x1, int y1, int x2, int y2,
363363
* @param y1 Vertex #1 y coordinate
364364
* @param x2 Vertex #2 x coordinate
365365
* @param y2 Vertex #2 y coordinate
366-
* @param color: The gray value of the line (0-255);
366+
* @param color: The gray value of the line (see [Colors](#Colors));
367367
* @param framebuffer: The framebuffer to draw to,
368368
*/
369369
void epd_fill_triangle(int x0, int y0, int x1, int y1, int x2, int y2,

src/epd_driver/include/epd_highlevel.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@
4444
* That's it! For many application, this will be enough.
4545
* For special applications and requirements, have a
4646
* closer look at the `epd_driver.h` header.
47+
*
48+
* Colors
49+
* ======
50+
*
51+
* Since most displays only support 16 colors, we're only using the upper 4 bits (nibble) of a byte to detect the color.
52+
*
53+
* char pixel_color = color & 0xF0;
54+
*
55+
* So keep in mind, when passing a color to any function, to always set the upper 4 bits, otherwise the color would be black.
56+
*
57+
* Possible colors are `0xF0` (white) through `0x80` (median gray) til `0x00` (black).
4758
*/
4859

4960

0 commit comments

Comments
 (0)