8000 Merge pull request #21 from kwagyeman/openmv · WeActStudio/micropython@d0f8386 · GitHub
[go: up one dir, main page]

Skip to content

Commit d0f8386

Browse files
authored
Merge pull request micropython#21 from kwagyeman/openmv
Fixed spelling mistakes, spacing, and ported docs for OpenMV.
2 parents 6429a07 + 8a29aa7 commit d0f8386

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1549
-828
lines changed

docs/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
28BE
@@ -152,26 +152,26 @@
152152
html_theme_path = ['.']
153153

154154
# Theme options are theme-specific and customize the look and feel of a theme
155-
# further. For a list of options available for each theme, see the
155+
# further. For a list of options available for each theme, see the
156156
# documentation.
157157
#html_theme_options = {}
158158

159159
# Add any paths that contain custom themes here, relative to this directory.
160160
# html_theme_path = ['.']
161161

162-
# The name for this set of Sphinx documents. If None, it defaults to
162+
# The name for this set of Sphinx documents. If None, it defaults to
163163
# "<project> v<release> documentation".
164164
#html_title = None
165165

166-
# A shorter title for the navigation bar. Default is the same as html_title.
166+
# A shorter title for the navigation bar. Default is the same as html_title.
167167
#html_short_title = None
168168

169169
# The name of an image file (relative to this directory) to place at the top
170170
# of the sidebar.
171171
html_logo = '../../openmv-media/logos/openmv-logo-white/web-logo-sticky.png'
172172

173173
# The name of an image file (within the static path) to use as favicon of the
174-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
174+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
175175
# pixels large.
176176
html_favicon = '../../openmv-media/logos/openmv-logo/favicon.ico'
177177

@@ -219,7 +219,7 @@
219219
#html_show_copyright = True
220220

221221
# If true, an OpenSearch description file will be output, and all pages will
222-
# contain a <link> tag referring to it. The value of this option must be the
222+
# contain a <link> tag referring to it. The value of this option must be the
223223
# base URL from which the finished HTML is served.
224224
#html_use_opensearch = ''
225225

docs/library/cmath.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.. module:: cmath
55
:synopsis: mathematical functions for complex numbers
66

7-
The ``cmath`` module provides some basic mathematical funtions for
7+
The ``cmath`` module provides some basic mathematical functions for
88
working with complex numbers.
99

1010
Functions
@@ -20,11 +20,11 @@ Functions
2020

2121
.. function:: log(z)
2222

23-
Return the natural logarithm of ``z``. The branch cut is along the negative real axis.
23+
Return the natural logarithm of ``z``. The branch cut is along the negative real axis.
2424

2525
.. function:: log10(z)
2626

27-
Return the base-10 logarithm of ``z``. The branch cut is along the negative real axis.
27+
Return the base-10 logarithm of ``z``. The branch cut is along the negative real axis.
2828

2929
.. function:: phase(z)
3030

docs/library/esp.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
The ``esp`` module contains specific functions related to the ESP8266 module.
88

9-
109
Functions
1110
---------
1211

@@ -15,7 +14,7 @@ Functions
1514
Get or set the sleep type.
1615

1716
If the ``sleep_type`` parameter is provided, sets the sleep type to its
18-
value. If the function is called wihout parameters, returns the current
17+
value. If the function is called without parameters, returns the current
1918
sleep type.
2019

2120
The possible sleep types are defined as constants:

docs/library/esp.socket.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ Constructors
1515

1616
Create and return a socket object.
1717

18-
1918
TCP Methods
2019
-----------
2120

2221
.. method:: socket.connect(addr)
2322

24-
Connect to the adress and port specified in the ``addr`` tuple.
23+
Connect to the address and port specified in the ``addr`` tuple.
2524

2625
.. method:: socket.close()
2726

@@ -49,7 +48,6 @@ TCP Methods
4948

5049
Receive and return bytes from the socket.
5150

52-
5351
UDP Methods
5452
-----------
5553

@@ -61,7 +59,6 @@ UDP Methods
6159

6260
Placeholder for UDP support, not implemented yet.
6361

64-
6562
Callback Setter Methods
6663
-----------------------
6764

docs/library/gc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Functions
1313

1414
.. function:: disable()
1515

16-
Disable automatic garbage collection. Heap memory can still be allocated,
16+
Disable automatic garbage collection. Heap memory can still be allocated,
1717
and garbage collection can still be initiated manually using :meth:`gc.collect`.
1818

1919
.. function:: collect()

docs/library/index.rst

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ Python standard libraries and micro-libraries
1010
---------------------------------------------
1111

1212
The following standard Python libraries have been "micro-ified" to fit in with
13-
the philosophy of MicroPython. They provide the core functionality of that
13+
the philosophy of MicroPython. They provide the core functionality of that
1414
module and are intended to be a drop-in replacement for the standard Python
1515
library.
1616

1717
.. only:: not port_unix
1818

19-
The modules are available by their u-name, and also by their non-u-name. The
19+
The modules are available by their u-name, and also by their non-u-name. The
2020
non-u-name can be overridden by a file of that name in your package path.
2121
For example, ``import json`` will first search for a file ``json.py`` or
22-
directory ``json`` and load that package if it is found. If nothing is found,
22+
directory ``json`` and load that package if it is found. If nothing is found,
2323
it will fallback to loading the built-in ``ujson`` module.
2424

2525
.. only:: port_unix
@@ -105,6 +105,18 @@ library.
105105
utime.rst
106106
uzlib.rst
107107

108+
.. only:: port_openmvcam
109+
110+
.. toctree::
111+
:maxdepth: 1
112+
113+
gc.rst
114+
math.rst
115+
os.rst
116+
select.rst
117+
struct.rst
118+
sys.rst
119+
time.rst
108120

109121
MicroPython-specific libraries
110122
------------------------------
@@ -115,11 +127,8 @@ the following libraries.
115127
.. toctree::
116128
:maxdepth: 1
117129

118-
machine.rst
119130
micropython.rst
120131
network.rst
121-
uctypes.rst
122-
123132

124133
.. only:: port_pyboard
125134

@@ -131,6 +140,8 @@ the following libraries.
131140
.. toctree::
132141
:maxdepth: 2
133142

143+
machine.rst
144+
uctypes.rst
134145
pyb.rst
135146

136147
.. only:: port_wipy
@@ -143,9 +154,10 @@ the following libraries.
143154
.. toctree::
144155
:maxdepth: 2
145156

157+
machine.rst
158+
uctypes.rst
146159
wipy.rst
147160

148-
149161
.. only:: port_esp8266
150162

151163
Libraries specific to the ESP8266
@@ -156,4 +168,25 @@ the following libraries.
156168
.. toctree::
157169
:maxdepth: 2
158170

171+
machine.rst
172+
uctypes.rst
159173
esp.rst
174+
175+
.. only:: port_openmvcam
176+
177+
Libraries specific to the OpenMV Cam
178+
------------------------------------
179+
180+
The following libraries are specific to the OpenMV Cam.
181+
182+
.. toctree::
183+
:maxdepth: 2
184+
185+
pyb.rst
186+
omv.time.rst
187+
omv.sensor.rst
188+
omv.image.rst
189+
omv.gif.rst
190+
omv.mjpeg.rst
191+
omv.lcd.rst
192+
omv.fir.rst

docs/library/machine.ADC.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Constructors
1919
Create an ADC object associated with the given pin.
2020
This allows you to then read analog values on that pin.
2121
For more info check the `pinout and alternate functions
22-
table. <https://raw.githubusercontent.com/wipy/wipy/master/docs/PinOUT.png>`_
22+
table. <https://raw.githubusercontent.com/wipy/wipy/master/docs/PinOUT.png>`_
2323

24-
.. warning::
24+
.. warning::
2525

26-
ADC pin input range is 0-1.4V (being 1.8V the absolute maximum that it
27-
can withstand). When GP2, GP3, GP4 or GP5 are remapped to the
28-
ADC block, 1.8 V is the maximum. If these pins are used in digital mode,
26+
ADC pin input range is 0-1.4V (being 1.8V the absolute maximum that it
27+
can withstand). When GP2, GP3, GP4 or GP5 are remapped to the
28+
ADC block, 1.8 V is the maximum. If these pins are used in digital mode,
2929
then the maximum allowed input is 3.6V.
3030

3131
Methods

docs/library/machine.I2C.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
class I2C -- a two-wire serial protocol
44
=======================================
55

6-
I2C is a two-wire protocol for communicating between devices. At the physical
6+
I2C is a two-wire protocol for communicating between devices. At the physical
77
level it consists of 2 wires: SCL and SDA, the clock and data lines respectively.
88

9-
I2C objects are created attached to a specific bus. They can be initialised
10-
when created, or initialised later on.
9+
I2C objects are created attached to a specific bus. They can be initialized
10+
when created, or initialized later on.
1111

1212
.. only:: port_wipy
1313

@@ -46,7 +46,7 @@ Constructors
4646

4747
.. class:: machine.I2C(bus, ...)
4848

49-
Construct an I2C object on the given bus. `bus` can only be 0.
49+
Construct an I2C object on the given bus. `bus` can only be 0.
5050
If the bus is not given, the default one will be selected (0).
5151

5252
.. only:: port_esp8266
@@ -63,7 +63,7 @@ General Methods
6363

6464
.. method:: i2c.init(mode, \*, baudrate=100000, pins=(SDA, SCL))
6565

66-
Initialise the I2C bus with the given parameters:
66+
Initialize the I2C bus with the given parameters:
6767

6868
- ``mode`` must be ``I2C.MASTER``
6969
- ``baudrate`` is the SCL clock rate
@@ -73,7 +73,7 @@ General Methods
7373

7474
.. method:: i2c.init(scl, sda, \*, freq=400000)
7575

76-
Initialise the I2C bus with the given arguments:
76+
Initialize the I2C bus with the given arguments:
7777

7878
- `scl` is a pin object for the SCL line
7979
- `sda` is a pin object for the SDA line
@@ -88,7 +88,7 @@ General Methods
8888
.. method:: i2c.scan()
8989

9090
Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of
91-
those that respond. A device responds if it pulls the SDA line low after
91+
those that respond. A device responds if it pulls the SDA line low after
9292
its address (including a read bit) is sent on the bus.
9393

9494
Note: on WiPy the I2C object must be in master mode for this method to be valid.
@@ -97,7 +97,7 @@ Primitive I2C operations
9797
------------------------
9898

9999
The following methods implement the primitive I2C master bus operations and can
100-
be combined to make any I2C transaction. They are provided if you need more
100+
be combined to make any I2C transaction. They are provided if you need more
101101
control over the bus, otherwise the standard methods (see below) can be used.
102102

103103
.. method:: i2c.start()
@@ -114,16 +114,16 @@ control over the bus, otherwise the standard methods (see below) can be used.
114114

115115
.. method:: i2c.readinto(buf)
116116

117-
Reads bytes from the bus and stores them into `buf`. The number of bytes
118-
read is the length of `buf`. An ACK will be sent on the bus after
117+
Reads bytes from the bus and stores them into `buf`. The number of bytes
118+
read is the length of `buf`. An ACK will be sent on the bus after
119119
receiving all but the last byte, and a NACK will be sent following the last
120120
byte.
121121

122122
Availability: ESP8266.
123123

124124
.. method:: i2c.write(buf)
125125

126-
Write all the bytes from `buf` to the bus. Checks that an ACK is received
126+
Write all the bytes from `buf` to the bus. Checks that an ACK is received
127127
after each byte and raises an OSError if not.
128128

129129
Availability: ESP8266.
@@ -144,62 +144,62 @@ operations that target a given slave device.
144144
Read into `buf` from the slave specified by `addr`.
145145
The number of bytes read will be the length of `buf`.
146146

147-
On WiPy the return value is the number of bytes read. Otherwise the
147+
On WiPy the return value is the number of bytes read. Otherwise the
148148
return value is `None`.
149149

150150
.. method:: i2c.writeto(addr, buf, \*, stop=True)
151151

152152
Write the bytes from `buf` to the slave specified by `addr`.
153153

154154
The `stop` argument (only available on WiPy) tells if a stop bit should be
155-
sent at the end of the transfer. If `False` the transfer should be
155+
sent at the end of the transfer. If `False` the transfer should be
156156
continued later on.
157157

158-
On WiPy the return value is the number of bytes written. Otherwise the
158+
On WiPy the return value is the number of bytes written. Otherwise the
159159
return value is `None`.
160160

161161
Memory operations
162162
-----------------
163163

164164
Some I2C devices act as a memory device (or set of registers) that can be read
165-
from and written to. In this case there are two addresses associated with an
166-
I2C transaction: the slave address and the memory address. The following
165+
from and written to. In this case there are two addresses associated with an
166+
I2C transaction: the slave address and the memory address. The following
167167
methods are convenience functions to communicate with such devices.
168168

169169
.. method:: i2c.readfrom_mem(addr, memaddr, nbytes, \*, addrsize=8)
170170

171171
Read `nbytes` from the slave specified by `addr` starting from the memory
172172
address specified by `memaddr`.
173173
The argument `addrsize` specifies the address size in bits (on ESP8266
174-
this argument is not recognised and the address size is always 8 bits).
174+
this argument is not recognized and the address size is always 8 bits).
175175
Returns a `bytes` object with the data read.
176176

177177
.. method:: i2c.readfrom_mem_into(addr, memaddr, buf, \*, addrsize=8)
178178

179179
Read into `buf` from the slave specified by `addr` starting from the
180-
memory address specified by `memaddr`. The number of bytes read is the
180+
memory address specified by `memaddr`. The number of bytes read is the
181181
length of `buf`.
182182
The argument `addrsize` specifies the address size in bits (on ESP8266
183-
this argument is not recognised and the address size is always 8 bits).
183+
this argument is not recognized and the address size is always 8 bits).
184184

185-
On WiPy the return value is the number of bytes read. Otherwise the
185+
On WiPy the return value is the number of bytes read. Otherwise the
186186
return value is `None`.
187187

188188
.. method:: i2c.writeto_mem(addr, memaddr, buf, \*, addrsize=8)
189189

190190
Write `buf` to the slave specified by `addr` starting from the
191191
memory address specified by `memaddr`.
192192
The argument `addrsize` specifies the address size in bits (on ESP8266
193-
this argument is not recognised and the address size is always 8 bits).
193+
this argument is not recognized and the address size is always 8 bits).
194194

195-
On WiPy the return value is the number of bytes written. Otherwise the
195+
On WiPy the return value is the number of bytes written. Otherwise the
196196
return value is `None`.
197197

198198
Constants
199199
---------
200200

201201
.. data:: I2C.MASTER
202202

203-
for initialising the bus to master mode
203+
for initializing the bus to master mode
204204

205205
Availability: WiPy.

0 commit comments

Comments
 (0)
0