Skip to content
Snippets Groups Projects
Verified Commit 8b6240f0 authored by rahix's avatar rahix
Browse files

fix(docs): Minor fixes in display docs


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent c3bcca29
No related branches found
No related tags found
No related merge requests found
...@@ -22,9 +22,9 @@ Last but not least, if you want to start hacking the lower-level firmware, the ...@@ -22,9 +22,9 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/overview pycardium/overview
pycardium/color pycardium/color
pycardium/display
pycardium/leds pycardium/leds
pycardium/vibra pycardium/vibra
pycardium/display
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
......
...@@ -177,19 +177,19 @@ API(API_INTERRUPT_DISABLE, int epic_interrupt_disable(api_int_id_t int_id)); ...@@ -177,19 +177,19 @@ API(API_INTERRUPT_DISABLE, int epic_interrupt_disable(api_int_id_t int_id));
* ======= * =======
*/ */
/** /** Line-Style */
*
*/
enum linestyle_t { enum linestyle_t {
/** */
LINESTYLE_FULL = 0, LINESTYLE_FULL = 0,
/** */
LINESTYLE_DOTTED = 1 LINESTYLE_DOTTED = 1
}; };
/** /** Fill-Style */
*
*/
enum fillstyle_t { enum fillstyle_t {
/** */
FILLSTYLE_EMPTY = 0, FILLSTYLE_EMPTY = 0,
/** */
FILLSTYLE_FILLED = 1 FILLSTYLE_FILLED = 1
}; };
...@@ -197,7 +197,8 @@ enum fillstyle_t { ...@@ -197,7 +197,8 @@ enum fillstyle_t {
* Locks the display. * Locks the display.
* *
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_OPEN, int epic_disp_open()); API(API_DISP_OPEN, int epic_disp_open());
...@@ -205,7 +206,8 @@ API(API_DISP_OPEN, int epic_disp_open()); ...@@ -205,7 +206,8 @@ API(API_DISP_OPEN, int epic_disp_open());
* Unlocks the display again. * Unlocks the display again.
* *
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_CLOSE, int epic_disp_close()); API(API_DISP_CLOSE, int epic_disp_close());
...@@ -224,7 +226,8 @@ API(API_DISP_UPDATE, int epic_disp_update()); ...@@ -224,7 +226,8 @@ API(API_DISP_UPDATE, int epic_disp_update());
* :param fg: foreground color in rgb565 * :param fg: foreground color in rgb565
* :param bg: background color in rgb565 * :param bg: background color in rgb565
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_PRINT, API(API_DISP_PRINT,
int epic_disp_print( int epic_disp_print(
...@@ -240,7 +243,8 @@ API(API_DISP_PRINT, ...@@ -240,7 +243,8 @@ API(API_DISP_PRINT,
* *
* :param color: fill color in rgb565 * :param color: fill color in rgb565
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_CLEAR, int epic_disp_clear(uint16_t color)); API(API_DISP_CLEAR, int epic_disp_clear(uint16_t color));
...@@ -255,7 +259,8 @@ API(API_DISP_CLEAR, int epic_disp_clear(uint16_t color)); ...@@ -255,7 +259,8 @@ API(API_DISP_CLEAR, int epic_disp_clear(uint16_t color));
* :param linestyle: 0 for solid, 1 for dottet (almost no visual difference) * :param linestyle: 0 for solid, 1 for dottet (almost no visual difference)
* :param pixelsize: thickness of the line; 1 <= pixelsize <= 8 * :param pixelsize: thickness of the line; 1 <= pixelsize <= 8
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_LINE, API(API_DISP_LINE,
int epic_disp_line( int epic_disp_line(
...@@ -279,7 +284,8 @@ API(API_DISP_LINE, ...@@ -279,7 +284,8 @@ API(API_DISP_LINE,
* :param fillstyle: 0 for empty, 1 for filled * :param fillstyle: 0 for empty, 1 for filled
* :param pixelsize: thickness of the rectangle outline; 1 <= pixelsize <= 8 * :param pixelsize: thickness of the rectangle outline; 1 <= pixelsize <= 8
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_RECT, API(API_DISP_RECT,
int epic_disp_rect( int epic_disp_rect(
...@@ -302,7 +308,8 @@ API(API_DISP_RECT, ...@@ -302,7 +308,8 @@ API(API_DISP_RECT,
* :param fillstyle: 0 for empty, 1 for filled * :param fillstyle: 0 for empty, 1 for filled
* :param pixelsize: thickness of the circle outline; 1 <= pixelsize <= 8 * :param pixelsize: thickness of the circle outline; 1 <= pixelsize <= 8
* :return: ``0`` on success or a negative value in case of an error: * :return: ``0`` on success or a negative value in case of an error:
* - ``-EBUSY``: Display was already locked from another task. *
* - ``-EBUSY``: Display was already locked from another task.
*/ */
API(API_DISP_CIRC, API(API_DISP_CIRC,
int epic_disp_circ( int epic_disp_circ(
......
...@@ -7,9 +7,9 @@ class Display: ...@@ -7,9 +7,9 @@ class Display:
in card10 to be used in a safe way. All draw methods return in card10 to be used in a safe way. All draw methods return
the display object so that it is possible to chain calls. the display object so that it is possible to chain calls.
It is recommended to use a context manager as following: It is recommended to use a context manager as following:
.. code-block:: python .. code-block:: python
import display import display
with display.open() as disp: with display.open() as disp:
disp.clear().update() disp.clear().update()
...@@ -57,7 +57,7 @@ class Display: ...@@ -57,7 +57,7 @@ class Display:
def print(self, text, *, fg=None, bg=None, posx=0, posy=0): def print(self, text, *, fg=None, bg=None, posx=0, posy=0):
""" """
Prints a string on the display. Font size is locked to 20px Prints a string on the display. Font size is locked to 20px
:param text: Text to print :param text: Text to print
:param fg: Foreground color (expects RGB triple) :param fg: Foreground color (expects RGB triple)
:param bg: Background color (expects RGB triple) :param bg: Background color (expects RGB triple)
...@@ -80,8 +80,8 @@ class Display: ...@@ -80,8 +80,8 @@ class Display:
:param ye: Y end coordinate, 0 <= ye <= 80 :param ye: Y end coordinate, 0 <= ye <= 80
:param col: color of the line (expects RGB triple) :param col: color of the line (expects RGB triple)
:param dotted: whether the line should be dotted or not :param dotted: whether the line should be dotted or not
(questionable implementation: draws every other pixel white, draws (questionable implementation: draws every other pixel white, draws
white squares at higher pixel sizes) white squares at higher pixel sizes)
:param size: size of the individual pixels, ranges from 1 to 8 :param size: size of the individual pixels, ranges from 1 to 8
""" """
...@@ -111,7 +111,7 @@ class Display: ...@@ -111,7 +111,7 @@ class Display:
def circ(self, x, y, rad, *, col=None, filled=True, size=1): def circ(self, x, y, rad, *, col=None, filled=True, size=1):
""" """
Draws a circle on the display. Draws a circle on the display.
:param x: center x coordinate, 0 <= x <= 160 :param x: center x coordinate, 0 <= x <= 160
:param y: center y coordinate, 0 <= y <= 80 :param y: center y coordinate, 0 <= y <= 80
:param rad: radius :param rad: radius
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment