diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-10-31 01:37:19 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-10-31 01:37:19 +0000 |
| commit | 88d3054ac072f9c73b0f3f045c59ba74f6730c1d (patch) | |
| tree | 6db7851068908c0640b1ed306d6823871fd3d742 /docs/tutorial/pass_through.rst | |
| parent | 7c4445afe104631d5fe8e7401d50f40f205e35b9 (diff) | |
docs: Import documentation from source-code inline comments.
The inline docs (prefixed with /// in .c files) have been converted to
RST format and put in the docs subdirectory.
Diffstat (limited to 'docs/tutorial/pass_through.rst')
| -rw-r--r-- | docs/tutorial/pass_through.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/tutorial/pass_through.rst b/docs/tutorial/pass_through.rst new file mode 100644 index 000000000..309ef58e7 --- /dev/null +++ b/docs/tutorial/pass_through.rst @@ -0,0 +1,17 @@ +Making a UART - USB pass through +================================ + +It's as simple as:: + + import pyb + import select + + def pass_through(usb, uart): + 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)) |
