Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
0bfc5702
Commit
0bfc5702
authored
May 13, 2015
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
docs: Document USB_VCP file-like methods.
parent
1511dd4f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/library/pyb.USB_VCP.rst
+34
-3
34 additions, 3 deletions
docs/library/pyb.USB_VCP.rst
with
34 additions
and
3 deletions
docs/library/pyb.USB_VCP.rst
+
34
−
3
View file @
0bfc5702
...
@@ -36,15 +36,49 @@ Methods
...
@@ -36,15 +36,49 @@ Methods
.. method:: usb_vcp.close()
.. method:: usb_vcp.close()
This method does nothing. It exists so the USB_VCP object can act as
a file.
.. method:: usb_vcp.read([nbytes])
.. method:: usb_vcp.read([nbytes])
Read at most ``nbytes`` from the serial device and return them as a
bytes object. If ``nbytes`` is not specified then the method acts as
``readall()``.
.. method:: usb_vcp.readall()
.. method:: usb_vcp.readall()
Read all available bytes from the serial device and return them as
a bytes object.
.. method:: usb_vcp.readinto(buf, [maxlen])
Read bytes from the serial device and store them into ``buf``, which
should be a buffer-like object. At most ``len(buf)`` bytes are read.
If ``maxlen`` is given and then at most ``min(maxlen, len(buf))`` bytes
are read.
Returns the number of bytes read and stored into ``buf``.
.. method:: usb_vcp.readline()
.. method:: usb_vcp.readline()
Read a whole line from the serial device.
Returns a bytes object containing the data, including the trailing
newline character.
.. method:: usb_vcp.readlines()
Read as much data as possible from the serial device, breaking it into
lines.
Returns a list of bytes objects, each object being one of the lines.
Each line will include the newline character.
.. method:: usb_vcp.write(buf)
Write the bytes from ``buf`` to the serial device.
Returns the number of bytes written.
.. method:: usb_vcp.recv(data, \*, timeout=5000)
.. method:: usb_vcp.recv(data, \*, timeout=5000)
...
@@ -65,6 +99,3 @@ Methods
...
@@ -65,6 +99,3 @@ Methods
- ``timeout`` is the timeout in milliseconds to wait for the send.
- ``timeout`` is the timeout in milliseconds to wait for the send.
Return value: number of bytes sent.
Return value: number of bytes sent.
.. method:: usb_vcp.write(buf)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment