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

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


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 66cd10d4
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ in your scripts. ...@@ -27,7 +27,7 @@ in your scripts.
if pressed & buttons.BOTTOM_RIGHT != 0: if pressed & buttons.BOTTOM_RIGHT != 0:
print("Right button pressed!") print("Right button pressed!")
.. py:function:: buttons.read(mask) .. py:function:: read(mask)
Read button status. Read button status.
...@@ -38,22 +38,22 @@ in your scripts. ...@@ -38,22 +38,22 @@ in your scripts.
:returns: An integer with the bits for pressed buttons set. Use the same :returns: An integer with the bits for pressed buttons set. Use the same
costants as for the mask to check which buttons were pressed. costants as for the mask to check which buttons were pressed.
.. py:data:: buttons.BOTTOM_LEFT .. py:data:: BOTTOM_LEFT
Bottom left button. Bottom left button.
.. py:data:: buttons.BOTTOM_RIGHT .. py:data:: BOTTOM_RIGHT
Bottom right button. Bottom right button.
.. py:data:: buttons.TOP_RIGHT .. py:data:: TOP_RIGHT
Top right button. Top right button.
.. py:data:: buttons.TOP_LEFT .. py:data:: TOP_LEFT
Top left button (Reset button). Top left button (Reset button).
.. py:data:: buttons.RESET .. py:data:: RESET
Top left button (Reset button). Top left button (Reset button).
...@@ -18,7 +18,7 @@ output in your scripts. ...@@ -18,7 +18,7 @@ output in your scripts.
state = gpio.read(gpio.WRISTBAND_2) state = gpio.read(gpio.WRISTBAND_2)
print("State of Wristband pin 2:", 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. Configure GPIO pin state.
...@@ -27,55 +27,58 @@ output in your scripts. ...@@ -27,55 +27,58 @@ output in your scripts.
integer by ORing :py:data:`gpio.mode.OUTPUT`, :py:data:`gpio.mode.INPUT`, 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: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. Get GPIO pin state.
:param int pin: ID of the pin of to get the mode of. :param int pin: ID of the pin of to get the mode of.
:returns: An integer with the configure mode bits set. :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. Write a value to a GPIO pin.
:param int pin: ID of the pin of to get the mode of. :param int pin: ID of the pin of to get the mode of.
:param bool value: New pin value. :param bool value: New pin value.
.. py:function:: gpio.read(pin) .. py:function:: read(pin)
Read GPIO pin value. Read GPIO pin value.
:param int pin: ID of the pin of to get the mode of. :param int pin: ID of the pin of to get the mode of.
:returns: Current value of the GPIO pin. :returns: Current value of the GPIO pin.
.. py:data:: gpio.WRISTBAND_1 .. py:data:: WRISTBAND_1
Pin ID for Wristband GPIO 1. Pin ID for Wristband GPIO 1.
.. py:data:: gpio.WRISTBAND_2 .. py:data:: WRISTBAND_2
Pin ID for Wristband GPIO 2. Pin ID for Wristband GPIO 2.
.. py:data:: gpio.WRISTBAND_3 .. py:data:: WRISTBAND_3
Pin ID for Wristband GPIO 3. Pin ID for Wristband GPIO 3.
.. py:data:: gpio.WRISTBAND_4 .. py:data:: WRISTBAND_4
Pin ID for Wristband GPIO 4. Pin ID for Wristband GPIO 4.
.. py:data:: gpio.mode.OUTPUT
.. py:module:: gpio.mode
.. py:data:: OUTPUT
Configures a pin as output. Configures a pin as output.
.. py:data:: gpio.mode.INPUT .. py:data:: INPUT
Configures a pin as 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. 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. 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 ...@@ -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 crude brightness sensor. Values returned are in no particular unit but seem to
be fairly stable. 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 Turn on the ADC and start reading brightness values. (In past this function must be
called before any measurements can be taken.) 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 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: 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. ...@@ -22,6 +22,6 @@ be fairly stable.
:returns: A brightness reading in no particular unit :returns: A brightness reading in no particular unit
.. py:function:: light_sensor.stop() .. py:function:: stop()
Stop the ADC. Stop the ADC.
...@@ -7,13 +7,13 @@ The ``os`` module allows access to a few core functionalities of Epicardium and ...@@ -7,13 +7,13 @@ The ``os`` module allows access to a few core functionalities of Epicardium and
CPython-Like CPython-Like
------------ ------------
.. py:function:: os.unlink(path) .. py:function:: unlink(path)
Unlink (remove) a file. Unlink (remove) a file.
:param str path: The file to remove. :param str path: The file to remove.
.. py:function:: os.listdir(dir) .. py:function:: listdir(dir)
List contents of a directory. List contents of a directory.
...@@ -24,7 +24,7 @@ CPython-Like ...@@ -24,7 +24,7 @@ CPython-Like
Epicardium-Specific Epicardium-Specific
------------------- -------------------
.. py:function:: os.exit(ret = None) .. py:function:: exit(ret = None)
Exit from the current app and return to the menu. Exit from the current app and return to the menu.
...@@ -33,7 +33,7 @@ Epicardium-Specific ...@@ -33,7 +33,7 @@ Epicardium-Specific
success). success).
:return: This function will never return. :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. Try executing a new app, stopping the currently running one.
...@@ -44,7 +44,7 @@ Epicardium-Specific ...@@ -44,7 +44,7 @@ Epicardium-Specific
:param str name: Path to new app/script/l0dable. :param str name: Path to new app/script/l0dable.
:return: This function never returns. It can, however raise an exception. :return: This function never returns. It can, however raise an exception.
.. py:function:: os.reset() .. py:function:: reset()
Reboot card10. Reboot card10.
......
...@@ -22,42 +22,42 @@ The :py:mod:`personal_state` module allows you to set and get the card10 users p ...@@ -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 # Clear the currently configured state
personal_state.clear() personal_state.clear()
.. py:function:: personal_state.set(state, persistent) .. py:function:: set(state, persistent)
Set the users personal state. 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 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. :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. Clears a previously set personal state.
If no personal state was set this function does nothing. It does not matter If no personal state was set this function does nothing. It does not matter
if a set state is marked as persistent or not. if a set state is marked as persistent or not.
.. py:function:: personal_state.get() .. py:function:: get()
Get the users personal state. Get the users personal state.
:returns: A tuple containing the currently set state and a boolean indicating if it's persistent or not. :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. 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. State ID for the "No Contact" personal state.
.. py:data:: personal_state.CHAOS .. py:data:: CHAOS
State ID for the "Chaos" personal state. State ID for the "Chaos" personal state.
.. py:data:: personal_state.COMMUNICATION .. py:data:: COMMUNICATION
State ID for the "Communicatoin" personal state. State ID for the "Communicatoin" personal state.
.. py:data:: personal_state.CAMP .. py:data:: CAMP
State ID for the "Camp" personal state. State ID for the "Camp" personal state.
...@@ -182,7 +182,7 @@ Struct module. ...@@ -182,7 +182,7 @@ Struct module.
``uuid`` ``uuid``
-------- --------
.. 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. Create a new UUID object.
...@@ -217,7 +217,7 @@ Struct module. ...@@ -217,7 +217,7 @@ Struct module.
UUID version accordiung to RFC 4122 UUID version accordiung to RFC 4122
.. py:function:: uuid.uuid4(): .. py:function:: uuid4():
Generate a new UUID version 4 (random UUID). Generate a new UUID version 4 (random UUID).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment