* The card10 has an LCD screen that can be accessed from user code.
*
* There are two main ways to access the display:
* - immediate mode, where you ask epicardium to draw shapes and text for you
* - framebuffer mode, where you provide epicardium with a memory range where
* you already drew graphics whichever way you wanted, and epicardium will
* copy them to the display.
* There are two ways to access the display:
*
* - *immediate mode*, where you ask Epicardium to draw shapes and text for
* you. Most functions in this subsection are related to *immediate mode*.
* - *framebuffer mode*, where you provide Epicardium with a memory range where
* you already drew graphics whichever way you wanted and Epicardium will
* copy them to the display. To use *framebuffer mode*, use the
* :c:func:`epic_disp_framebuffer` function.
*/
/** Line-Style */
...
...
@@ -332,31 +335,33 @@ enum disp_fillstyle {
/** Height of display in pixels */
#define DISP_HEIGHT 80
/** Raw framebuffer */
/**
* Framebuffer
*
* The frambuffer stores pixels as RGB565, but byte swapped. That is, for every ``(x, y)`` coordinate, there are two ``uint8_t``\ s storing 16 bits of pixel data.
*
* .. todo::
*
* Document (x, y) in relation to chirality.
*
* **Example**: Fill framebuffer with red
*
* .. code-block:: cpp
*
* union disp_framebuffer fb;
* uint16_t red = 0b1111100000000000;
* for (int y = 0; y < DISP_HEIGHT; y++) {
* for (int x = 0; x < DISP_WIDTH; x++) {
* fb.fb[y][x][0] = red >> 8;
* fb.fb[y][x][1] = red & 0xFF;
* }
* }
* epic_disp_framebuffer(&fb);
*/
uniondisp_framebuffer{
/**
* The frambuffer stores pixels as RGB565, but byte swapped.
* That is, for every (x, y) coordinate, there are two uint8_ts
* storing 16 bits of pixel data.
*
* TODO(q3k): document (x, y) in relation to chirality
*
* **Example: fill framebuffer with red**:
*
* .. code-block:: cpp
*
* union disp_framebuffer fb;
* uint16_t red = 0b1111100000000000;
* for (int y = 0; y < DISP_HEIGHT; y++) {
* for (int x = 0; x < DISP_WIDTH; x++) {
* fb.fb[y][x][0] = red >> 8;
* fb.fb[y][x][1] = red & 0xFF;
* }
* }
* epic_disp_framebuffer(&fb);
*
*/
/** Coordinate based access (as shown in the example above). */