From 54bf6d75de2294c97d4ec6b6e30ad607a233d410 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Fri, 25 Dec 2015 16:34:35 -0500 Subject: [PATCH 1/6] Update spec version and compatibility table' --- human-readable-spec.md | 13 ++++--------- spec.json | 5 ++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/human-readable-spec.md b/human-readable-spec.md index 53ee17a..446865b 100644 --- a/human-readable-spec.md +++ b/human-readable-spec.md @@ -1,4 +1,4 @@ -ev3dev Language Wrapper Specification (DRAFT ver `0.9.3`, rev 1) +ev3dev Language Wrapper Specification `v1.0.0` === This is an unofficial specification that defines a unified interface for language wrappers to expose the [ev3dev](http://www.ev3dev.org) device APIs. @@ -8,11 +8,6 @@ Because this specification is meant to be implemented in multiple languages, the Some concepts that apply to multiple classes are described as "abstracts". These abstract sections explain how the class should handle specific situations, and do not necessarily translate in to their own class in the wrapper. - - - - - Implementation Notes (important) --- - File access. There should be one class that is used or inherited from in all other classes that need to access object properties via file I/O. This class should check paths for validity, do basic error checking, and generally implement as much of the core I/O functionality as possible. @@ -484,11 +479,11 @@ If an error occurs after the initial connection, an exception should be thrown b Compatibility --- -Starting after version `0.9.0`, we will be documenting the versions of ev3dev that the libraries are compatible with. Compatibility table: -Language Binding Version|Fully Supported Kernel Version +Spec Version|Fully Supported Kernel Version ---|---|--- `v0.9.1`|`v3.16.1-7-ev3dev` -`v0.9.2`|`v3.16.7-ckt10-4-ev3dev-ev3` +`v0.9.2`|`v3.16.7-ckt10-4-ev3dev` +`v1.0.0`|`v3.16.7-ckt21-9-ev3dev` diff --git a/spec.json b/spec.json index d5f2fcf..9e13b66 100644 --- a/spec.json +++ b/spec.json @@ -1,8 +1,7 @@ { "meta": { - "version": "0.9.3-pre", - "specRevision": 2, - "supportedKernel": "v3.16.7-ckt16-7-ev3dev-ev3" + "version": "1.0.0", + "supportedKernel": "v3.16.7-ckt21-9-ev3dev" }, "classes": { "motor": { From 939a2979443551da742486292fd475ffbbbb1877 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Fri, 25 Dec 2015 18:22:54 -0500 Subject: [PATCH 2/6] Begin updating markdown spec for recent(ish) changes A fair amount of content has been temporarily deleted. We will need to go back through the history to carry forward tbe parts that we want and re-implement them with these new templates. This includes: - Updates of some text - New autogen template to generate class definitions Still TODO: - Constructors - Special properties - Methods - Special sensor classes --- autogen/templates/main-spec-classes.liquid | 26 ++ human-readable-spec.md | 304 +++++---------------- spec.json | 2 +- 3 files changed, 100 insertions(+), 232 deletions(-) create mode 100644 autogen/templates/main-spec-classes.liquid diff --git a/autogen/templates/main-spec-classes.liquid b/autogen/templates/main-spec-classes.liquid new file mode 100644 index 0000000..da9c89a --- /dev/null +++ b/autogen/templates/main-spec-classes.liquid @@ -0,0 +1,26 @@ +{% for classPair in classes %} +{% assign class = classPair[1] %} +### {{ class.friendlyName }}{% if class.inheritance %} (inherits from `{{ class.inheritance }}`){% endif + +%}{% for line in class.description %} +{{ line }}{% +endfor %} + +{% if class.driverName %} +**Target driver(s):** `{{ class.driverName | join: ', ' }}`{% +endif %}{% +if class.docsLink %} +**ev3dev docs link:** <{{class.docsLink}}>{% endif +%} + +{% if class.systemProperties %} +#### System properties + +Property Name|Type|Accessibility|Description +---|---|---|--- +{% for prop in class.systemProperties + %}{{prop.name}}|{{prop.type}}|{{ '(readAccess ? "Read" : "") + (readAccess && writeAccess ? "/" : "") + (writeAccess ? "Write" : "")' | eval: prop }}|{% + for line in prop.description %} {{line}}{% endfor %} +{% endfor %}{% +endif %}{% +endfor %} \ No newline at end of file diff --git a/human-readable-spec.md b/human-readable-spec.md index 446865b..3c066ff 100644 --- a/human-readable-spec.md +++ b/human-readable-spec.md @@ -24,28 +24,23 @@ Implementation Notes (important)
-`Motor` (class) : abstract "IO Device" ------ +## Classes - + + + +### Motor The motor class provides a uniform interface for using motors with positional and directional feedback such as the EV3 and NXT motors. This feedback allows for precise control of the motors. This is the most common type of motor, so we just call it `motor`. - -###Constructor: - -Argument Name|Type|Description ----|---|--- -Port|String|The port to control. Specify a blank string (or the undefined/null value for the language) for an automatic search. It is recommended to use the `OUTPUT_*` constants. -Driver Name|String|The motor driver that should be driving the target motor (generally specifies the type of motor). Can be left empty or undefined (in the languages that support it) to specify a wildcard. +**ev3dev docs link:** -###Direct attribute mappings: - +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- @@ -57,7 +52,7 @@ Duty Cycle|int|Read| Returns the current duty cycle of the motor. Units are perc Duty Cycle SP|int|Read/Write| Writing sets the duty cycle setpoint. Reading returns the current value. Units are in percent. Valid values are -100 to 100. A negative value causes the motor to rotate in reverse. This value is only used when `speed_regulation` is off. Encoder Polarity|string|Read/Write| Sets the polarity of the rotary encoder. This is an advanced feature to all use of motors that send inversed encoder signals to the EV3. This should be set correctly by the driver of a device. It You only need to change this value if you are using a unsupported device. Valid values are `normal` and `inversed`. Polarity|string|Read/Write| Sets the polarity of the motor. With `normal` polarity, a positive duty cycle will cause the motor to rotate clockwise. With `inversed` polarity, a positive duty cycle will cause the motor to rotate counter-clockwise. Valid values are `normal` and `inversed`. -Port Name|string|Read| Returns the name of the port that the motor is connected to. +Address|string|Read| Returns the name of the port that this motor is connected to. Position|int|Read/Write| Returns the current position of the motor in pulses of the rotary encoder. When the motor rotates clockwise, the position will increase. Likewise, rotating counter-clockwise causes the position to decrease. Writing will set the position to that value. Position P|int|Read/Write| The proportional constant for the position PID. Position I|int|Read/Write| The integral constant for the position PID. @@ -77,49 +72,32 @@ Stop Commands|string array|Read| Returns a list of stop modes supported by the m Time SP|int|Read/Write| Writing specifies the amount of time the motor will run when using the `run-timed` command. Reading returns the current value. Units are in milliseconds. - +### Large Motor (inherits from `motor`) +EV3 large servo motor -###Special properties: -Property Name|Type|Accessibility|Description ----|---|---|--- -Device Index|Number|Read -Connected|Boolean|Read +**Target driver(s):** `lego-ev3-l-motor` -###Methods: -Method Name|Return Type|Arguments|Description ----|---|---|--- -Reset|Void|None|Sets the `command` motor property to `reset`, which causes the motor driver to reset all of the motor's parameters and state. -###Helper functions: +### Medium Motor (inherits from `motor`) +EV3 medium servo motor -Each motor class should have helper functions for each command that the library supports. -These helper functions can accept parameters to set properties before the command is sent, -or can just require that necessary properties are set beforehand. -
+**Target driver(s):** `lego-ev3-m-motor` -`DC Motor` (class) : abstract "IO Device" ------ - +### DC Motor The DC motor class provides a uniform interface for using regular DC motors with no fancy controls or feedback. This includes LEGO MINDSTORMS RCX motors and LEGO Power Functions motors. - - -###Constructor: -Argument Name|Type|Description ----|---|--- -Port|String|The port to control. Specify a blank string (or the undefined/null value for the language) for an automatic search. It is recommended to use the `OUTPUT_*` constants. +**ev3dev docs link:** -###Direct attribute mappings: - +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- @@ -129,7 +107,7 @@ Driver Name|string|Read| Returns the name of the motor driver that loaded this d Duty Cycle|int|Read| Shows the current duty cycle of the PWM signal sent to the motor. Values are -100 to 100 (-100% to 100%). Duty Cycle SP|int|Read/Write| Writing sets the duty cycle setpoint of the PWM signal sent to the motor. Valid values are -100 to 100 (-100% to 100%). Reading returns the current setpoint. Polarity|string|Read/Write| Sets the polarity of the motor. Valid values are `normal` and `inversed`. -Port Name|string|Read| Returns the name of the port that the motor is connected to. +Address|string|Read| Returns the name of the port that this motor is connected to. Ramp Down SP|int|Read/Write| Sets the time in milliseconds that it take the motor to ramp down from 100% to 0%. Valid values are 0 to 10000 (10 seconds). Default is 0. Ramp Up SP|int|Read/Write| Sets the time in milliseconds that it take the motor to up ramp from 0% to 100%. Valid values are 0 to 10000 (10 seconds). Default is 0. State|string array|Read| Gets a list of flags indicating the motor status. Possible flags are `running` and `ramping`. `running` indicates that the motor is powered. `ramping` indicates that the motor has not yet reached the `duty_cycle_sp`. @@ -138,36 +116,15 @@ Stop Commands|string array|Read| Gets a list of stop commands. Valid values are Time SP|int|Read/Write| Writing specifies the amount of time the motor will run when using the `run-timed` command. Reading returns the current value. Units are in milliseconds. - - -###Special properties: - -Property Name|Type|Accessibility|Description ----|---|---|--- -Device Index|Number|Read -Connected|Boolean|Read - -
- -`Servo Motor` (class) : abstract "IO Device" ------ - - - +### Servo Motor The servo motor class provides a uniform interface for using hobby type servo motors. - - -###Constructor: -Argument Name|Type|Description ----|---|--- -Port|String|The port to control. Specify a blank string (or the undefined/null value for the language) for an automatic search. It is recommended to use the `OUTPUT_*` constants. +**ev3dev docs link:** -###Direct attribute mappings: - +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- @@ -177,35 +134,63 @@ Max Pulse SP|int|Read/Write| Used to set the pulse size in milliseconds for the Mid Pulse SP|int|Read/Write| Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the mid position_sp. Default value is 1500. Valid values are 1300 to 1700. For example, on a 180 degree servo, this would be 90 degrees. On continuous rotation servo, this is the 'neutral' position_sp where the motor does not turn. You must write to the position_sp attribute for changes to this attribute to take effect. Min Pulse SP|int|Read/Write| Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the miniumum (counter-clockwise) position_sp. Default value is 600. Valid values are 300 to 700. You must write to the position_sp attribute for changes to this attribute to take effect. Polarity|string|Read/Write| Sets the polarity of the servo. Valid values are `normal` and `inversed`. Setting the value to `inversed` will cause the position_sp value to be inversed. i.e `-100` will correspond to `max_pulse_sp`, and `100` will correspond to `min_pulse_sp`. -Port Name|string|Read| Returns the name of the port that the motor is connected to. +Address|string|Read| Returns the name of the port that this motor is connected to. Position SP|int|Read/Write| Reading returns the current position_sp of the servo. Writing instructs the servo to move to the specified position_sp. Units are percent. Valid values are -100 to 100 (-100% to 100%) where `-100` corresponds to `min_pulse_sp`, `0` corresponds to `mid_pulse_sp` and `100` corresponds to `max_pulse_sp`. Rate SP|int|Read/Write| Sets the rate_sp at which the servo travels from 0 to 100.0% (half of the full range of the servo). Units are in milliseconds. Example: Setting the rate_sp to 1000 means that it will take a 180 degree servo 2 second to move from 0 to 180 degrees. Note: Some servo controllers may not support this in which case reading and writing will fail with `-EOPNOTSUPP`. In continuous rotation servos, this value will affect the rate_sp at which the speed ramps up or down. State|string array|Read| Returns a list of flags indicating the state of the servo. Possible values are: * `running`: Indicates that the motor is powered. - +### LED +Any device controlled by the generic LED driver. +See https://www.kernel.org/doc/Documentation/leds/leds-class.txt +for more details. + + + -###Special properties: +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- -Device Index|Number|Read -Connected|Boolean|Read +Max Brightness|int|Read| Returns the maximum allowable brightness value. +Brightness|int|Read/Write| Sets the brightness level. Possible values are from 0 to `max_brightness`. +Triggers|string array|Read| Returns a list of available triggers. +Trigger|string selector|Read/Write| Sets the led trigger. A trigger is a kernel based source of led events. Triggers can either be simple or complex. A simple trigger isn't configurable and is designed to slot into existing subsystems with minimal additional code. Examples are the `ide-disk` and `nand-disk` triggers. Complex triggers whilst available to all LEDs have LED specific parameters and work on a per LED basis. The `timer` trigger is an example. The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `on` and `off` time can be specified via `delay_{on,off}` attributes in milliseconds. You can change the brightness value of a LED independently of the timer trigger. However, if you set the brightness value to 0 it will also disable the `timer` trigger. +Delay On|int|Read/Write| The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `on` time can be specified via `delay_on` attribute in milliseconds. +Delay Off|int|Read/Write| The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `off` time can be specified via `delay_off` attribute in milliseconds. -
-`Sensor` (class) : abstract "IO Device" ------ -###Constructor: +### Button +Provides a generic button reading mechanism that can be adapted +to platform specific implementations. Each platform's specific +button capabilites are enumerated in the 'platforms' section +of this specification. + -Argument Name|Type|Description ----|---|--- -Port|String|The port to control. Specify a blank string (or the undefined/null value for the language) for an automatic search. It is recommended to use the `INPUT_*` constants. -Types|String Array|The types of sensors (device IDs) to allow. Leave the array empty or undefined (in the languages that support it) to specify a wildcard. -###Direct attribute mappings: - + +### Sensor +The sensor class provides a uniform interface for using most of the +sensors available for the EV3. The various underlying device drivers will +create a `lego-sensor` device for interacting with the sensors. + +Sensors are primarily controlled by setting the `mode` and monitored by +reading the `value` attributes. Values can be converted to floating point +if needed by `value` / 10.0 ^ `decimals`. + +Since the name of the `sensor` device node does not correspond to the port +that a sensor is plugged in to, you must look at the `address` attribute if +you need to know which port a sensor is plugged in to. However, if you don't +have more than one sensor of each type, you can just look for a matching +`driver_name`. Then it will not matter which port a sensor is plugged in to - your +program will still work. + + +**ev3dev docs link:** + + +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- @@ -216,44 +201,18 @@ Driver Name|string|Read| Returns the name of the sensor device/driver. See the l Mode|string|Read/Write| Returns the current mode. Writing one of the values returned by `modes` sets the sensor to that mode. Modes|string array|Read| Returns a list of the valid modes for the sensor. Num Values|int|Read| Returns the number of `value` attributes that will return a valid value for the current mode. -Port Name|string|Read| Returns the name of the port that the sensor is connected to, e.g. `ev3:in1`. I2C sensors also include the I2C address (decimal), e.g. `ev3:in1:i2c8`. +Address|string|Read| Returns the name of the port that the sensor is connected to, e.g. `ev3:in1`. I2C sensors also include the I2C address (decimal), e.g. `ev3:in1:i2c8`. Units|string|Read| Returns the units of the measured value for the current mode. May return empty string - - -###Special properties: - -Property Name|Type|Accessibility|Description ----|---|---|--- -Device Index|Number|Read -Connected|Boolean|Read - -###Methods: - -Method Name|Return Type|Arguments|Description ----|---|---|--- -Get Value|Number (int)|Value Index : Number|Gets the raw value at the specified index -Get Float Value|Number (float)|Value Index : Number|Gets the value at the specified index, adjusted for the sensor's `dp` value - -
- -`I2C Sensor` (class) : extends `Sensor` ------ - - - +### I2C Sensor (inherits from `sensor`) A generic interface to control I2C-type EV3 sensors. - -###Constructor: -The constructor for the `I2C Sensor` class is the same as its parent's constructor -(the `Sensor` class). +**Target driver(s):** `nxt-i2c-sensor` -###Direct attribute mappings: - +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- @@ -261,29 +220,14 @@ FW Version|string|Read| Returns the firmware version of the sensor if available. Poll MS|int|Read/Write| Returns the polling period of the sensor in milliseconds. Writing sets the polling period. Setting to 0 disables polling. Minimum value is hard coded as 50 msec. Returns -EOPNOTSUPP if changing polling is not supported. Currently only I2C/NXT sensors support changing the polling period. - - -
- -`Power Supply` (class) ------ - - - +### Power Supply A generic interface to read data from the system's power_supply class. Uses the built-in legoev3-battery if none is specified. - -###Constructor: -Argument Name|Type|Description ----|---|--- -Device (optional)|String|The name of the device to control (as listed in `/sys/class/power_supply/`). If left blank or unspecified, the default `legoev3-battery` should be used. `Connected` should be set to true if the device is found. -###Direct attribute mappings: - - +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- @@ -295,94 +239,7 @@ Technology|string|Read| Type|string|Read| - - -###Special properties: - -Property Name|Type|Accessibility|Description ----|---|---|--- -Current Amps|Number (float)|Read|The amount of current, in amps, coming from the device (`current_now` / 1000000) -Voltage Volts|Number (float)|Read|The number of volts (not µV) coming from the device (`voltage_now` / 1000000) -Connected|Boolean|Read - -**NOTE:** The integer measures for current and voltage are in µA and µV, respectively, as returned from the sysfs attribute. - -
- -`LED` (class) ------ - - - -Any device controlled by the generic LED driver. -See https://www.kernel.org/doc/Documentation/leds/leds-class.txt -for more details. - - - -###Constructor: - -Argument Name|Type|Description ----|---|--- -Device|String|The name of the device to control (as listed in `/sys/class/leds/`). `Connected` should be set to true if the device is found. If left blank or unspecified, `Connected` shold be set to false. - -###Direct attribute mappings: - - - -Property Name|Type|Accessibility|Description ----|---|---|--- -Max Brightness|int|Read| Returns the maximum allowable brightness value. -Brightness|int|Read/Write| Sets the brightness level. Possible values are from 0 to `max_brightness`. -Triggers|string array|Read| Returns a list of available triggers. -Trigger|string selector|Read/Write| Sets the led trigger. A trigger is a kernel based source of led events. Triggers can either be simple or complex. A simple trigger isn't configurable and is designed to slot into existing subsystems with minimal additional code. Examples are the `ide-disk` and `nand-disk` triggers. Complex triggers whilst available to all LEDs have LED specific parameters and work on a per LED basis. The `timer` trigger is an example. The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `on` and `off` time can be specified via `delay_{on,off}` attributes in milliseconds. You can change the brightness value of a LED independently of the timer trigger. However, if you set the brightness value to 0 it will also disable the `timer` trigger. -Delay On|int|Read/Write| The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `on` time can be specified via `delay_on` attribute in milliseconds. -Delay Off|int|Read/Write| The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `off` time can be specified via `delay_off` attribute in milliseconds. - - - - -###Special properties: - -Property Name|Type|Accessibility|Description ----|---|---|--- -Connected|Boolean|Read -Brightness Pct | Number | Read/Write | Gets or sets the LED's brightness as a percentage (0-1) of the maximum. - -###Methods - -Method name | Return type | Arguments | Description ----|---|---|--- -On | void | None | Turns the led on by setting its brightness to the maximum level. -Off | void | None | Turns the led off. -Flash | void | ON interval: Number, OFF interval: Number | Enables `timer` trigger and sets `delay_on` and `delay_off` attributes to the provided values (in milliseconds). - -###Static methods - - -Method name | Return type | Arguments | Description ----|---|---|--- -Mix Colors| void | Red Percent: Number, Green Percent: Number | Sets the LEDs to the specified percentage (0-1) of their max brightness. -All Off | void | None | Turns all leds off. - - -###Predefined instances - -There are four predefined instances of the LED class corresponding to the EV3 -leds: - -* Red Right -* Red Left -* Green Right -* Green Left - -
- -`Lego Port` (class) : abstract "IO Device" ------ - - - +### Lego Port The `lego-port` class provides an interface for working with input and output ports that are compatible with LEGO MINDSTORMS RCX/NXT/EV3, LEGO WeDo and LEGO Power Functions sensors and motors. Supported devices include @@ -409,37 +266,22 @@ incremented each time a new port is registered. Note: The number is not related to the actual port at all - use the `address` attribute to find a specific port. - - -###Constructor: -Argument Name|Type|Description ----|---|--- -Port|String|The port to control. Specify a blank string (or the undefined/null value for the language) for an automatic search. It is recommended to use the `OUTPUT_*` constants. -###Direct attribute mappings: - +#### System properties Property Name|Type|Accessibility|Description ---|---|---|--- Driver Name|string|Read| Returns the name of the driver that loaded this device. You can find the complete list of drivers in the [list of port drivers]. Modes|string array|Read| Returns a list of the available modes of the port. Mode|string|Read/Write| Reading returns the currently selected mode. Writing sets the mode. Generally speaking when the mode changes any sensor or motor devices associated with the port will be removed new ones loaded, however this this will depend on the individual driver implementing this class. -Port Name|string|Read| Returns the name of the port. See individual driver documentation for the name that will be returned. +Address|string|Read| Returns the name of the port. See individual driver documentation for the name that will be returned. Set Device|string|Write| For modes that support it, writing the name of a driver will cause a new device to be registered for that driver and attached to this port. For example, since NXT/Analog sensors cannot be auto-detected, you must use this attribute to load the correct driver. Returns -EOPNOTSUPP if setting a device is not supported. Status|string|Read| In most cases, reading status will return the same value as `mode`. In cases where there is an `auto` mode additional values may be returned, such as `no-device` or `error`. See individual port driver documentation for the full list of possible values. - -###Special properties: - -Property Name|Type|Accessibility|Description ----|---|---|--- -Device Index|Number|Read -Connected|Boolean|Read -
Constants / Enums diff --git a/spec.json b/spec.json index 9e13b66..8589003 100644 --- a/spec.json +++ b/spec.json @@ -709,7 +709,7 @@ "Provides a generic button reading mechanism that can be adapted", "to platform specific implementations. Each platform's specific", "button capabilites are enumerated in the 'platforms' section", - "of this specification" + "of this specification." ] }, "sensor": { From 29bb196ef8baf13ea32b9e94e720225b6a3bfe03 Mon Sep 17 00:00:00 2001 From: WasabiFan Date: Thu, 14 Jan 2016 09:03:41 -0800 Subject: [PATCH 3/6] Update markdown spec for new repo structure --- spec-autogen/autogen-config.json | 6 ++++++ .../templates => spec-autogen}/main-spec-classes.liquid | 0 .../md_generic-class-description.liquid | 0 .../md_generic-property-table.liquid | 0 .../templates => spec-autogen}/md_led-color-methods.liquid | 0 5 files changed, 6 insertions(+) create mode 100644 spec-autogen/autogen-config.json rename {autogen/templates => spec-autogen}/main-spec-classes.liquid (100%) rename {autogen/templates => spec-autogen}/md_generic-class-description.liquid (100%) rename {autogen/templates => spec-autogen}/md_generic-property-table.liquid (100%) rename {autogen/templates => spec-autogen}/md_led-color-methods.liquid (100%) diff --git a/spec-autogen/autogen-config.json b/spec-autogen/autogen-config.json new file mode 100644 index 0000000..43f514d --- /dev/null +++ b/spec-autogen/autogen-config.json @@ -0,0 +1,6 @@ +{ + "files": [ + "../human-readable-spec.md" + ], + "templateDir": "./" +} \ No newline at end of file diff --git a/autogen/templates/main-spec-classes.liquid b/spec-autogen/main-spec-classes.liquid similarity index 100% rename from autogen/templates/main-spec-classes.liquid rename to spec-autogen/main-spec-classes.liquid diff --git a/autogen/templates/md_generic-class-description.liquid b/spec-autogen/md_generic-class-description.liquid similarity index 100% rename from autogen/templates/md_generic-class-description.liquid rename to spec-autogen/md_generic-class-description.liquid diff --git a/autogen/templates/md_generic-property-table.liquid b/spec-autogen/md_generic-property-table.liquid similarity index 100% rename from autogen/templates/md_generic-property-table.liquid rename to spec-autogen/md_generic-property-table.liquid diff --git a/autogen/templates/md_led-color-methods.liquid b/spec-autogen/md_led-color-methods.liquid similarity index 100% rename from autogen/templates/md_led-color-methods.liquid rename to spec-autogen/md_led-color-methods.liquid From 1c31cc98014bb6970ed94214d343156256b750f1 Mon Sep 17 00:00:00 2001 From: Denis Demidov Date: Fri, 15 Jan 2016 09:15:03 +0300 Subject: [PATCH 4/6] Create sphinx-generated documentation --- README.md | 13 - README.rst | 28 + autogen/README.md | 45 -- autogen/README.rst | 90 +++ autogen/autogen.js | 12 +- autogen/config.js | 9 +- docs/_static/custom.css | 14 + docs/_templates/page.html | 5 + docs/autogen.rst | 1 + docs/classes.rst | 945 ++++++++++++++++++++++++++ docs/conf.py | 302 ++++++++ docs/constants.rst | 56 ++ docs/index.rst | 15 + docs/spec.rst | 61 ++ human-readable-spec.md | 331 --------- spec-autogen/autogen-config.json | 4 +- spec-autogen/main-spec-classes.liquid | 39 +- 17 files changed, 1553 insertions(+), 417 deletions(-) delete mode 100644 README.md create mode 100644 README.rst delete mode 100644 autogen/README.md create mode 100644 autogen/README.rst create mode 100644 docs/_static/custom.css create mode 100644 docs/_templates/page.html create mode 100644 docs/autogen.rst create mode 100644 docs/classes.rst create mode 100644 docs/conf.py create mode 100644 docs/constants.rst create mode 100644 docs/index.rst create mode 100644 docs/spec.rst delete mode 100644 human-readable-spec.md diff --git a/README.md b/README.md deleted file mode 100644 index 476aa54..0000000 --- a/README.md +++ /dev/null @@ -1,13 +0,0 @@ -ev3dev-lang language bindings -======================== - -This repository stores the utilities and metadata information for the ev3dev-lang family of libraries. These libraries are easy-to-use interfaces for the APIs that are available on [ev3dev-based](http://www.ev3dev.org) devices. - -We support multiple libraries for various programming languages using a centralized "specification" which we keep updated as kernel changes are made. We don't have the actual library code here (see below) -- instead we use this repo to facilitate the maintenance of our bindings. - -We currently support libraries for the following languages: -- [C++](https://github.com/ddemidov/ev3dev-lang-cpp) -- [Node.js](https://github.com/wasabifan/ev3dev-lang-js) -- [Python](https://github.com/rhempel/ev3dev-lang-python) - -Each binding is written based on our central spec, so each has a uniform interface which is kept close to the ev3dev API surface while still encouraging language-specific enhancements. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..8559423 --- /dev/null +++ b/README.rst @@ -0,0 +1,28 @@ +ev3dev-lang language bindings +============================= + +This repository stores the utilities and metadata information for the +ev3dev-lang family of libraries. These libraries are easy-to-use interfaces for +the APIs that are available on `ev3dev`_-based devices. + +The complete documentation is hosted at http://ev3dev-lang.readthedocs.org. + +We support multiple libraries for various programming languages using a +centralized "specification" which we keep updated as kernel changes are made. +We don't have the actual library code here (see below) -- instead we use this +repo to facilitate the maintenance of our bindings. + +We currently support libraries for the following languages: + +- `C++`_ +- `Node.js`_ +- `Python`_ + +Each binding is written based on our central spec, so each has a uniform +interface which is kept close to the ev3dev API surface while still encouraging +language-specific enhancements. + +.. _ev3dev: http://www.ev3dev.org +.. _C++: https://github.com/ddemidov/ev3dev-lang-cpp +.. _Node.js: https://github.com/wasabifan/ev3dev-lang-js +.. _Python: https://github.com/rhempel/ev3dev-lang-python diff --git a/autogen/README.md b/autogen/README.md deleted file mode 100644 index 3a3aa8e..0000000 --- a/autogen/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Autogen scripts for ev3dev language bindings -To help us maintain our language bindings, we have written a script to automatically update sections of code according to changes in our API specification. We define code templates using [Liquid](http://liquidmarkup.org/), which are stored in the `templates` folder with the `.liquid` extension. - -## Usage - -### Prerequisites -- Make sure that you have cloned the repo (including submodules) and `cd`d in to the autogen directory -- You must have Node.JS and `npm` installed -- If you have not yet done so yet, run `npm install` to install the dependencies for auto-generation - -### Running from the command line -If you run the script without any parameters, it will look for an `autogen-config.json` file in your current working directory. The autogen-config file specifies the locations to look for templates and source files. -``` -$ node path/to/autogen.js -``` - -If you want to specify a config file manually, you can include use a full file path for the target JSON config file. -``` -$ node path/to/autogen.js other/path/to/config.json -``` - -## How it works -Our script searches code files for comments that define blocks of code that it should automatically generate. The inline comment tags are formatted as follows (C-style comments): - -``` -//~autogen test-template foo.bar>tmp -... -//~autogen -``` - -After the initial declaration (`~autogen`), the rest of the comment defines parameters for the generation script. The first block of text up to the space is the file name of the template to use. The `.liquid` extension is automatically appended to the given name, and then the file is loaded and parsed. - -The rest of the comment is a space-separated list of contextual variables. The section before the `>` defines the source, and the section after defines the destination. The value from the source is copied to the destination, in the global Liquid context. This makes it possible to use a single template file to generate multiple classes. - -##Implementation Notes -**TODO** - -## Contributing to the autogen script - -Just as we welcome contributions to the language bindings in this repo, we love to have people update our infrastructure. If you want to make a contribution, here are some quick tips to get started developing. - -- After making a change, you should run the script and tell it to re-generate some files to make sure that your changes work as expected. -- If you are making more extensive changes, it may be helpful to create a temporary regen group with some test files to be able to manually test any new features or modifications. -- Although you can use any text editor, we recommend using [Visual Studio Code](https://code.visualstudio.com/) to edit the autogen scripts. It has great autocomplete, and their debug GUI works well with node. - diff --git a/autogen/README.rst b/autogen/README.rst new file mode 100644 index 0000000..619a768 --- /dev/null +++ b/autogen/README.rst @@ -0,0 +1,90 @@ +Autogen scripts for ev3dev language bindings +============================================ + +To help us maintain our language bindings, we have written a script to +automatically update sections of code according to changes in our API +specification. We define code templates using Liquid_, which are stored in the +``templates`` folder with the ``.liquid`` extension. + +.. _Liquid: http://liquidmarkup.org + +Usage +----- + +Prerequisites +############# + +- Make sure that you have cloned the repo (including submodules) and ``cd``'d + into the autogen directory +- You must have Node.JS and ``npm`` installed +- If you have not yet done so yet, run ``npm install`` to install the + dependencies for auto-generation + +Running from the command line +############################# + +If you run the script without any parameters, it will look for an +``autogen-config.json`` file in your current working directory. The +autogen-config file specifies the locations to look for templates and source +files. + +.. code-block:: bash + + $ node path/to/autogen.js + +If you want to specify a config file manually, you can include use a full file +path for the target JSON config file. + +.. code-block:: bash + + $ node path/to/autogen.js other/path/to/config.json + +How it works +------------ + +Our script searches code files for comments that define blocks of code that it +should automatically generate. The inline comment tags are formatted as follows +(C-style comments): + +.. code-block:: cpp + + //~autogen test-template foo.bar>tmp + ... + //~autogen + +After the initial declaration (``~autogen``), the rest of the comment defines +parameters for the generation script. The first block of text up to the space +is the file name of the template to use. The ``.liquid`` extension is +automatically appended to the given name, and then the file is loaded and +parsed. + +The rest of the comment is a space-separated list of contextual variables. The +section before the ``>`` defines the source, and the section after defines the +destination. The value from the source is copied to the destination, in the +global Liquid context. This makes it possible to use a single template file to +generate multiple classes. + +Implementation Notes +-------------------- + +.. todo:: + + fill this up + +Contributing to the autogen script +---------------------------------- + +Just as we welcome contributions to the language bindings in this repo, we love +to have people update our infrastructure. If you want to make a contribution, +here are some quick tips to get started developing. + +- After making a change, you should run the script and tell it to re-generate + some files to make sure that your changes work as expected. +- If you are making more extensive changes, it may be helpful to create a + temporary regen group with some test files to be able to manually test any + new features or modifications. +- Although you can use any text editor, we recommend using + `Visual Studio Code`_ to edit the autogen scripts. It has great autocomplete, + and their debug GUI works well with node. + +.. _Visual Studio Code: https://code.visualstudio.com diff --git a/autogen/autogen.js b/autogen/autogen.js index e15aa8e..1ae51b3 100644 --- a/autogen/autogen.js +++ b/autogen/autogen.js @@ -51,26 +51,26 @@ for (var fileIndex = 0; fileIndex < targetInfo.files.length; fileIndex++) { function getTargetFileInfo() { var pathCandidates = argv._.concat(process.cwd()); - + var configFilePath = pathCandidates.map(function(possiblePath) { var stat = fs.statSync(possiblePath); - + if(stat.isFile()) return path.resolve(possiblePath); else if (stat.isDirectory()) return path.resolve(possiblePath, config.defaultConfigFileName); else return null; - + }).filter(function(configPath) { return !!configPath && fs.existsSync(configPath); })[0]; - + if(!configFilePath) return null; - + var loadedTargetFileInfo = JSON.parse(fs.readFileSync(configFilePath).toString()); - + return { templateDir: path.resolve(path.dirname(configFilePath), loadedTargetFileInfo.templateDir), files: loadedTargetFileInfo.files.map(function(configRelativePath) { diff --git a/autogen/config.js b/autogen/config.js index c02c219..252396d 100644 --- a/autogen/config.js +++ b/autogen/config.js @@ -13,7 +13,8 @@ exports.autogenFenceComments = { '.java': { start: cStyleAutogenStart, end: cStyleAutogenEnd }, '.md': { start: //, end: "" }, '.lua': { start: /--\s*~autogen *(.+)/, end: "-- ~autogen" }, - '.py': { start: /#\s*~autogen *(.+)/, end: "# ~autogen" } + '.py': { start: /#\s*~autogen *(.+)/, end: "# ~autogen" }, + '.rst': { start: /\.\. ~autogen *(.+)/, end: "\.\. ~autogen" } } exports.extraLiquidFilters = { @@ -24,7 +25,7 @@ exports.extraLiquidFilters = { return group1.toUpperCase(); }); } - + if(typeof input == 'string') return camelCaseSingle(input); else @@ -66,7 +67,7 @@ exports.extraLiquidFilters = { }, select: function(array, property) { return array.map(function(item) { - return utils.getProp(item, property); + return utils.getProp(item, property); }); }, //filters the given collection using the provided condition statement, which is @@ -84,4 +85,4 @@ exports.extraLiquidFilters = { var vm = require('vm'); return vm.runInNewContext(expression, context || {}); } -}; \ No newline at end of file +}; diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..fa50035 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,14 @@ +pre { + box-shadow: 0px 1px 6px 0px lightgray; +} + +dl.class { + padding: 5px; + box-shadow: 0px 1px 6px 0px lightgray; +} + +pre { + overflow: auto; + word-wrap: normal; + white-space: pre; +} diff --git a/docs/_templates/page.html b/docs/_templates/page.html new file mode 100644 index 0000000..c65ef34 --- /dev/null +++ b/docs/_templates/page.html @@ -0,0 +1,5 @@ +{# Import the theme's layout. #} +{% extends "!page.html" %} + +{# Custom CSS overrides #} +{% set bootswatch_css_custom = ['_static/custom.css'] %} diff --git a/docs/autogen.rst b/docs/autogen.rst new file mode 100644 index 0000000..c162b2f --- /dev/null +++ b/docs/autogen.rst @@ -0,0 +1 @@ +.. include:: ../autogen/README.rst diff --git a/docs/classes.rst b/docs/classes.rst new file mode 100644 index 0000000..b534155 --- /dev/null +++ b/docs/classes.rst @@ -0,0 +1,945 @@ +Classes +------- + +Device (abstract) +#################### + +.. py:class:: Device + + This is the base class that handles control tasks for a single port or + index. The class must chose one device out of the available ports to + control. Given an IO port (in the constructor), an implementation should: + + - If the specified port is blank or unspecified/undefined/null, the + available devices should be enumerated until a suitable device is found. + Any device is suitable when it's type is known to be compatible with the + controlling class, and it meets any other requirements specified by the + caller. + - If the specified port name is not blank, the available devices should be + enumerated until a device is found that is plugged in to the specified + port. The supplied port name should be compared directly to the value + from the file, so that advanced port strings will match, such as + ``in1:mux3``. + + If an error occurs after the initial connection, an exception should be + thrown by the binding informing the caller of what went wrong. Unless the + error is fatal to the application, no other actions should be taken. + + .. py:attribute:: connected + + If a valid device is found while enumerating the ports, the + ``connected`` variable is set to ``true`` (by default, it should be + false). If ``connected`` is false when an attempt is made to read from + or write to a property file, an error should be thrown (except while in + the consructor). + +.. ~autogen main-spec-classes + +Motor +######################## + +.. py:class:: Motor + + The motor class provides a uniform interface for using motors with + positional and directional feedback such as the EV3 and NXT motors. + This feedback allows for precise control of the motors. This is the + most common type of motor, so we just call it `motor`. + + + + .. rubric:: ev3dev docs link: http://www.ev3dev.org/docs/drivers/tacho-motor-class/ + + .. rubric:: System properties + + .. py:attribute:: Address + + :class:`string, read` + + + Returns the name of the port that this motor is connected to. + + .. py:attribute:: Command + + :class:`string, write` + + + Sends a command to the motor controller. See `commands` for a list of + possible values. + + .. py:attribute:: Commands + + :class:`string array, read` + + + Returns a list of commands that are supported by the motor + controller. Possible values are `run-forever`, `run-to-abs-pos`, `run-to-rel-pos`, + `run-timed`, `run-direct`, `stop` and `reset`. Not all commands may be supported. + + - `run-forever` will cause the motor to run until another command is sent. + - `run-to-abs-pos` will run to an absolute position specified by `position_sp` + and then stop using the command specified in `stop_command`. + - `run-to-rel-pos` will run to a position relative to the current `position` value. + The new position will be current `position` + `position_sp`. When the new + position is reached, the motor will stop using the command specified by `stop_command`. + - `run-timed` will run the motor for the amount of time specified in `time_sp` + and then stop the motor using the command specified by `stop_command`. + - `run-direct` will run the motor at the duty cycle specified by `duty_cycle_sp`. + Unlike other run commands, changing `duty_cycle_sp` while running *will* + take effect immediately. + - `stop` will stop any of the run commands before they are complete using the + command specified by `stop_command`. + - `reset` will reset all of the motor parameter attributes to their default value. + This will also have the effect of stopping the motor. + + .. py:attribute:: Count_Per_Rot + + :class:`int, read` + + + Returns the number of tacho counts in one rotation of the motor. Tacho counts + are used by the position and speed attributes, so you can use this value + to convert rotations or degrees to tacho counts. In the case of linear + actuators, the units here will be counts per centimeter. + + .. py:attribute:: Driver_Name + + :class:`string, read` + + + Returns the name of the driver that provides this tacho motor device. + + .. py:attribute:: Duty_Cycle + + :class:`int, read` + + + Returns the current duty cycle of the motor. Units are percent. Values + are -100 to 100. + + .. py:attribute:: Duty_Cycle_SP + + :class:`int, read/write` + + + Writing sets the duty cycle setpoint. Reading returns the current value. + Units are in percent. Valid values are -100 to 100. A negative value causes + the motor to rotate in reverse. This value is only used when `speed_regulation` + is off. + + .. py:attribute:: Encoder_Polarity + + :class:`string, read/write` + + + Sets the polarity of the rotary encoder. This is an advanced feature to all + use of motors that send inversed encoder signals to the EV3. This should + be set correctly by the driver of a device. It You only need to change this + value if you are using a unsupported device. Valid values are `normal` and + `inversed`. + + .. py:attribute:: Polarity + + :class:`string, read/write` + + + Sets the polarity of the motor. With `normal` polarity, a positive duty + cycle will cause the motor to rotate clockwise. With `inversed` polarity, + a positive duty cycle will cause the motor to rotate counter-clockwise. + Valid values are `normal` and `inversed`. + + .. py:attribute:: Position + + :class:`int, read/write` + + + Returns the current position of the motor in pulses of the rotary + encoder. When the motor rotates clockwise, the position will increase. + Likewise, rotating counter-clockwise causes the position to decrease. + Writing will set the position to that value. + + .. py:attribute:: Position_P + + :class:`int, read/write` + + + The proportional constant for the position PID. + + .. py:attribute:: Position_I + + :class:`int, read/write` + + + The integral constant for the position PID. + + .. py:attribute:: Position_D + + :class:`int, read/write` + + + The derivative constant for the position PID. + + .. py:attribute:: Position_SP + + :class:`int, read/write` + + + Writing specifies the target position for the `run-to-abs-pos` and `run-to-rel-pos` + commands. Reading returns the current value. Units are in tacho counts. You + can use the value returned by `counts_per_rot` to convert tacho counts to/from + rotations or degrees. + + .. py:attribute:: Speed + + :class:`int, read` + + + Returns the current motor speed in tacho counts per second. Note, this is + not necessarily degrees (although it is for LEGO motors). Use the `count_per_rot` + attribute to convert this value to RPM or deg/sec. + + .. py:attribute:: Speed_SP + + :class:`int, read/write` + + + Writing sets the target speed in tacho counts per second used when `speed_regulation` + is on. Reading returns the current value. Use the `count_per_rot` attribute + to convert RPM or deg/sec to tacho counts per second. + + .. py:attribute:: Ramp_Up_SP + + :class:`int, read/write` + + + Writing sets the ramp up setpoint. Reading returns the current value. Units + are in milliseconds. When set to a value > 0, the motor will ramp the power + sent to the motor from 0 to 100% duty cycle over the span of this setpoint + when starting the motor. If the maximum duty cycle is limited by `duty_cycle_sp` + or speed regulation, the actual ramp time duration will be less than the setpoint. + + .. py:attribute:: Ramp_Down_SP + + :class:`int, read/write` + + + Writing sets the ramp down setpoint. Reading returns the current value. Units + are in milliseconds. When set to a value > 0, the motor will ramp the power + sent to the motor from 100% duty cycle down to 0 over the span of this setpoint + when stopping the motor. If the starting duty cycle is less than 100%, the + ramp time duration will be less than the full span of the setpoint. + + .. py:attribute:: Speed_Regulation_Enabled + + :class:`string, read/write` + + + Turns speed regulation on or off. If speed regulation is on, the motor + controller will vary the power supplied to the motor to try to maintain the + speed specified in `speed_sp`. If speed regulation is off, the controller + will use the power specified in `duty_cycle_sp`. Valid values are `on` and + `off`. + + .. py:attribute:: Speed_Regulation_P + + :class:`int, read/write` + + + The proportional constant for the speed regulation PID. + + .. py:attribute:: Speed_Regulation_I + + :class:`int, read/write` + + + The integral constant for the speed regulation PID. + + .. py:attribute:: Speed_Regulation_D + + :class:`int, read/write` + + + The derivative constant for the speed regulation PID. + + .. py:attribute:: State + + :class:`string array, read` + + + Reading returns a list of state flags. Possible flags are + `running`, `ramping` `holding` and `stalled`. + + .. py:attribute:: Stop_Command + + :class:`string, read/write` + + + Reading returns the current stop command. Writing sets the stop command. + The value determines the motors behavior when `command` is set to `stop`. + Also, it determines the motors behavior when a run command completes. See + `stop_commands` for a list of possible values. + + .. py:attribute:: Stop_Commands + + :class:`string array, read` + + + Returns a list of stop modes supported by the motor controller. + Possible values are `coast`, `brake` and `hold`. `coast` means that power will + be removed from the motor and it will freely coast to a stop. `brake` means + that power will be removed from the motor and a passive electrical load will + be placed on the motor. This is usually done by shorting the motor terminals + together. This load will absorb the energy from the rotation of the motors and + cause the motor to stop more quickly than coasting. `hold` does not remove + power from the motor. Instead it actively try to hold the motor at the current + position. If an external force tries to turn the motor, the motor will 'push + back' to maintain its position. + + .. py:attribute:: Time_SP + + :class:`int, read/write` + + + Writing specifies the amount of time the motor will run when using the + `run-timed` command. Reading returns the current value. Units are in + milliseconds. + + + +Large Motor +######################## + +.. py:class:: Large_Motor + + EV3 large servo motor + + + .. rubric:: inherits from: :py:class:`motor` + + + .. rubric:: Target driver(s): ``lego-ev3-l-motor`` + + + +Medium Motor +######################## + +.. py:class:: Medium_Motor + + EV3 medium servo motor + + + .. rubric:: inherits from: :py:class:`motor` + + + .. rubric:: Target driver(s): ``lego-ev3-m-motor`` + + + +DC Motor +######################## + +.. py:class:: DC_Motor + + The DC motor class provides a uniform interface for using regular DC motors + with no fancy controls or feedback. This includes LEGO MINDSTORMS RCX motors + and LEGO Power Functions motors. + + + + .. rubric:: ev3dev docs link: http://www.ev3dev.org/docs/drivers/dc-motor-class/ + + .. rubric:: System properties + + .. py:attribute:: Address + + :class:`string, read` + + + Returns the name of the port that this motor is connected to. + + .. py:attribute:: Command + + :class:`string, write` + + + Sets the command for the motor. Possible values are `run-forever`, `run-timed` and + `stop`. Not all commands may be supported, so be sure to check the contents + of the `commands` attribute. + + .. py:attribute:: Commands + + :class:`string array, read` + + + Returns a list of commands supported by the motor + controller. + + .. py:attribute:: Driver_Name + + :class:`string, read` + + + Returns the name of the motor driver that loaded this device. See the list + of [supported devices] for a list of drivers. + + .. py:attribute:: Duty_Cycle + + :class:`int, read` + + + Shows the current duty cycle of the PWM signal sent to the motor. Values + are -100 to 100 (-100% to 100%). + + .. py:attribute:: Duty_Cycle_SP + + :class:`int, read/write` + + + Writing sets the duty cycle setpoint of the PWM signal sent to the motor. + Valid values are -100 to 100 (-100% to 100%). Reading returns the current + setpoint. + + .. py:attribute:: Polarity + + :class:`string, read/write` + + + Sets the polarity of the motor. Valid values are `normal` and `inversed`. + + .. py:attribute:: Ramp_Down_SP + + :class:`int, read/write` + + + Sets the time in milliseconds that it take the motor to ramp down from 100% + to 0%. Valid values are 0 to 10000 (10 seconds). Default is 0. + + .. py:attribute:: Ramp_Up_SP + + :class:`int, read/write` + + + Sets the time in milliseconds that it take the motor to up ramp from 0% to + 100%. Valid values are 0 to 10000 (10 seconds). Default is 0. + + .. py:attribute:: State + + :class:`string array, read` + + + Gets a list of flags indicating the motor status. Possible + flags are `running` and `ramping`. `running` indicates that the motor is + powered. `ramping` indicates that the motor has not yet reached the + `duty_cycle_sp`. + + .. py:attribute:: Stop_Command + + :class:`string, write` + + + Sets the stop command that will be used when the motor stops. Read + `stop_commands` to get the list of valid values. + + .. py:attribute:: Stop_Commands + + :class:`string array, read` + + + Gets a list of stop commands. Valid values are `coast` + and `brake`. + + .. py:attribute:: Time_SP + + :class:`int, read/write` + + + Writing specifies the amount of time the motor will run when using the + `run-timed` command. Reading returns the current value. Units are in + milliseconds. + + + +Servo Motor +######################## + +.. py:class:: Servo_Motor + + The servo motor class provides a uniform interface for using hobby type + servo motors. + + + + .. rubric:: ev3dev docs link: http://www.ev3dev.org/docs/drivers/servo-motor-class/ + + .. rubric:: System properties + + .. py:attribute:: Address + + :class:`string, read` + + + Returns the name of the port that this motor is connected to. + + .. py:attribute:: Command + + :class:`string, write` + + + Sets the command for the servo. Valid values are `run` and `float`. Setting + to `run` will cause the servo to be driven to the position_sp set in the + `position_sp` attribute. Setting to `float` will remove power from the motor. + + .. py:attribute:: Driver_Name + + :class:`string, read` + + + Returns the name of the motor driver that loaded this device. See the list + of [supported devices] for a list of drivers. + + .. py:attribute:: Max_Pulse_SP + + :class:`int, read/write` + + + Used to set the pulse size in milliseconds for the signal that tells the + servo to drive to the maximum (clockwise) position_sp. Default value is 2400. + Valid values are 2300 to 2700. You must write to the position_sp attribute for + changes to this attribute to take effect. + + .. py:attribute:: Mid_Pulse_SP + + :class:`int, read/write` + + + Used to set the pulse size in milliseconds for the signal that tells the + servo to drive to the mid position_sp. Default value is 1500. Valid + values are 1300 to 1700. For example, on a 180 degree servo, this would be + 90 degrees. On continuous rotation servo, this is the 'neutral' position_sp + where the motor does not turn. You must write to the position_sp attribute for + changes to this attribute to take effect. + + .. py:attribute:: Min_Pulse_SP + + :class:`int, read/write` + + + Used to set the pulse size in milliseconds for the signal that tells the + servo to drive to the miniumum (counter-clockwise) position_sp. Default value + is 600. Valid values are 300 to 700. You must write to the position_sp + attribute for changes to this attribute to take effect. + + .. py:attribute:: Polarity + + :class:`string, read/write` + + + Sets the polarity of the servo. Valid values are `normal` and `inversed`. + Setting the value to `inversed` will cause the position_sp value to be + inversed. i.e `-100` will correspond to `max_pulse_sp`, and `100` will + correspond to `min_pulse_sp`. + + .. py:attribute:: Position_SP + + :class:`int, read/write` + + + Reading returns the current position_sp of the servo. Writing instructs the + servo to move to the specified position_sp. Units are percent. Valid values + are -100 to 100 (-100% to 100%) where `-100` corresponds to `min_pulse_sp`, + `0` corresponds to `mid_pulse_sp` and `100` corresponds to `max_pulse_sp`. + + .. py:attribute:: Rate_SP + + :class:`int, read/write` + + + Sets the rate_sp at which the servo travels from 0 to 100.0% (half of the full + range of the servo). Units are in milliseconds. Example: Setting the rate_sp + to 1000 means that it will take a 180 degree servo 2 second to move from 0 + to 180 degrees. Note: Some servo controllers may not support this in which + case reading and writing will fail with `-EOPNOTSUPP`. In continuous rotation + servos, this value will affect the rate_sp at which the speed ramps up or down. + + .. py:attribute:: State + + :class:`string array, read` + + + Returns a list of flags indicating the state of the servo. + Possible values are: + * `running`: Indicates that the motor is powered. + + + +LED +######################## + +.. py:class:: LED + + Any device controlled by the generic LED driver. + See https://www.kernel.org/doc/Documentation/leds/leds-class.txt + for more details. + + + + + .. rubric:: System properties + + .. py:attribute:: Max_Brightness + + :class:`int, read` + + + Returns the maximum allowable brightness value. + + .. py:attribute:: Brightness + + :class:`int, read/write` + + + Sets the brightness level. Possible values are from 0 to `max_brightness`. + + .. py:attribute:: Triggers + + :class:`string array, read` + + + Returns a list of available triggers. + + .. py:attribute:: Trigger + + :class:`string selector, read/write` + + + Sets the led trigger. A trigger + is a kernel based source of led events. Triggers can either be simple or + complex. A simple trigger isn't configurable and is designed to slot into + existing subsystems with minimal additional code. Examples are the `ide-disk` and + `nand-disk` triggers. + + Complex triggers whilst available to all LEDs have LED specific + parameters and work on a per LED basis. The `timer` trigger is an example. + The `timer` trigger will periodically change the LED brightness between + 0 and the current brightness setting. The `on` and `off` time can + be specified via `delay_{on,off}` attributes in milliseconds. + You can change the brightness value of a LED independently of the timer + trigger. However, if you set the brightness value to 0 it will + also disable the `timer` trigger. + + .. py:attribute:: Delay_On + + :class:`int, read/write` + + + The `timer` trigger will periodically change the LED brightness between + 0 and the current brightness setting. The `on` time can + be specified via `delay_on` attribute in milliseconds. + + .. py:attribute:: Delay_Off + + :class:`int, read/write` + + + The `timer` trigger will periodically change the LED brightness between + 0 and the current brightness setting. The `off` time can + be specified via `delay_off` attribute in milliseconds. + + + +Button +######################## + +.. py:class:: Button + + Provides a generic button reading mechanism that can be adapted + to platform specific implementations. Each platform's specific + button capabilites are enumerated in the 'platforms' section + of this specification. + + + + + + +Sensor +######################## + +.. py:class:: Sensor + + The sensor class provides a uniform interface for using most of the + sensors available for the EV3. The various underlying device drivers will + create a `lego-sensor` device for interacting with the sensors. + + Sensors are primarily controlled by setting the `mode` and monitored by + reading the `value` attributes. Values can be converted to floating point + if needed by `value` / 10.0 ^ `decimals`. + + Since the name of the `sensor` device node does not correspond to the port + that a sensor is plugged in to, you must look at the `address` attribute if + you need to know which port a sensor is plugged in to. However, if you don't + have more than one sensor of each type, you can just look for a matching + `driver_name`. Then it will not matter which port a sensor is plugged in to - your + program will still work. + + + + .. rubric:: ev3dev docs link: http://www.ev3dev.org/docs/drivers/lego-sensor-class/ + + .. rubric:: System properties + + .. py:attribute:: Address + + :class:`string, read` + + + Returns the name of the port that the sensor is connected to, e.g. `ev3:in1`. + I2C sensors also include the I2C address (decimal), e.g. `ev3:in1:i2c8`. + + .. py:attribute:: Command + + :class:`string, write` + + + Sends a command to the sensor. + + .. py:attribute:: Commands + + :class:`string array, read` + + + Returns a list of the valid commands for the sensor. + Returns -EOPNOTSUPP if no commands are supported. + + .. py:attribute:: Decimals + + :class:`int, read` + + + Returns the number of decimal places for the values in the `value` + attributes of the current mode. + + .. py:attribute:: Driver_Name + + :class:`string, read` + + + Returns the name of the sensor device/driver. See the list of [supported + sensors] for a complete list of drivers. + + .. py:attribute:: Mode + + :class:`string, read/write` + + + Returns the current mode. Writing one of the values returned by `modes` + sets the sensor to that mode. + + .. py:attribute:: Modes + + :class:`string array, read` + + + Returns a list of the valid modes for the sensor. + + .. py:attribute:: Num_Values + + :class:`int, read` + + + Returns the number of `value` attributes that will return a valid value + for the current mode. + + .. py:attribute:: Units + + :class:`string, read` + + + Returns the units of the measured value for the current mode. May return + empty string + + + +I2C Sensor +######################## + +.. py:class:: I2C_Sensor + + A generic interface to control I2C-type EV3 sensors. + + + .. rubric:: inherits from: :py:class:`sensor` + + + .. rubric:: Target driver(s): ``nxt-i2c-sensor`` + + .. rubric:: System properties + + .. py:attribute:: FW_Version + + :class:`string, read` + + + Returns the firmware version of the sensor if available. Currently only + I2C/NXT sensors support this. + + .. py:attribute:: Poll_MS + + :class:`int, read/write` + + + Returns the polling period of the sensor in milliseconds. Writing sets the + polling period. Setting to 0 disables polling. Minimum value is hard + coded as 50 msec. Returns -EOPNOTSUPP if changing polling is not supported. + Currently only I2C/NXT sensors support changing the polling period. + + + +Power Supply +######################## + +.. py:class:: Power_Supply + + A generic interface to read data from the system's power_supply class. + Uses the built-in legoev3-battery if none is specified. + + + + + .. rubric:: System properties + + .. py:attribute:: Measured_Current + + :class:`int, read` + + + The measured current that the battery is supplying (in microamps) + + .. py:attribute:: Measured_Voltage + + :class:`int, read` + + + The measured voltage that the battery is supplying (in microvolts) + + .. py:attribute:: Max_Voltage + + :class:`int, read` + + + + .. py:attribute:: Min_Voltage + + :class:`int, read` + + + + .. py:attribute:: Technology + + :class:`string, read` + + + + .. py:attribute:: Type + + :class:`string, read` + + + + + +Lego Port +######################## + +.. py:class:: Lego_Port + + The `lego-port` class provides an interface for working with input and + output ports that are compatible with LEGO MINDSTORMS RCX/NXT/EV3, LEGO + WeDo and LEGO Power Functions sensors and motors. Supported devices include + the LEGO MINDSTORMS EV3 Intelligent Brick, the LEGO WeDo USB hub and + various sensor multiplexers from 3rd party manufacturers. + + Some types of ports may have multiple modes of operation. For example, the + input ports on the EV3 brick can communicate with sensors using UART, I2C + or analog validate signals - but not all at the same time. Therefore there + are multiple modes available to connect to the different types of sensors. + + In most cases, ports are able to automatically detect what type of sensor + or motor is connected. In some cases though, this must be manually specified + using the `mode` and `set_device` attributes. The `mode` attribute affects + how the port communicates with the connected device. For example the input + ports on the EV3 brick can communicate using UART, I2C or analog voltages, + but not all at the same time, so the mode must be set to the one that is + appropriate for the connected sensor. The `set_device` attribute is used to + specify the exact type of sensor that is connected. Note: the mode must be + correctly set before setting the sensor type. + + Ports can be found at `/sys/class/lego-port/port` where `` is + incremented each time a new port is registered. Note: The number is not + related to the actual port at all - use the `address` attribute to find + a specific port. + + + + + .. rubric:: System properties + + .. py:attribute:: Address + + :class:`string, read` + + + Returns the name of the port. See individual driver documentation for + the name that will be returned. + + .. py:attribute:: Driver_Name + + :class:`string, read` + + + Returns the name of the driver that loaded this device. You can find the + complete list of drivers in the [list of port drivers]. + + .. py:attribute:: Modes + + :class:`string array, read` + + + Returns a list of the available modes of the port. + + .. py:attribute:: Mode + + :class:`string, read/write` + + + Reading returns the currently selected mode. Writing sets the mode. + Generally speaking when the mode changes any sensor or motor devices + associated with the port will be removed new ones loaded, however this + this will depend on the individual driver implementing this class. + + .. py:attribute:: Set_Device + + :class:`string, write` + + + For modes that support it, writing the name of a driver will cause a new + device to be registered for that driver and attached to this port. For + example, since NXT/Analog sensors cannot be auto-detected, you must use + this attribute to load the correct driver. Returns -EOPNOTSUPP if setting a + device is not supported. + + .. py:attribute:: Status + + :class:`string, read` + + + In most cases, reading status will return the same value as `mode`. In + cases where there is an `auto` mode additional values may be returned, + such as `no-device` or `error`. See individual port driver documentation + for the full list of possible values. + + + + +.. ~autogen + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..52ec48f --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,302 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# ev3dev-lang documentation build configuration file, created by +# sphinx-quickstart on Fri Jan 15 09:16:03 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +if on_rtd: + import pip + pip.main(['install', 'sphinx_bootstrap_theme']) + +import sphinx_bootstrap_theme + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.todo', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'ev3dev-lang' +copyright = '2016, The ev3dev team' +author = 'The ev3dev team' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.0.0' +# The full version, including alpha/beta/rc tags. +release = '1.0.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() +html_theme = 'bootstrap' +html_theme_options = { + 'bootswatch_theme': 'yeti', + 'navbar_links' : [ + ("GitHub", "https://github.com/ev3dev/ev3dev-lang", True) + ] + } + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'ev3dev-langdoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', + +# Latex figure (float) alignment +#'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'ev3dev-lang.tex', 'ev3dev-lang Documentation', + 'The ev3dev team', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'ev3dev-lang', 'ev3dev-lang Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'ev3dev-lang', 'ev3dev-lang Documentation', + author, 'ev3dev-lang', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False diff --git a/docs/constants.rst b/docs/constants.rst new file mode 100644 index 0000000..5cf57ef --- /dev/null +++ b/docs/constants.rst @@ -0,0 +1,56 @@ +Constants / Enums +----------------- + +Due to the inherent differences between the various languages that we support +here, the enums listed below can also be declared as global constants. + +Ports +##### + +.. py:data:: INPUT_AUTO + + Automatic input selection. Value is instance-specific (see below for + details) + + +.. py:data:: OUTPUT_AUTO + + Automatic output selection. Value is instance-specific (see below for + details) + +.. py:data:: INPUT_1 + + Sensor port 1, ``"in1"`` + +.. py:data:: INPUT_2 + + Sensor port 2,, ``"in2"`` + +.. py:data:: INPUT_3 + + Sensor port 3, ``"in3"`` + +.. py:data:: INPUT_4 + + Sensor port 4, ``"in4"`` + +.. py:data:: OUTPUT_A + + Motor port A, ``"outA"`` + +.. py:data:: OUTPUT_B + + Motor port B, ``"outB"`` + +.. py:data:: OUTPUT_C + + Motor port C, ``"outC"`` + +.. py:data:: OUTPUT_D + + Motor port D, ``"outD"`` + +.. note:: + + The values for the ``*_AUTO`` constants can be chosen by the + implementation. They can have any value that signifies an auto-search. diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..bef4e6f --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,15 @@ +.. include:: ../README.rst + +.. rubric:: Contents + +.. toctree:: + :maxdepth: 3 + + spec + autogen + +.. rubric:: Indices and tables + +* :ref:`genindex` +* :ref:`search` + diff --git a/docs/spec.rst b/docs/spec.rst new file mode 100644 index 0000000..499a8a2 --- /dev/null +++ b/docs/spec.rst @@ -0,0 +1,61 @@ +ev3dev Language Wrapper Specification +===================================== + +This is an unofficial specification that defines a unified interface for +language wrappers to expose the ev3dev_ device APIs. + +.. _ev3dev: http://www.ev3dev.org + +.. rubric:: General Notes + +Because this specification is meant to be implemented in multiple languages, +the specific naming conventions of properties, methods and classes are not +defined here. Depending on the language, names will be slightly different (ex. +"touchSensor" or "TouchSensor" or "touch-sensor") so that they fit the +language's naming conventions. + +Some concepts that apply to multiple classes are described as "abstracts". +These abstract sections explain how the class should handle specific +situations, and do not necessarily translate in to their own class in the +wrapper. + +.. rubric:: Implementation Notes (important) + +- File access. There should be one class that is used or inherited from in all + other classes that need to access object properties via file I/O. This class + should check paths for validity, do basic error checking, and generally + implement as much of the core I/O functionality as possible. +- Errors. All file access and other error-prone calls should be wrapped with + error handling. If an error thrown by an external call is fatal, the wrapper + should throw an error for the caller that states the error and gives some + insight in to what actually happened. +- Naming conventions. All names should follow the language's naming + conventions. Keep the names consistent, so that users can easily find what + they want. +- Attribute types. ``int`` and ``string`` attributes are read-write files + containing a single value that is representable either as an integer or as a + single word. A ``string array`` attribute is a readonly file that contains + space-separated list of words, where each word is a possible value of some + other ``string`` atribute. And a ``string selector`` attribute is a + read-write file that contains space-separated list of possible values, where + the currently selected value is enclosed in square brackets. Another value + may be selected by writing a single word to the file. + +.. rubric:: Contents + +.. toctree:: + :maxdepth: 2 + + classes + constants + +.. rubric:: Compatibility table + +============ ============================== +Spec Version Fully Supported Kernel Version +============ ============================== +``v0.9.1`` ``v3.16.1-7-ev3dev`` +``v0.9.2`` ``v3.16.7-ckt10-4-ev3dev`` +``v1.0.0`` ``v3.16.7-ckt21-9-ev3dev`` +============ ============================== + diff --git a/human-readable-spec.md b/human-readable-spec.md deleted file mode 100644 index 3c066ff..0000000 --- a/human-readable-spec.md +++ /dev/null @@ -1,331 +0,0 @@ -ev3dev Language Wrapper Specification `v1.0.0` -=== -This is an unofficial specification that defines a unified interface for language wrappers to expose the [ev3dev](http://www.ev3dev.org) device APIs. - -General Notes ---- -Because this specification is meant to be implemented in multiple languages, the specific naming conventions of properties, methods and classes are not defined here. Depending on the language, names will be slightly different (ex. "touchSensor" or "TouchSensor" or "touch-sensor") so that they fit the language's naming conventions. - -Some concepts that apply to multiple classes are described as "abstracts". These abstract sections explain how the class should handle specific situations, and do not necessarily translate in to their own class in the wrapper. - -Implementation Notes (important) ---- -- File access. There should be one class that is used or inherited from in all other classes that need to access object properties via file I/O. This class should check paths for validity, do basic error checking, and generally implement as much of the core I/O functionality as possible. -- Errors. All file access and other error-prone calls should be wrapped with error handling. If an error thrown by an external call is fatal, the wrapper should throw an error for the caller that states the error and gives some insight in to what actually happened. -- Naming conventions. All names should follow the language's naming conventions. Keep the names consistent, so that users can easily find what they want. -- Attribute types. `int` and `string` attributes are read-write files - containing a single value that is representable either as an integer or as a - single word. A `string array` attribute is a readonly file that contains - space-separated list of words, where each word is a possible value of some - other `string` atribute. And a `string selector` attribute is a read-write - file that contains space-separated list of possible values, where the - currently selected value is enclosed in square brackets. Another value may be - selected by writing a single word to the file. - -
- -## Classes - - - - - -### Motor -The motor class provides a uniform interface for using motors with -positional and directional feedback such as the EV3 and NXT motors. -This feedback allows for precise control of the motors. This is the -most common type of motor, so we just call it `motor`. - - -**ev3dev docs link:** - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Command|string|Write| Sends a command to the motor controller. See `commands` for a list of possible values. -Commands|string array|Read| Returns a list of commands that are supported by the motor controller. Possible values are `run-forever`, `run-to-abs-pos`, `run-to-rel-pos`, `run-timed`, `run-direct`, `stop` and `reset`. Not all commands may be supported. - `run-forever` will cause the motor to run until another command is sent. - `run-to-abs-pos` will run to an absolute position specified by `position_sp` and then stop using the command specified in `stop_command`. - `run-to-rel-pos` will run to a position relative to the current `position` value. The new position will be current `position` + `position_sp`. When the new position is reached, the motor will stop using the command specified by `stop_command`. - `run-timed` will run the motor for the amount of time specified in `time_sp` and then stop the motor using the command specified by `stop_command`. - `run-direct` will run the motor at the duty cycle specified by `duty_cycle_sp`. Unlike other run commands, changing `duty_cycle_sp` while running *will* take effect immediately. - `stop` will stop any of the run commands before they are complete using the command specified by `stop_command`. - `reset` will reset all of the motor parameter attributes to their default value. This will also have the effect of stopping the motor. -Count Per Rot|int|Read| Returns the number of tacho counts in one rotation of the motor. Tacho counts are used by the position and speed attributes, so you can use this value to convert rotations or degrees to tacho counts. In the case of linear actuators, the units here will be counts per centimeter. -Driver Name|string|Read| Returns the name of the driver that provides this tacho motor device. -Duty Cycle|int|Read| Returns the current duty cycle of the motor. Units are percent. Values are -100 to 100. -Duty Cycle SP|int|Read/Write| Writing sets the duty cycle setpoint. Reading returns the current value. Units are in percent. Valid values are -100 to 100. A negative value causes the motor to rotate in reverse. This value is only used when `speed_regulation` is off. -Encoder Polarity|string|Read/Write| Sets the polarity of the rotary encoder. This is an advanced feature to all use of motors that send inversed encoder signals to the EV3. This should be set correctly by the driver of a device. It You only need to change this value if you are using a unsupported device. Valid values are `normal` and `inversed`. -Polarity|string|Read/Write| Sets the polarity of the motor. With `normal` polarity, a positive duty cycle will cause the motor to rotate clockwise. With `inversed` polarity, a positive duty cycle will cause the motor to rotate counter-clockwise. Valid values are `normal` and `inversed`. -Address|string|Read| Returns the name of the port that this motor is connected to. -Position|int|Read/Write| Returns the current position of the motor in pulses of the rotary encoder. When the motor rotates clockwise, the position will increase. Likewise, rotating counter-clockwise causes the position to decrease. Writing will set the position to that value. -Position P|int|Read/Write| The proportional constant for the position PID. -Position I|int|Read/Write| The integral constant for the position PID. -Position D|int|Read/Write| The derivative constant for the position PID. -Position SP|int|Read/Write| Writing specifies the target position for the `run-to-abs-pos` and `run-to-rel-pos` commands. Reading returns the current value. Units are in tacho counts. You can use the value returned by `counts_per_rot` to convert tacho counts to/from rotations or degrees. -Speed|int|Read| Returns the current motor speed in tacho counts per second. Note, this is not necessarily degrees (although it is for LEGO motors). Use the `count_per_rot` attribute to convert this value to RPM or deg/sec. -Speed SP|int|Read/Write| Writing sets the target speed in tacho counts per second used when `speed_regulation` is on. Reading returns the current value. Use the `count_per_rot` attribute to convert RPM or deg/sec to tacho counts per second. -Ramp Up SP|int|Read/Write| Writing sets the ramp up setpoint. Reading returns the current value. Units are in milliseconds. When set to a value > 0, the motor will ramp the power sent to the motor from 0 to 100% duty cycle over the span of this setpoint when starting the motor. If the maximum duty cycle is limited by `duty_cycle_sp` or speed regulation, the actual ramp time duration will be less than the setpoint. -Ramp Down SP|int|Read/Write| Writing sets the ramp down setpoint. Reading returns the current value. Units are in milliseconds. When set to a value > 0, the motor will ramp the power sent to the motor from 100% duty cycle down to 0 over the span of this setpoint when stopping the motor. If the starting duty cycle is less than 100%, the ramp time duration will be less than the full span of the setpoint. -Speed Regulation Enabled|string|Read/Write| Turns speed regulation on or off. If speed regulation is on, the motor controller will vary the power supplied to the motor to try to maintain the speed specified in `speed_sp`. If speed regulation is off, the controller will use the power specified in `duty_cycle_sp`. Valid values are `on` and `off`. -Speed Regulation P|int|Read/Write| The proportional constant for the speed regulation PID. -Speed Regulation I|int|Read/Write| The integral constant for the speed regulation PID. -Speed Regulation D|int|Read/Write| The derivative constant for the speed regulation PID. -State|string array|Read| Reading returns a list of state flags. Possible flags are `running`, `ramping` `holding` and `stalled`. -Stop Command|string|Read/Write| Reading returns the current stop command. Writing sets the stop command. The value determines the motors behavior when `command` is set to `stop`. Also, it determines the motors behavior when a run command completes. See `stop_commands` for a list of possible values. -Stop Commands|string array|Read| Returns a list of stop modes supported by the motor controller. Possible values are `coast`, `brake` and `hold`. `coast` means that power will be removed from the motor and it will freely coast to a stop. `brake` means that power will be removed from the motor and a passive electrical load will be placed on the motor. This is usually done by shorting the motor terminals together. This load will absorb the energy from the rotation of the motors and cause the motor to stop more quickly than coasting. `hold` does not remove power from the motor. Instead it actively try to hold the motor at the current position. If an external force tries to turn the motor, the motor will 'push back' to maintain its position. -Time SP|int|Read/Write| Writing specifies the amount of time the motor will run when using the `run-timed` command. Reading returns the current value. Units are in milliseconds. - - -### Large Motor (inherits from `motor`) -EV3 large servo motor - - -**Target driver(s):** `lego-ev3-l-motor` - - - -### Medium Motor (inherits from `motor`) -EV3 medium servo motor - - -**Target driver(s):** `lego-ev3-m-motor` - - - -### DC Motor -The DC motor class provides a uniform interface for using regular DC motors -with no fancy controls or feedback. This includes LEGO MINDSTORMS RCX motors -and LEGO Power Functions motors. - - -**ev3dev docs link:** - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Command|string|Write| Sets the command for the motor. Possible values are `run-forever`, `run-timed` and `stop`. Not all commands may be supported, so be sure to check the contents of the `commands` attribute. -Commands|string array|Read| Returns a list of commands supported by the motor controller. -Driver Name|string|Read| Returns the name of the motor driver that loaded this device. See the list of [supported devices] for a list of drivers. -Duty Cycle|int|Read| Shows the current duty cycle of the PWM signal sent to the motor. Values are -100 to 100 (-100% to 100%). -Duty Cycle SP|int|Read/Write| Writing sets the duty cycle setpoint of the PWM signal sent to the motor. Valid values are -100 to 100 (-100% to 100%). Reading returns the current setpoint. -Polarity|string|Read/Write| Sets the polarity of the motor. Valid values are `normal` and `inversed`. -Address|string|Read| Returns the name of the port that this motor is connected to. -Ramp Down SP|int|Read/Write| Sets the time in milliseconds that it take the motor to ramp down from 100% to 0%. Valid values are 0 to 10000 (10 seconds). Default is 0. -Ramp Up SP|int|Read/Write| Sets the time in milliseconds that it take the motor to up ramp from 0% to 100%. Valid values are 0 to 10000 (10 seconds). Default is 0. -State|string array|Read| Gets a list of flags indicating the motor status. Possible flags are `running` and `ramping`. `running` indicates that the motor is powered. `ramping` indicates that the motor has not yet reached the `duty_cycle_sp`. -Stop Command|string|Write| Sets the stop command that will be used when the motor stops. Read `stop_commands` to get the list of valid values. -Stop Commands|string array|Read| Gets a list of stop commands. Valid values are `coast` and `brake`. -Time SP|int|Read/Write| Writing specifies the amount of time the motor will run when using the `run-timed` command. Reading returns the current value. Units are in milliseconds. - - -### Servo Motor -The servo motor class provides a uniform interface for using hobby type -servo motors. - - -**ev3dev docs link:** - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Command|string|Write| Sets the command for the servo. Valid values are `run` and `float`. Setting to `run` will cause the servo to be driven to the position_sp set in the `position_sp` attribute. Setting to `float` will remove power from the motor. -Driver Name|string|Read| Returns the name of the motor driver that loaded this device. See the list of [supported devices] for a list of drivers. -Max Pulse SP|int|Read/Write| Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the maximum (clockwise) position_sp. Default value is 2400. Valid values are 2300 to 2700. You must write to the position_sp attribute for changes to this attribute to take effect. -Mid Pulse SP|int|Read/Write| Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the mid position_sp. Default value is 1500. Valid values are 1300 to 1700. For example, on a 180 degree servo, this would be 90 degrees. On continuous rotation servo, this is the 'neutral' position_sp where the motor does not turn. You must write to the position_sp attribute for changes to this attribute to take effect. -Min Pulse SP|int|Read/Write| Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the miniumum (counter-clockwise) position_sp. Default value is 600. Valid values are 300 to 700. You must write to the position_sp attribute for changes to this attribute to take effect. -Polarity|string|Read/Write| Sets the polarity of the servo. Valid values are `normal` and `inversed`. Setting the value to `inversed` will cause the position_sp value to be inversed. i.e `-100` will correspond to `max_pulse_sp`, and `100` will correspond to `min_pulse_sp`. -Address|string|Read| Returns the name of the port that this motor is connected to. -Position SP|int|Read/Write| Reading returns the current position_sp of the servo. Writing instructs the servo to move to the specified position_sp. Units are percent. Valid values are -100 to 100 (-100% to 100%) where `-100` corresponds to `min_pulse_sp`, `0` corresponds to `mid_pulse_sp` and `100` corresponds to `max_pulse_sp`. -Rate SP|int|Read/Write| Sets the rate_sp at which the servo travels from 0 to 100.0% (half of the full range of the servo). Units are in milliseconds. Example: Setting the rate_sp to 1000 means that it will take a 180 degree servo 2 second to move from 0 to 180 degrees. Note: Some servo controllers may not support this in which case reading and writing will fail with `-EOPNOTSUPP`. In continuous rotation servos, this value will affect the rate_sp at which the speed ramps up or down. -State|string array|Read| Returns a list of flags indicating the state of the servo. Possible values are: * `running`: Indicates that the motor is powered. - - -### LED -Any device controlled by the generic LED driver. -See https://www.kernel.org/doc/Documentation/leds/leds-class.txt -for more details. - - - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Max Brightness|int|Read| Returns the maximum allowable brightness value. -Brightness|int|Read/Write| Sets the brightness level. Possible values are from 0 to `max_brightness`. -Triggers|string array|Read| Returns a list of available triggers. -Trigger|string selector|Read/Write| Sets the led trigger. A trigger is a kernel based source of led events. Triggers can either be simple or complex. A simple trigger isn't configurable and is designed to slot into existing subsystems with minimal additional code. Examples are the `ide-disk` and `nand-disk` triggers. Complex triggers whilst available to all LEDs have LED specific parameters and work on a per LED basis. The `timer` trigger is an example. The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `on` and `off` time can be specified via `delay_{on,off}` attributes in milliseconds. You can change the brightness value of a LED independently of the timer trigger. However, if you set the brightness value to 0 it will also disable the `timer` trigger. -Delay On|int|Read/Write| The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `on` time can be specified via `delay_on` attribute in milliseconds. -Delay Off|int|Read/Write| The `timer` trigger will periodically change the LED brightness between 0 and the current brightness setting. The `off` time can be specified via `delay_off` attribute in milliseconds. - - -### Button -Provides a generic button reading mechanism that can be adapted -to platform specific implementations. Each platform's specific -button capabilites are enumerated in the 'platforms' section -of this specification. - - - - - -### Sensor -The sensor class provides a uniform interface for using most of the -sensors available for the EV3. The various underlying device drivers will -create a `lego-sensor` device for interacting with the sensors. - -Sensors are primarily controlled by setting the `mode` and monitored by -reading the `value` attributes. Values can be converted to floating point -if needed by `value` / 10.0 ^ `decimals`. - -Since the name of the `sensor` device node does not correspond to the port -that a sensor is plugged in to, you must look at the `address` attribute if -you need to know which port a sensor is plugged in to. However, if you don't -have more than one sensor of each type, you can just look for a matching -`driver_name`. Then it will not matter which port a sensor is plugged in to - your -program will still work. - - -**ev3dev docs link:** - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Command|string|Write| Sends a command to the sensor. -Commands|string array|Read| Returns a list of the valid commands for the sensor. Returns -EOPNOTSUPP if no commands are supported. -Decimals|int|Read| Returns the number of decimal places for the values in the `value` attributes of the current mode. -Driver Name|string|Read| Returns the name of the sensor device/driver. See the list of [supported sensors] for a complete list of drivers. -Mode|string|Read/Write| Returns the current mode. Writing one of the values returned by `modes` sets the sensor to that mode. -Modes|string array|Read| Returns a list of the valid modes for the sensor. -Num Values|int|Read| Returns the number of `value` attributes that will return a valid value for the current mode. -Address|string|Read| Returns the name of the port that the sensor is connected to, e.g. `ev3:in1`. I2C sensors also include the I2C address (decimal), e.g. `ev3:in1:i2c8`. -Units|string|Read| Returns the units of the measured value for the current mode. May return empty string - - -### I2C Sensor (inherits from `sensor`) -A generic interface to control I2C-type EV3 sensors. - - -**Target driver(s):** `nxt-i2c-sensor` - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -FW Version|string|Read| Returns the firmware version of the sensor if available. Currently only I2C/NXT sensors support this. -Poll MS|int|Read/Write| Returns the polling period of the sensor in milliseconds. Writing sets the polling period. Setting to 0 disables polling. Minimum value is hard coded as 50 msec. Returns -EOPNOTSUPP if changing polling is not supported. Currently only I2C/NXT sensors support changing the polling period. - - -### Power Supply -A generic interface to read data from the system's power_supply class. -Uses the built-in legoev3-battery if none is specified. - - - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Measured Current|int|Read| The measured current that the battery is supplying (in microamps) -Measured Voltage|int|Read| The measured voltage that the battery is supplying (in microvolts) -Max Voltage|int|Read| -Min Voltage|int|Read| -Technology|string|Read| -Type|string|Read| - - -### Lego Port -The `lego-port` class provides an interface for working with input and -output ports that are compatible with LEGO MINDSTORMS RCX/NXT/EV3, LEGO -WeDo and LEGO Power Functions sensors and motors. Supported devices include -the LEGO MINDSTORMS EV3 Intelligent Brick, the LEGO WeDo USB hub and -various sensor multiplexers from 3rd party manufacturers. - -Some types of ports may have multiple modes of operation. For example, the -input ports on the EV3 brick can communicate with sensors using UART, I2C -or analog validate signals - but not all at the same time. Therefore there -are multiple modes available to connect to the different types of sensors. - -In most cases, ports are able to automatically detect what type of sensor -or motor is connected. In some cases though, this must be manually specified -using the `mode` and `set_device` attributes. The `mode` attribute affects -how the port communicates with the connected device. For example the input -ports on the EV3 brick can communicate using UART, I2C or analog voltages, -but not all at the same time, so the mode must be set to the one that is -appropriate for the connected sensor. The `set_device` attribute is used to -specify the exact type of sensor that is connected. Note: the mode must be -correctly set before setting the sensor type. - -Ports can be found at `/sys/class/lego-port/port` where `` may be -incremented each time a new port is registered. Note: The number is not -related to the actual port at all - use the `address` attribute to find -a specific port. - - - - -#### System properties - -Property Name|Type|Accessibility|Description ----|---|---|--- -Driver Name|string|Read| Returns the name of the driver that loaded this device. You can find the complete list of drivers in the [list of port drivers]. -Modes|string array|Read| Returns a list of the available modes of the port. -Mode|string|Read/Write| Reading returns the currently selected mode. Writing sets the mode. Generally speaking when the mode changes any sensor or motor devices associated with the port will be removed new ones loaded, however this this will depend on the individual driver implementing this class. -Address|string|Read| Returns the name of the port. See individual driver documentation for the name that will be returned. -Set Device|string|Write| For modes that support it, writing the name of a driver will cause a new device to be registered for that driver and attached to this port. For example, since NXT/Analog sensors cannot be auto-detected, you must use this attribute to load the correct driver. Returns -EOPNOTSUPP if setting a device is not supported. -Status|string|Read| In most cases, reading status will return the same value as `mode`. In cases where there is an `auto` mode additional values may be returned, such as `no-device` or `error`. See individual port driver documentation for the full list of possible values. - - - -
- -Constants / Enums ---- - -Due to the inherent differences between the various languages that we support here, the enums listed below can also be declared as global constants. - -###`Ports` - -Name|Value|Description ----|---|--- -`INPUT_AUTO`|instance-specific (see below for details)|Automatic input selection -`OUTPUT_AUTO`|instance-specific (see below for details)|Automatic output selection -`INPUT_1`|"in1"|Sensor port 1 -`INPUT_2`|"in2"|Sensor port 2 -`INPUT_3`|"in3"|Sensor port 3 -`INPUT_4`|"in4"|Sensor port 4 -`OUTPUT_A`|"outA"|Motor port A -`OUTPUT_B`|"outB"|Motor port B -`OUTPUT_C`|"outC"|Motor port C -`OUTPUT_D`|"outD"|Motor port D - -The values for the `*_AUTO` constants can be chosen by the implementation. They can have any value that signifies an auto-search. - -
- -IO Device (abstract) ---- -An IO Device handles control tasks for a single port or index. These classes must chose one device out of the available ports to control. Given an IO port (in the constructor), an implementation should: - -* If the specified port is blank or unspecified/undefined/null, the available devices should be enumerated until a suitable device is found. Any device is suitable when it's type is known to be compatible with the controlling class, and it meets any other requirements specified by the caller. -* If the specified port name is not blank, the available devices should be enumerated until a device is found that is plugged in to the specified port. The supplied port name should be compared directly to the value from the file, so that advanced port strings will match, such as `in1:mux3`. - -All IO devices should have a `connected` variable. If a valid device is found while enumerating the ports, the `connected` variable should be set to `true` (by default, it should be false). If `connected` is false when an attempt is made to read from or write to a property file, an error should be thrown (except while in the consructor). - -If an error occurs after the initial connection, an exception should be thrown by the binding informing the caller of what went wrong. Unless the error is fatal to the application, no other actions should be taken. - -Compatibility ---- - -Compatibility table: - -Spec Version|Fully Supported Kernel Version ----|---|--- -`v0.9.1`|`v3.16.1-7-ev3dev` -`v0.9.2`|`v3.16.7-ckt10-4-ev3dev` -`v1.0.0`|`v3.16.7-ckt21-9-ev3dev` diff --git a/spec-autogen/autogen-config.json b/spec-autogen/autogen-config.json index 43f514d..8a94cac 100644 --- a/spec-autogen/autogen-config.json +++ b/spec-autogen/autogen-config.json @@ -1,6 +1,6 @@ { "files": [ - "../human-readable-spec.md" + "../docs/classes.rst" ], "templateDir": "./" -} \ No newline at end of file +} diff --git a/spec-autogen/main-spec-classes.liquid b/spec-autogen/main-spec-classes.liquid index da9c89a..3cfdc72 100644 --- a/spec-autogen/main-spec-classes.liquid +++ b/spec-autogen/main-spec-classes.liquid @@ -1,26 +1,33 @@ -{% for classPair in classes %} -{% assign class = classPair[1] %} -### {{ class.friendlyName }}{% if class.inheritance %} (inherits from `{{ class.inheritance }}`){% endif +{% for classPair in classes %}{% +assign class = classPair[1] %} +{{ class.friendlyName }} +######################## -%}{% for line in class.description %} -{{ line }}{% +.. py:class:: {{ class.friendlyName | underscore_spaces }} +{% for line in class.description %} + {{ line }}{% endfor %} +{% if class.inheritance %} + .. rubric:: inherits from: :py:class:`{{ class.inheritance }}` +{% endif%} {% if class.driverName %} -**Target driver(s):** `{{ class.driverName | join: ', ' }}`{% + .. rubric:: Target driver(s): ``{{ class.driverName | join: ', ' }}``{% endif %}{% if class.docsLink %} -**ev3dev docs link:** <{{class.docsLink}}>{% endif + .. rubric:: ev3dev docs link: {{class.docsLink}}{% endif %} - {% if class.systemProperties %} -#### System properties + .. rubric:: System properties +{% for prop in class.systemProperties %} + .. py:attribute:: {{prop.name | underscore_spaces }} + + :class:`{{prop.type}}, {{ '(readAccess ? "read" : "") + (readAccess && writeAccess ? "/" : "") + (writeAccess ? "write" : "")' | eval: prop }}` -Property Name|Type|Accessibility|Description ----|---|---|--- -{% for prop in class.systemProperties - %}{{prop.name}}|{{prop.type}}|{{ '(readAccess ? "Read" : "") + (readAccess && writeAccess ? "/" : "") + (writeAccess ? "Write" : "")' | eval: prop }}|{% - for line in prop.description %} {{line}}{% endfor %} +{% for line in prop.description %} + {{line}}{% +endfor %} {% endfor %}{% -endif %}{% -endfor %} \ No newline at end of file +endif %} + +{% endfor %} From e8f3c181bbbc761850a736d4241c6e771c835ef8 Mon Sep 17 00:00:00 2001 From: Denis Demidov Date: Sat, 16 Jan 2016 15:04:52 +0300 Subject: [PATCH 5/6] Use version from spec.json --- docs/conf.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 52ec48f..6e4642b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,6 +16,7 @@ import sys import os import shlex +import json on_rtd = os.environ.get('READTHEDOCS', None) == 'True' @@ -65,10 +66,12 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = '1.0.0' +# Read version from ../spec.json +with open(os.path.join(os.path.dirname(__file__), '..', 'spec.json')) as f: + version = json.load(f)['meta']['version'] + # The full version, including alpha/beta/rc tags. -release = '1.0.0' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 7861e80febd51c84d27b5ffd436ff33a08ec41c9 Mon Sep 17 00:00:00 2001 From: Denis Demidov Date: Sat, 16 Jan 2016 15:06:22 +0300 Subject: [PATCH 6/6] Header de-tautologizing --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 8559423..0655bdc 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -ev3dev-lang language bindings -============================= +ev3dev language bindings +======================== This repository stores the utilities and metadata information for the ev3dev-lang family of libraries. These libraries are easy-to-use interfaces for