Skip to content

Commit 7f8c8a0

Browse files
committed
lib/base: Add RS232 and RS485 example.
Signed-off-by: Tinyu-Zhao <[email protected]>
1 parent 7cda50a commit 7f8c8a0

File tree

10 files changed

+347
-313
lines changed

10 files changed

+347
-313
lines changed

docs/en/base/rs232.rst

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,16 @@ Support the following products:
1818
UiFlow2 Example
1919
---------------
2020

21-
TX Example
22-
^^^^^^^^^^
21+
RS232 Example
22+
^^^^^^^^^^^^^
2323

24-
Open the |core_rs232_tx_example.m5f2| project in UiFlow2.
24+
Open the |atoms3r_rs232_example.m5f2| project in UiFlow2.
2525

26-
This example demonstrates how to send data using the RS232 module via the UART interface.
26+
This example demonstrates how to send and receive data using the RS232 module via the UART interface.
2727

2828
UiFlow2 Code Block:
2929

30-
|tx_example.png|
31-
32-
Example output:
33-
34-
None
35-
36-
RX Example
37-
^^^^^^^^^^
38-
39-
Open the |cores3_rs232_rx_example.m5f2| project in UiFlow2.
40-
41-
This example demonstrates how to receive data using the RS232 module via the UART interface.
42-
43-
UiFlow2 Code Block:
44-
45-
|rx_example.png|
30+
|example.png|
4631

4732
Example output:
4833

@@ -51,29 +36,14 @@ Example output:
5136
MicroPython Example
5237
-------------------
5338

54-
TX Example
55-
^^^^^^^^^^
56-
57-
This example demonstrates how to send data using the RS232 module via the UART interface.
58-
59-
MicroPython Code Block:
60-
61-
.. literalinclude:: ../../../examples/module/rs232/core_rs232_tx_example.py
62-
:language: python
63-
:linenos:
64-
65-
Example output:
66-
67-
None
68-
69-
RX Example
70-
^^^^^^^^^^
39+
RS232 Example
40+
^^^^^^^^^^^^^
7141

72-
This example demonstrates how to receive data using the RS232 module via the UART interface.
42+
This example demonstrates how to send and receive data using the RS232 module via the UART interface.
7343

7444
MicroPython Code Block:
7545

76-
.. literalinclude:: ../../../examples/module/rs232/cores3_rs232_rx_example.py
46+
.. literalinclude:: ../../../examples/base/rs232/atoms3r_rs232_example.py
7747
:language: python
7848
:linenos:
7949

docs/en/base/rs485.rst

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,16 @@ Support the following products:
1818
UiFlow2 Example
1919
---------------
2020

21-
TX Example
22-
^^^^^^^^^^
21+
RS485 Example
22+
^^^^^^^^^^^^^^
2323

24-
Open the |core_rs232_tx_example.m5f2| project in UiFlow2.
24+
Open the |atoms3r_rs485_example.m5f2| project in UiFlow2.
2525

26-
This example demonstrates how to send data using the RS232 module via the UART interface(same as RS485).
26+
This example demonstrates how to send and receive data using the RS485 module via the UART interface.
2727

2828
UiFlow2 Code Block:
2929

30-
|tx_example.png|
31-
32-
Example output:
33-
34-
None
35-
36-
RX Example
37-
^^^^^^^^^^
38-
39-
Open the |cores3_rs232_rx_example.m5f2| project in UiFlow2.
40-
41-
This example demonstrates how to receive data using the RS232 module via the UART interface(same as RS485).
42-
43-
UiFlow2 Code Block:
44-
45-
|rx_example.png|
30+
|example.png|
4631

4732
Example output:
4833

@@ -51,29 +36,14 @@ Example output:
5136
MicroPython Example
5237
-------------------
5338

54-
TX Example
55-
^^^^^^^^^^
56-
57-
This example demonstrates how to send data using the RS232 module via the UART interface(same as RS485).
58-
59-
MicroPython Code Block:
60-
61-
.. literalinclude:: ../../../examples/module/rs232/core_rs232_tx_example.py
62-
:language: python
63-
:linenos:
64-
65-
Example output:
66-
67-
None
68-
69-
RX Example
70-
^^^^^^^^^^
39+
RS485 Example
40+
^^^^^^^^^^^^^^
7141

72-
This example demonstrates how to receive data using the RS232 module via the UART interface(same as RS485).
42+
This example demonstrates how to send and receive data using the RS485 module via the UART interface.
7343

7444
MicroPython Code Block:
7545

76-
.. literalinclude:: ../../../examples/module/rs232/cores3_rs232_rx_example.py
46+
.. literalinclude:: ../../../examples/base/rs485/atoms3r_rs485_example.py
7747
:language: python
7848
:linenos:
7949

docs/en/refs/base.rs232.ref

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,13 @@
2727
.. |flush.png| image:: https://static-cdn.m5stack.com/mpy_docs/base/rs232/flush.png
2828
.. |sendbreak.png| image:: https://static-cdn.m5stack.com/mpy_docs/base/rs232/sendbreak.png
2929

30-
.. |tx_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/rs232/tx_example.png
30+
.. |example.png| image:: https://static-cdn.m5stack.com/mpy_docs/base/rs232/example.png
3131

32-
.. |core_rs232_tx_example.m5f2| raw:: html
32+
.. |atoms3r_rs232_example.m5f2| raw:: html
3333

3434
<a
35-
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/module/rs232/core_rs232_tx_example.m5f2"
35+
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/base/rs232/atoms3r_rs232_example.m5f2"
3636
target="_blank"
3737
>
38-
core_rs232_tx_example.m5f2
39-
</a>
40-
41-
.. |rx_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/rs232/rx_example.png
42-
43-
.. |cores3_rs232_rx_example.m5f2| raw:: html
44-
45-
<a
46-
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/module/rs232/cores3_rs232_rx_example.m5f2"
47-
target="_blank"
48-
>
49-
cores3_rs232_rx_example.m5f2
50-
</a>
38+
atoms3r_rs232_example.m5f2
39+
</a>

docs/en/refs/base.rs485.ref

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,14 @@
2727
.. |flush.png| image:: https://static-cdn.m5stack.com/mpy_docs/base/rs485/flush.png
2828
.. |sendbreak.png| image:: https://static-cdn.m5stack.com/mpy_docs/base/rs485/sendbreak.png
2929

30-
.. |tx_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/rs232/tx_example.png
3130

32-
.. |core_rs232_tx_example.m5f2| raw:: html
31+
.. |example.png| image:: https://static-cdn.m5stack.com/mpy_docs/base/rs485/example.png
3332

34-
<a
35-
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/module/rs232/core_rs232_tx_example.m5f2"
36-
target="_blank"
37-
>
38-
core_rs232_tx_example.m5f2
39-
</a>
40-
41-
.. |rx_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/rs232/rx_example.png
42-
43-
.. |cores3_rs232_rx_example.m5f2| raw:: html
33+
.. |atoms3r_rs485_example.m5f2| raw:: html
4434

4535
<a
46-
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/module/rs232/cores3_rs232_rx_example.m5f2"
36+
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/base/rs485/atoms3r_rs485_example.m5f2"
4737
target="_blank"
4838
>
49-
cores3_rs232_rx_example.m5f2
50-
</a>
39+
atoms3r_rs485_example.m5f2
40+
</a>

0 commit comments

Comments
 (0)