diff --git a/docs/api/badge_link.rst b/docs/api/badge_link.rst index a65d296720aa85b02f26081d0d85301dd961621a..e8132bf9a13e3dd59d97a1279a5f15fc8d959444 100644 --- a/docs/api/badge_link.rst +++ b/docs/api/badge_link.rst @@ -1,64 +1,6 @@ -.. py:module:: badge_link - ``badge_link`` module ===================== -Functions that take a :code:`pin_mask` take a combination of constants from -:code:`badge_link.PIN_MASK_LINE_{IN/OUT}_{TIP/RING}` - -The GPIO indices to be used with :code:`machine.UART` are listed in -:code:`badge_link.PIN_INDEX_LINE_{OUT/IN}_{TIP/RING}`. - -Functions ---------- - -.. py:function:: get_active(pin_mask : int) -> int - - Gets active badge link ports. Returns a pin mask. - -.. py:function:: enable(pin_mask : int) -> int - - Enables badge link ports. - - Returns the output of :code:`badge_link.get_active()` after execution. - - Do NOT connect headphones to a badge link port. You might hear a ringing for - a while. Warn user. - -.. py:function:: disable(pin_mask : int) -> int - - Disables badge link ports. - - Returns the output of spio_badge_link_get_active after execution. - -Pin masks ---------- - -.. py:data:: PIN_MASK_LINE_IN_TIP - :type: int -.. py:data:: PIN_MASK_LINE_IN_RING - :type: int -.. py:data:: PIN_MASK_LINE_OUT_TIP - :type: int -.. py:data:: PIN_MASK_LINE_OUT_RING - :type: int -.. py:data:: PIN_MASK_LINE_IN - :type: int -.. py:data:: PIN_MASK_LINE_OUT - :type: int -.. py:data:: PIN_MASK_ALL - :type: int - -Pin indices ------------ - -These values may vary across prototype revisions. - -.. py:data:: PIN_INDEX_LINE_IN_TIP - :type: int -.. py:data:: PIN_INDEX_LINE_IN_RING - :type: int -.. py:data:: PIN_INDEX_LINE_OUT_TIP - :type: int -.. py:data:: PIN_INDEX_LINE_OUT_RING - :type: int +.. automodule:: badge_link + :members: + :undoc-members: diff --git a/docs/api/ctx.rst b/docs/api/ctx.rst index 10d7e7a3871a96057fa4eb106a79844abeb3ccf6..7461e1c1acd378a4137425d2d29dc5ac6f3ab9b7 100644 --- a/docs/api/ctx.rst +++ b/docs/api/ctx.rst @@ -1,239 +1,6 @@ -.. py:module:: ctx - ``ctx`` module ============== -.. py:class:: Context - - .. py:method:: line_to - .. py:method:: move_to - .. py:method:: curve_to - .. py:method:: quad_to - .. py:method:: rel_line_to - .. py:method:: rel_move_to - .. py:method:: rel_curve_to - .. py:method:: rel_quad_to - .. py:method:: rectangle - .. py:method:: arc - .. py:method:: arc_to - .. py:method:: rel_arc_to - .. py:method:: round_rectangle - .. py:method:: begin_path - .. py:method:: close_path - .. py:method:: in_fill - .. py:method:: fill - .. py:method:: stroke - .. py:method:: paint - .. py:method:: clip - .. py:method:: text - .. py:method:: text_width - .. py:method:: rotate - .. py:method:: scale - .. py:method:: translate - .. py:method:: apply_transform - .. py:method:: start_group - .. py:method:: end_group - .. py:method:: preserve - .. py:method:: linear_gradient - .. py:method:: radial_gradient - .. py:method:: add_stop - .. py:method:: line_dash - .. py:method:: texture - .. py:method:: save - .. py:method:: restore - .. py:method:: start_frame - .. py:method:: end_frame - .. py:method:: get_font_name - - .. py:method:: gray - .. py:method:: rgb - .. py:method:: rgba - - .. py:method:: tinyvg_draw - .. py:method:: tinyvg_get_size - - .. py:method:: logo - - Attributes - ---------- - - .. py:attribute:: x - .. py:attribute:: y - .. py:attribute:: width - .. py:attribute:: height - .. py:attribute:: font - .. py:attribute:: image_smoothing - .. py:attribute:: compositing_mode - .. py:attribute:: blend_mode - .. py:attribute:: flags - .. py:attribute:: line_cap - .. py:attribute:: line_join - .. py:attribute:: text_align - .. py:attribute:: fill_rule - .. py:attribute:: text_baseline - .. py:attribute:: line_width - .. py:attribute:: line_dash_offset - .. py:attribute:: line_height - .. py:attribute:: wrap_left - .. py:attribute:: wrap_right - .. py:attribute:: miter_limit - .. py:attribute:: global_alpha - .. py:attribute:: font_size - - Flag constants - -------------- - - .. py:data:: LOWFI - .. py:data:: GRAY2 - .. py:data:: GRAY4 - .. py:data:: GRAY8 - .. py:data:: RGB332 - .. py:data:: HASH_CACHE - .. py:data:: KEEP_DATA - .. py:data:: INTRA_UPDATE - .. py:data:: STAY_LOW - - Fill rule constants - ------------------- - - .. py:data:: WINDING - .. py:data:: EVEN_ODD - - Join constants - -------------- - - .. py:data:: BEVEL - .. py:data:: ROUND - .. py:data:: MITER - - Cap constants - ------------- - - .. py:data:: NONE - .. py:data:: ROUND - .. py:data:: SQUARE - - Composite constants - ------------------- - - .. py:data:: SOURCE_OVER - .. py:data:: COPY - .. py:data:: SOURCE_IN - .. py:data:: SOURCE_OUT - .. py:data:: SOURCE_ATOP - .. py:data:: CLEAR - .. py:data:: DESTINATION_OVER - .. py:data:: DESTINATION - .. py:data:: DESTINATION_IN - .. py:data:: DESTINATION_OUT - .. py:data:: DESTINATION_ATOP - .. py:data:: XOR - - Blend constants - --------------- - - .. py:data:: NORMAL - .. py:data:: MULTIPLY - .. py:data:: SCREEN - .. py:data:: OVERLAY - .. py:data:: DARKEN - .. py:data:: LIGHTEN - .. py:data:: COLOR_DODGE - .. py:data:: COLOR_BURN - .. py:data:: HARD_LIGHT - .. py:data:: SOFT_LIGHT - .. py:data:: DIFFERENCE - .. py:data:: EXCLUSION - .. py:data:: HUE - .. py:data:: SATURATION - .. py:data:: COLOR - .. py:data:: LUMINOSITY - .. py:data:: DIVIDE - .. py:data:: ADDITION - .. py:data:: SUBTRACT - - Text baseline constants - ----------------------- - - .. py:data:: ALPHABETIC - .. py:data:: TOP - .. py:data:: HANGING - .. py:data:: MIDDLE - .. py:data:: IDEOGRAPHIC - .. py:data:: BOTTOM - - Text alignment constants - ------------------------ - - .. py:data:: START - .. py:data:: END - .. py:data:: CENTER - .. py:data:: LEFT - .. py:data:: RIGHT - - Format constants - ---------------- - - .. py:data:: GRAY8 - .. py:data:: GRAYA8 - .. py:data:: RGB8 - .. py:data:: RGBA8 - .. py:data:: BGRA8 - .. py:data:: RGB565 - .. py:data:: RGB565_BYTESWAPPED - .. py:data:: RGB332 - .. py:data:: GRAY1 - .. py:data:: GRAY2 - .. py:data:: GRAY4 - .. py:data:: YUV420 - - Other constants - --------------- - - .. py:data:: PRESS - .. py:data:: MOTION - .. py:data:: RELEASE - .. py:data:: ENTER - .. py:data:: LEAVE - .. py:data:: TAP - .. py:data:: TAP_AND_HOLD - .. py:data:: DRAG_PRESS - .. py:data:: DRAG_MOTION - .. py:data:: DRAG_RELEASE - .. py:data:: KEY_PRESS - .. py:data:: KEY_DOWN - .. py:data:: KEY_UP - .. py:data:: SCROLL - .. py:data:: MESSAGE - .. py:data:: DROP - .. py:data:: SET_CURSOR - -Formats -------- - -.. py:data:: -.. py:data:: GRAY8 -.. py:data:: GRAYA8 -.. py:data:: RGB8 -.. py:data:: RGBA8 -.. py:data:: BGRA8 -.. py:data:: RGB565 -.. py:data:: RGB565_BYTESWAPPED -.. py:data:: RGB332 -.. py:data:: GRAY1 -.. py:data:: GRAY2 -.. py:data:: GRAY4 -.. py:data:: YUV420 - -Flags ------ - -.. py:data:: LOWFI -.. py:data:: GRAY2 -.. py:data:: GRAY4 -.. py:data:: GRAY8 -.. py:data:: RGB332 -.. py:data:: HASH_CACHE -.. py:data:: KEEP_DATA -.. py:data:: INTRA_UPDATE -.. py:data:: STAY_LOW +.. automodule:: st4m.ui.ctx + :members: + :undoc-members: diff --git a/docs/api/hardware.rst b/docs/api/hardware.rst index 6ea333af4fbe5e0554dbfc7173a76b95ec231565..63fa6e05dec3d52e371c27d00549a60d6d42ce79 100644 --- a/docs/api/hardware.rst +++ b/docs/api/hardware.rst @@ -1,44 +1,7 @@ -.. py:module:: hardware - ``hardware`` module -==================== - -.. py:function:: init_done - -.. py:function:: captouch_calibration_active -.. py:function:: get_captouch -.. py:function:: captouch_get_petal_pad_raw -.. py:function:: captouch_get_petal_pad -.. py:function:: captouch_get_petal_rad -.. py:function:: captouch_get_petal_phi -.. py:function:: captouch_set_petal_pad_threshold -.. py:function:: captouch_autocalib -.. py:function:: captouch_set_calibration_afe_target - -.. py:function:: menu_button_get -.. py:function:: application_button_get -.. py:function:: left_button_get -.. py:function:: right_button_get -.. py:function:: menu_button_set_left -.. py:function:: menu_button_get_left +=================== -.. py:function:: set_global_volume_dB -.. py:function:: count_sources -.. py:function:: dump_all_sources -.. py:function:: display_update -.. py:function:: freertos_sleep -.. py:function:: display_pipe_full -.. py:function:: display_pipe_flush -.. py:function:: display_set_backlight -.. py:function:: version -.. py:function:: get_ctx +.. automodule:: hardware + :members: + :undoc-members: -.. py:data:: BUTTON_PRESSED_LEFT - :type: int -.. py:data:: BUTTON_PRESSED_RIGHT - :type: int -.. py:data:: BUTTON_PRESSED_DOWN - :type: int -.. py:data:: BUTTON_NOT_PRESSED - :type: int -}; diff --git a/docs/api/kernel.rst b/docs/api/kernel.rst index e23542cfa3fb50a70026e53c5d41583d16c12bd4..c3fab4f6dbbc1ad351d8f4a009799af94d0b3ad2 100644 --- a/docs/api/kernel.rst +++ b/docs/api/kernel.rst @@ -1,20 +1,7 @@ -.. py:module:: kernel - ``kernel`` module ================= -.. py:function:: scheduler_snapshot -.. py:function:: heap_stats +.. automodule:: kernel + :members: + :undoc-members: -.. py:data:: RUNNING - :type: int -.. py:data:: READY - :type: int -.. py:data:: BLOCKED - :type: int -.. py:data:: SUSPENDED - :type: int -.. py:data:: DELETED - :type: int -.. py:data:: INVALID - :type: int diff --git a/docs/index.rst b/docs/index.rst index 2a0948b0f51d2a0bc6caf0ea7dbb5d8d566c1cfa..215f2aa45f335f92a3d2acc09239c22aca14782e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,6 +22,7 @@ Welcome to flow3r's documentation! api/audio.rst api/badge_link.rst + api/captouch.rst api/hardware.rst api/kernel.rst api/synth.rst diff --git a/python_payload/mypystubs/badge_link.pyi b/python_payload/mypystubs/badge_link.pyi index 7e31d61d64d615ee3204a51b82779da99753deea..001ab920ad4a924e8117f4309ffd098317572aa1 100644 --- a/python_payload/mypystubs/badge_link.pyi +++ b/python_payload/mypystubs/badge_link.pyi @@ -136,4 +136,4 @@ class Jack(Protocol): ... left: Jack -right: JackKhizqrU9ANxlu5sP +right: Jack diff --git a/python_payload/mypystubs/hardware.pyi b/python_payload/mypystubs/hardware.pyi index 0b39553bd58ac6e7d83fbf080cc4765b7f27b677..be33885db8e21ce46df3f37f97107ef6f5d41f41 100644 --- a/python_payload/mypystubs/hardware.pyi +++ b/python_payload/mypystubs/hardware.pyi @@ -5,9 +5,34 @@ from st4m.ui.ctx import Ctx def freertos_sleep(ms: int) -> None: ... def get_ctx() -> Ctx: ... def display_pipe_full() -> bool: ... +def display_pipe_flush() -> None: ... def display_update(c: Ctx) -> None: ... -def get_captouch(ix: int) -> bool: ... -def left_button_get() -> int: ... -def right_button_get() -> int: ... +def display_set_backlight() -> None: ... def usb_connected() -> bool: ... def usb_console_active() -> bool: ... +def version() -> None: ... +def i2c_scan() -> None: ... + +def captouch_calibration_active() -> None: ... +def get_captouch() -> None: ... +def captouch_get_petal_pad_raw() -> None: ... +def captouch_get_petal_pad() -> None: ... +def captouch_get_petal_rad() -> None: ... +def captouch_get_petal_phi() -> None: ... +def captouch_set_petal_pad_threshold() -> None: ... +def captouch_autocalib() -> None: ... +def captouch_set_calibration_afe_target() -> None: ... + +def menu_button_get() -> None: ... +def application_button_get() -> None: ... +def left_button_get() -> None: ... +def right_button_get() -> None: ... +def menu_button_set_left() -> None: ... +def menu_button_get_left() -> None: ... + +def scope_draw() -> None: ... + +BUTTON_PRESSED_LEFT : int +BUTTON_PRESSED_RIGHT : int +BUTTON_PRESSED_DOWN : int +BUTTON_NOT_PRESSED : int