From 8b6240f005bc13dd1daf5260e8ccbdf161752d38 Mon Sep 17 00:00:00 2001 From: Rahix <rahix@rahix.de> Date: Sun, 21 Jul 2019 20:58:41 +0200 Subject: [PATCH] fix(docs): Minor fixes in display docs Signed-off-by: Rahix <rahix@rahix.de> --- Documentation/index.rst | 2 +- epicardium/epicardium.h | 33 ++++++++++++++++++++------------- pycardium/modules/py/display.py | 12 ++++++------ 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/Documentation/index.rst b/Documentation/index.rst index 954d0aae..f850b08e 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -22,9 +22,9 @@ Last but not least, if you want to start hacking the lower-level firmware, the pycardium/overview pycardium/color + pycardium/display pycardium/leds pycardium/vibra - pycardium/display .. toctree:: :maxdepth: 1 diff --git a/epicardium/epicardium.h b/epicardium/epicardium.h index 569d4296..8e2b36ce 100644 --- a/epicardium/epicardium.h +++ b/epicardium/epicardium.h @@ -177,19 +177,19 @@ API(API_INTERRUPT_DISABLE, int epic_interrupt_disable(api_int_id_t int_id)); * ======= */ -/** - * - */ +/** Line-Style */ enum linestyle_t { + /** */ LINESTYLE_FULL = 0, + /** */ LINESTYLE_DOTTED = 1 }; -/** - * - */ +/** Fill-Style */ enum fillstyle_t { + /** */ FILLSTYLE_EMPTY = 0, + /** */ FILLSTYLE_FILLED = 1 }; @@ -197,7 +197,8 @@ enum fillstyle_t { * Locks the display. * * :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()); @@ -205,7 +206,8 @@ API(API_DISP_OPEN, int epic_disp_open()); * Unlocks the display again. * * :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()); @@ -224,7 +226,8 @@ API(API_DISP_UPDATE, int epic_disp_update()); * :param fg: foreground color in rgb565 * :param bg: background color in rgb565 * :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, int epic_disp_print( @@ -240,7 +243,8 @@ API(API_DISP_PRINT, * * :param color: fill color in rgb565 * :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)); @@ -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 pixelsize: thickness of the line; 1 <= pixelsize <= 8 * :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, int epic_disp_line( @@ -279,7 +284,8 @@ API(API_DISP_LINE, * :param fillstyle: 0 for empty, 1 for filled * :param pixelsize: thickness of the rectangle outline; 1 <= pixelsize <= 8 * :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, int epic_disp_rect( @@ -302,7 +308,8 @@ API(API_DISP_RECT, * :param fillstyle: 0 for empty, 1 for filled * :param pixelsize: thickness of the circle outline; 1 <= pixelsize <= 8 * :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, int epic_disp_circ( diff --git a/pycardium/modules/py/display.py b/pycardium/modules/py/display.py index dbeb9ecf..ade83c13 100644 --- a/pycardium/modules/py/display.py +++ b/pycardium/modules/py/display.py @@ -7,9 +7,9 @@ class Display: in card10 to be used in a safe way. All draw methods return the display object so that it is possible to chain calls. It is recommended to use a context manager as following: - + .. code-block:: python - + import display with display.open() as disp: disp.clear().update() @@ -57,7 +57,7 @@ class Display: def print(self, text, *, fg=None, bg=None, posx=0, posy=0): """ Prints a string on the display. Font size is locked to 20px - + :param text: Text to print :param fg: Foreground color (expects RGB triple) :param bg: Background color (expects RGB triple) @@ -80,8 +80,8 @@ class Display: :param ye: Y end coordinate, 0 <= ye <= 80 :param col: color of the line (expects RGB triple) :param dotted: whether the line should be dotted or not - (questionable implementation: draws every other pixel white, draws - white squares at higher pixel sizes) + (questionable implementation: draws every other pixel white, draws + white squares at higher pixel sizes) :param size: size of the individual pixels, ranges from 1 to 8 """ @@ -111,7 +111,7 @@ class Display: def circ(self, x, y, rad, *, col=None, filled=True, size=1): """ Draws a circle on the display. - + :param x: center x coordinate, 0 <= x <= 160 :param y: center y coordinate, 0 <= y <= 80 :param rad: radius -- GitLab