Verified Commit a966e221 authored by Rahix's avatar Rahix
Browse files

chore(docs): Fix python-directives with double-module

Signed-off-by: Rahix's avatarRahix <>
parent 66cd10d4
......@@ -27,7 +27,7 @@ in your scripts.
if pressed & buttons.BOTTOM_RIGHT != 0:
print("Right button pressed!")
.. py:function::
.. py:function:: read(mask)
Read button status.
......@@ -38,22 +38,22 @@ in your scripts.
:returns: An integer with the bits for pressed buttons set. Use the same
costants as for the mask to check which buttons were pressed.
.. py:data:: buttons.BOTTOM_LEFT
.. py:data:: BOTTOM_LEFT
Bottom left button.
.. py:data:: buttons.BOTTOM_RIGHT
.. py:data:: BOTTOM_RIGHT
Bottom right button.
.. py:data:: buttons.TOP_RIGHT
.. py:data:: TOP_RIGHT
Top right button.
.. py:data:: buttons.TOP_LEFT
.. py:data:: TOP_LEFT
Top left button (Reset button).
.. py:data:: buttons.RESET
.. py:data:: RESET
Top left button (Reset button).
......@@ -18,7 +18,7 @@ output in your scripts.
state =
print("State of Wristband pin 2:", state)
.. py:function:: gpio.set_mode(pin, mode)
.. py:function:: set_mode(pin, mode)
Configure GPIO pin state.
......@@ -27,55 +27,58 @@ output in your scripts.
integer by ORing :py:data:`gpio.mode.OUTPUT`, :py:data:`gpio.mode.INPUT`,
:py:data:`gpio.mode.PULL_UP`, :py:data:`gpio.mode.PULL_DOWN`.
.. py:function:: gpio.get_mode(pin)
.. py:function:: get_mode(pin)
Get GPIO pin state.
:param int pin: ID of the pin of to get the mode of.
:returns: An integer with the configure mode bits set.
.. py:function:: gpio.write(pin, value)
.. py:function:: write(pin, value)
Write a value to a GPIO pin.
:param int pin: ID of the pin of to get the mode of.
:param bool value: New pin value.
.. py:function::
.. py:function:: read(pin)
Read GPIO pin value.
:param int pin: ID of the pin of to get the mode of.
:returns: Current value of the GPIO pin.
.. py:data:: gpio.WRISTBAND_1
.. py:data:: WRISTBAND_1
Pin ID for Wristband GPIO 1.
.. py:data:: gpio.WRISTBAND_2
.. py:data:: WRISTBAND_2
Pin ID for Wristband GPIO 2.
.. py:data:: gpio.WRISTBAND_3
.. py:data:: WRISTBAND_3
Pin ID for Wristband GPIO 3.
.. py:data:: gpio.WRISTBAND_4
.. py:data:: WRISTBAND_4
Pin ID for Wristband GPIO 4.
.. py:data:: gpio.mode.OUTPUT
.. py:module:: gpio.mode
.. py:data:: OUTPUT
Configures a pin as output.
.. py:data:: gpio.mode.INPUT
.. py:data:: INPUT
Configures a pin as input.
.. py:data:: gpio.mode.PULL_UP
.. py:data:: PULL_UP
Enables the internal pull-up resistor of a pin.
.. py:data:: gpio.mode.PULL_DOWN
.. py:data:: PULL_DOWN
Enables the internal pull-down resistor of a pin.
......@@ -6,12 +6,12 @@ On the harmonic board, there is an IR-LED which can be used in reverse as a
crude brightness sensor. Values returned are in no particular unit but seem to
be fairly stable.
.. py:function:: light_sensor.start()
.. py:function:: start()
Turn on the ADC and start reading brightness values. (In past this function must be
called before any measurements can be taken.)
.. py:function:: light_sensor.get_reading()
.. py:function:: get_reading()
Get an ambient brightness reading. The returned value is in no particular
unit, though it seems to be fairly stable. The value could be between 0 and 400. Common values:
......@@ -22,6 +22,6 @@ be fairly stable.
:returns: A brightness reading in no particular unit
.. py:function:: light_sensor.stop()
.. py:function:: stop()
Stop the ADC.
......@@ -7,13 +7,13 @@ The ``os`` module allows access to a few core functionalities of Epicardium and
.. py:function:: os.unlink(path)
.. py:function:: unlink(path)
Unlink (remove) a file.
:param str path: The file to remove.
.. py:function:: os.listdir(dir)
.. py:function:: listdir(dir)
List contents of a directory.
......@@ -24,7 +24,7 @@ CPython-Like
.. py:function:: os.exit(ret = None)
.. py:function:: exit(ret = None)
Exit from the current app and return to the menu.
......@@ -33,7 +33,7 @@ Epicardium-Specific
:return: This function will never return.
.. py:function:: os.exec(name)
.. py:function:: exec(name)
Try executing a new app, stopping the currently running one.
......@@ -44,7 +44,7 @@ Epicardium-Specific
:param str name: Path to new app/script/l0dable.
:return: This function never returns. It can, however raise an exception.
.. py:function:: os.reset()
.. py:function:: reset()
Reboot card10.
......@@ -22,42 +22,42 @@ The :py:mod:`personal_state` module allows you to set and get the card10 users p
# Clear the currently configured state
.. py:function:: personal_state.set(state, persistent)
.. py:function:: set(state, persistent)
Set the users personal state.
:param int state: ID of the personal state to set. Must be one of :py:data:`personal_state.NO_CONTACT`, :py:data:`personal_state.CHAOS`, :py:data:`personal_state.COMMUNICATION`, :py:data:`personal_state.CAMP`.
:param int persistent: Controls whether the personal state is persistent. A persistent state is not reset when the pycardium application is changed or restarted. In persistent mode the personal state LED is not controllable by the pycardium application.
.. py:function:: personal_state.clear()
.. py:function:: clear()
Clears a previously set personal state.
If no personal state was set this function does nothing. It does not matter
if a set state is marked as persistent or not.
.. py:function:: personal_state.get()
.. py:function:: get()
Get the users personal state.
:returns: A tuple containing the currently set state and a boolean indicating if it's persistent or not.
.. py:data:: personal_state.NO_STATE
.. py:data:: NO_STATE
State ID reported when no personal state is set.
.. py:data:: personal_state.NO_CONTACT
.. py:data:: NO_CONTACT
State ID for the "No Contact" personal state.
.. py:data:: personal_state.CHAOS
.. py:data:: CHAOS
State ID for the "Chaos" personal state.
.. py:data:: personal_state.COMMUNICATION
.. py:data:: COMMUNICATION
State ID for the "Communicatoin" personal state.
.. py:data:: personal_state.CAMP
.. py:data:: CAMP
State ID for the "Camp" personal state.
......@@ -182,7 +182,7 @@ Struct module.
.. py:class:: uuid.UUID(hex=None, bytes=None, int=None, version=None)
.. py:class:: UUID(hex=None, bytes=None, int=None, version=None)
Create a new UUID object.
......@@ -217,7 +217,7 @@ Struct module.
UUID version accordiung to RFC 4122
.. py:function:: uuid.uuid4():
.. py:function:: uuid4():
Generate a new UUID version 4 (random UUID).
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment