diff options
| author | Daniel Campora | 2015-05-27 13:59:59 +0200 |
|---|---|---|
| committer | Damien George | 2015-06-04 23:44:35 +0100 |
| commit | 7ca1bd314bd5e3146f8c868f91af54d17dd04d45 (patch) | |
| tree | c30c7ccb9a8437a9e69f2716f196b87f27beca5d /docs/pyboard/tutorial/pass_through.rst | |
| parent | 031278f661e5d285c56359e355a96161bf6e1a9f (diff) | |
docs: Generate a separate docs build for each port.
Using Damien's approach where conf.py and topindex.html are
shared by all ports.
Diffstat (limited to 'docs/pyboard/tutorial/pass_through.rst')
| -rw-r--r-- | docs/pyboard/tutorial/pass_through.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/pyboard/tutorial/pass_through.rst b/docs/pyboard/tutorial/pass_through.rst new file mode 100644 index 000000000..a94e7363d --- /dev/null +++ b/docs/pyboard/tutorial/pass_through.rst @@ -0,0 +1,18 @@ +Making a UART - USB pass through +================================ + +It's as simple as:: + + import pyb + import select + + def pass_through(usb, uart): + usb.setinterrupt(-1) + while True: + select.select([usb, uart], [], []) + if usb.any(): + uart.write(usb.read(256)) + if uart.any(): + usb.write(uart.read(256)) + + pass_through(pyb.USB_VCP(), pyb.UART(1, 9600)) |
