summaryrefslogtreecommitdiff
path: root/docs/library
diff options
context:
space:
mode:
Diffstat (limited to 'docs/library')
-rw-r--r--docs/library/esp.rst2
-rw-r--r--docs/library/heapq.rst2
-rw-r--r--docs/library/lcd160cr.rst2
-rw-r--r--docs/library/machine.ADCWiPy.rst10
-rw-r--r--docs/library/machine.I2S.rst104
-rw-r--r--docs/library/machine.SD.rst2
-rw-r--r--docs/library/machine.SDCard.rst2
-rw-r--r--docs/library/machine.TimerWiPy.rst6
-rw-r--r--docs/library/machine.UART.rst2
-rw-r--r--docs/library/machine.WDT.rst2
-rw-r--r--docs/library/machine.rst2
-rw-r--r--docs/library/pyb.Pin.rst2
12 files changed, 69 insertions, 69 deletions
diff --git a/docs/library/esp.rst b/docs/library/esp.rst
index b9ae57bd9..5fb370065 100644
--- a/docs/library/esp.rst
+++ b/docs/library/esp.rst
@@ -4,7 +4,7 @@
.. module:: esp
:synopsis: functions related to the ESP8266 and ESP32
-The ``esp`` module contains specific functions related to both the ESP8266 and
+The ``esp`` module contains specific functions related to both the ESP8266 and
ESP32 modules. Some functions are only available on one or the other of these
ports.
diff --git a/docs/library/heapq.rst b/docs/library/heapq.rst
index 5e808d544..673871c5f 100644
--- a/docs/library/heapq.rst
+++ b/docs/library/heapq.rst
@@ -23,7 +23,7 @@ Functions
Pop the first item from the ``heap``, and return it. Raise ``IndexError`` if
``heap`` is empty.
-
+
The returned item will be the smallest item in the ``heap``.
.. function:: heapify(x)
diff --git a/docs/library/lcd160cr.rst b/docs/library/lcd160cr.rst
index 85e4b8f07..25903eb22 100644
--- a/docs/library/lcd160cr.rst
+++ b/docs/library/lcd160cr.rst
@@ -313,7 +313,7 @@ Advanced commands
specified by :meth:`LCD160CR.set_spi_win`, starting from the top-left corner.
The `framebuf <framebuf.html>`_ module can be used to construct frame buffers
- and provides drawing primitives. Using a frame buffer will improve
+ and provides drawing primitives. Using a frame buffer will improve
performance of animations when compared to drawing directly to the screen.
.. method:: LCD160CR.set_scroll(on)
diff --git a/docs/library/machine.ADCWiPy.rst b/docs/library/machine.ADCWiPy.rst
index e500d0089..d4ccde205 100644
--- a/docs/library/machine.ADCWiPy.rst
+++ b/docs/library/machine.ADCWiPy.rst
@@ -27,13 +27,13 @@ Constructors
Create an ADC object associated with the given pin.
This allows you to then read analog values on that pin.
For more info check the `pinout and alternate functions
- table. <https://raw.githubusercontent.com/wipy/wipy/master/docs/PinOUT.png>`_
+ table. <https://raw.githubusercontent.com/wipy/wipy/master/docs/PinOUT.png>`_
- .. warning::
+ .. warning::
- ADC pin input range is 0-1.4V (being 1.8V the absolute maximum that it
- can withstand). When GP2, GP3, GP4 or GP5 are remapped to the
- ADC block, 1.8 V is the maximum. If these pins are used in digital mode,
+ ADC pin input range is 0-1.4V (being 1.8V the absolute maximum that it
+ can withstand). When GP2, GP3, GP4 or GP5 are remapped to the
+ ADC block, 1.8 V is the maximum. If these pins are used in digital mode,
then the maximum allowed input is 3.6V.
Methods
diff --git a/docs/library/machine.I2S.rst b/docs/library/machine.I2S.rst
index d64fba33e..abfbb0878 100644
--- a/docs/library/machine.I2S.rst
+++ b/docs/library/machine.I2S.rst
@@ -4,91 +4,91 @@
class I2S -- Inter-IC Sound bus protocol
========================================
-I2S is a synchronous serial protocol used to connect digital audio devices.
+I2S is a synchronous serial protocol used to connect digital audio devices.
At the physical level, a bus consists of 3 lines: SCK, WS, SD.
The I2S class supports controller operation. Peripheral operation is not supported.
-The I2S class is currently available as a Technical Preview. During the preview period, feedback from
+The I2S class is currently available as a Technical Preview. During the preview period, feedback from
users is encouraged. Based on this feedback, the I2S class API and implementation may be changed.
I2S objects can be created and initialized using::
from machine import I2S
from machine import Pin
-
+
# ESP32
sck_pin = Pin(14) # Serial clock output
ws_pin = Pin(13) # Word clock output
sd_pin = Pin(12) # Serial data output
-
+
or
-
+
# PyBoards
sck_pin = Pin("Y6") # Serial clock output
ws_pin = Pin("Y5") # Word clock output
sd_pin = Pin("Y8") # Serial data output
-
- audio_out = I2S(2,
+
+ audio_out = I2S(2,
sck=sck_pin, ws=ws_pin, sd=sd_pin,
- mode=I2S.TX,
- bits=16,
+ mode=I2S.TX,
+ bits=16,
format=I2S.MONO,
- rate=44100,
+ rate=44100,
ibuf=20000)
-
- audio_in = I2S(2,
+
+ audio_in = I2S(2,
sck=sck_pin, ws=ws_pin, sd=sd_pin,
- mode=I2S.RX,
- bits=32,
+ mode=I2S.RX,
+ bits=32,
format=I2S.STEREO,
- rate=22050,
+ rate=22050,
ibuf=20000)
-
+
3 modes of operation are supported:
- - blocking
- - non-blocking
+ - blocking
+ - non-blocking
- uasyncio
-
+
blocking::
-
+
num_written = audio_out.write(buf) # blocks until buf emptied
num_read = audio_in.readinto(buf) # blocks until buf filled
-
+
non-blocking::
-
+
audio_out.irq(i2s_callback) # i2s_callback is called when buf is emptied
num_written = audio_out.write(buf) # returns immediately
-
+
audio_in.irq(i2s_callback) # i2s_callback is called when buf is filled
- num_read = audio_in.readinto(buf) # returns immediately
-
+ num_read = audio_in.readinto(buf) # returns immediately
+
uasyncio::
-
+
swriter = uasyncio.StreamWriter(audio_out)
swriter.write(buf)
await swriter.drain()
-
+
sreader = uasyncio.StreamReader(audio_in)
num_read = await sreader.readinto(buf)
-
+
Constructor
-----------
.. class:: I2S(id, *, sck, ws, sd, mode, bits, format, rate, ibuf)
Construct an I2S object of the given id:
-
- - ``id`` identifies a particular I2S bus.
+
+ - ``id`` identifies a particular I2S bus.
``id`` is board and port specific:
-
+
- PYBv1.0/v1.1: has one I2S bus with id=2.
- - PYBD-SFxW: has two I2S buses with id=1 and id=2.
- - ESP32: has two I2S buses with id=0 and id=1.
-
+ - PYBD-SFxW: has two I2S buses with id=1 and id=2.
+ - ESP32: has two I2S buses with id=0 and id=1.
+
Keyword-only parameters that are supported on all ports:
-
+
- ``sck`` is a pin object for the serial clock line
- ``ws`` is a pin object for the word select line
- ``sd`` is a pin object for the serial data line
@@ -97,9 +97,9 @@ Constructor
- ``format`` specifies channel format, STEREO or MONO
- ``rate`` specifies audio sampling rate (samples/s)
- ``ibuf`` specifies internal buffer length (bytes)
-
- For all ports, DMA runs continuously in the background and allows user applications to perform other operations while
- sample data is transfered between the internal buffer and the I2S peripheral unit.
+
+ For all ports, DMA runs continuously in the background and allows user applications to perform other operations while
+ sample data is transfered between the internal buffer and the I2S peripheral unit.
Increasing the size of the internal buffer has the potential to increase the time that user applications can perform non-I2S operations
before underflow (e.g. ``write`` method) or overflow (e.g. ``readinto`` method).
@@ -109,37 +109,37 @@ Methods
.. method:: I2S.init(sck, ...)
see Constructor for argument descriptions
-
+
.. method:: I2S.deinit()
Deinitialize the I2S bus
-
+
.. method:: I2S.readinto(buf)
- Read audio samples into the buffer specified by ``buf``. ``buf`` must support the buffer protocol, such as bytearray or array.
- "buf" byte ordering is little-endian. For Stereo format, left channel sample precedes right channel sample. For Mono format,
+ Read audio samples into the buffer specified by ``buf``. ``buf`` must support the buffer protocol, such as bytearray or array.
+ "buf" byte ordering is little-endian. For Stereo format, left channel sample precedes right channel sample. For Mono format,
the left channel sample data is used.
- Returns number of bytes read
-
+ Returns number of bytes read
+
.. method:: I2S.write(buf)
Write audio samples contained in ``buf``. ``buf`` must support the buffer protocol, such as bytearray or array.
- "buf" byte ordering is little-endian. For Stereo format, left channel sample precedes right channel sample. For Mono format,
+ "buf" byte ordering is little-endian. For Stereo format, left channel sample precedes right channel sample. For Mono format,
the sample data is written to both the right and left channels.
- Returns number of bytes written
-
+ Returns number of bytes written
+
.. method:: I2S.irq(handler)
- Set a callback. ``handler`` is called when ``buf`` is emptied (``write`` method) or becomes full (``readinto`` method).
+ Set a callback. ``handler`` is called when ``buf`` is emptied (``write`` method) or becomes full (``readinto`` method).
Setting a callback changes the ``write`` and ``readinto`` methods to non-blocking operation.
``handler`` is called in the context of the MicroPython scheduler.
-
+
.. staticmethod:: I2S.shift(*, buf, bits, shift)
- bitwise shift of all samples contained in ``buf``. ``bits`` specifies sample size in bits. ``shift`` specifies the number of bits to shift each sample.
- Positive for left shift, negative for right shift.
+ bitwise shift of all samples contained in ``buf``. ``bits`` specifies sample size in bits. ``shift`` specifies the number of bits to shift each sample.
+ Positive for left shift, negative for right shift.
Typically used for volume control. Each bit shift changes sample volume by 6dB.
-
+
Constants
---------
diff --git a/docs/library/machine.SD.rst b/docs/library/machine.SD.rst
index d985db231..c736dc4d2 100644
--- a/docs/library/machine.SD.rst
+++ b/docs/library/machine.SD.rst
@@ -32,7 +32,7 @@ Constructors
.. class:: SD(id,... )
- Create a SD card object. See ``init()`` for parameters if initialization.
+ Create a SD card object. See ``init()`` for parameters if initialization.
Methods
-------
diff --git a/docs/library/machine.SDCard.rst b/docs/library/machine.SDCard.rst
index 96fb5b01c..b07ad37d3 100644
--- a/docs/library/machine.SDCard.rst
+++ b/docs/library/machine.SDCard.rst
@@ -50,7 +50,7 @@ vary from platform to platform.
- *mosi* can be used to specify an SPI mosi pin.
- *cs* can be used to specify an SPI chip select pin.
-
+
- *freq* selects the SD/MMC interface frequency in Hz (only supported on the ESP32).
Implementation-specific details
diff --git a/docs/library/machine.TimerWiPy.rst b/docs/library/machine.TimerWiPy.rst
index 39afc23bc..f8c8bb29d 100644
--- a/docs/library/machine.TimerWiPy.rst
+++ b/docs/library/machine.TimerWiPy.rst
@@ -50,9 +50,9 @@ Methods
- ``mode`` can be one of:
- - ``TimerWiPy.ONE_SHOT`` - The timer runs once until the configured
+ - ``TimerWiPy.ONE_SHOT`` - The timer runs once until the configured
period of the channel expires.
- - ``TimerWiPy.PERIODIC`` - The timer runs periodically at the configured
+ - ``TimerWiPy.PERIODIC`` - The timer runs periodically at the configured
frequency of the channel.
- ``TimerWiPy.PWM`` - Output a PWM signal on a pin.
@@ -74,7 +74,7 @@ Methods
The operating mode is is the one configured to the Timer object that was used to
create the channel.
- - ``channel`` if the width of the timer is 16-bit, then must be either ``TIMER.A``, ``TIMER.B``.
+ - ``channel`` if the width of the timer is 16-bit, then must be either ``TIMER.A``, ``TIMER.B``.
If the width is 32-bit then it **must be** ``TIMER.A | TIMER.B``.
Keyword only arguments:
diff --git a/docs/library/machine.UART.rst b/docs/library/machine.UART.rst
index 2eb2e20cb..8fb42cfe8 100644
--- a/docs/library/machine.UART.rst
+++ b/docs/library/machine.UART.rst
@@ -64,7 +64,7 @@ Methods
- *timeout_char* specifies the time to wait between characters (in ms).
- *invert* specifies which lines to invert.
- *flow* specifies which hardware flow control signals to use. The value
- is a bitmask.
+ is a bitmask.
- ``0`` will ignore hardware flow control signals.
- ``UART.RTS`` will enable receive flow control by using the RTS output pin to
diff --git a/docs/library/machine.WDT.rst b/docs/library/machine.WDT.rst
index 612f23ba3..3c799583e 100644
--- a/docs/library/machine.WDT.rst
+++ b/docs/library/machine.WDT.rst
@@ -24,7 +24,7 @@ Constructors
Create a WDT object and start it. The timeout must be given in milliseconds.
Once it is running the timeout cannot be changed and the WDT cannot be stopped either.
-
+
Notes: On the esp32 the minimum timeout is 1 second. On the esp8266 a timeout
cannot be specified, it is determined by the underlying system.
diff --git a/docs/library/machine.rst b/docs/library/machine.rst
index c2a6b3900..5f45168ed 100644
--- a/docs/library/machine.rst
+++ b/docs/library/machine.rst
@@ -203,7 +203,7 @@ Classes
machine.UART.rst
machine.SPI.rst
machine.I2C.rst
- machine.I2S.rst
+ machine.I2S.rst
machine.RTC.rst
machine.Timer.rst
machine.WDT.rst
diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst
index 6465653f7..97dfbffbc 100644
--- a/docs/library/pyb.Pin.rst
+++ b/docs/library/pyb.Pin.rst
@@ -120,7 +120,7 @@ Methods
- *value* if not None will set the port output value before enabling the pin.
- *alt* can be used when mode is ``Pin.AF_PP`` or ``Pin.AF_OD`` to set the
- index or name of one of the alternate functions associated with a pin.
+ index or name of one of the alternate functions associated with a pin.
This arg was previously called *af* which can still be used if needed.
Returns: ``None``.