Skip to content

Commit 67c851b

Browse files
authored
Merge branch 'm5stack:develop' into develop
2 parents d08a966 + 427ee9b commit 67c851b

File tree

167 files changed

+16728
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+16728
-58
lines changed

docs/en/hardware/imu.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,19 @@ device. Below is the detailed IMU support for the host:
3636
.. |S| unicode:: U+2714
3737

3838

39-
Micropython Example::
39+
Micropython Example:
4040

41-
pass
41+
.. literalinclude:: ../../../examples/hardware/imu/imu_cores3_example.py
42+
:language: python
43+
:linenos:
4244

45+
UIFLOW2 Example:
4346

44-
UIFLOW2 Example::
47+
|example.png|
4548

46-
pass
49+
.. only:: builder_html
50+
51+
|imu_cores3_example.m5f2|
4752

4853

4954
class IMU

docs/en/hardware/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Hardware
77
button.rst
88
can.rst
99
imu.rst
10+
ir.rst
1011
mic.rst
12+
pin.rst
1113
rotary.rst
1214
speaker.rst

docs/en/hardware/ir.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
IR
2+
===
3+
4+
.. include:: ../refs/hardware.ir.ref
5+
6+
IR is used to control the infrared receiving/transmitting tube built into the host device.
7+
8+
The specific support of the host for IR is as follows:
9+
10+
.. table::
11+
:widths: auto
12+
:align: center
13+
14+
+-------------------+-----------------+-------------+
15+
| Controller | IR Transmitter | IR Receiver |
16+
+===================+=================+=============+
17+
| Atom Lite | |S| | |
18+
+-------------------+-----------------+-------------+
19+
| Atom Matrix | |S| | |
20+
+-------------------+-----------------+-------------+
21+
| Atom U | |S| | |
22+
+-------------------+-----------------+-------------+
23+
| AtomS3 Lite | |S| | |
24+
+-------------------+-----------------+-------------+
25+
| AtomS3U | |S| | |
26+
+-------------------+-----------------+-------------+
27+
| M5StickC | |S| | |
28+
+-------------------+-----------------+-------------+
29+
| M5StickC PLUS | |S| | |
30+
+-------------------+-----------------+-------------+
31+
| M5StickC PLUS2 | |S| | |
32+
+-------------------+-----------------+-------------+
33+
| Cardputer | |S| | |
34+
+-------------------+-----------------+-------------+
35+
| M5Capsule | |S| | |
36+
+-------------------+-----------------+-------------+
37+
38+
.. |S| unicode:: U+2714
39+
40+
Micropython Example:
41+
42+
.. literalinclude:: ../../../examples/hardware/ir/ir_stickcplus2_example.py
43+
:language: python
44+
:linenos:
45+
46+
UIFLOW2 Example:
47+
48+
|example.png|
49+
50+
51+
.. only:: builder_html
52+
53+
|ir_stickcplus2_example.m5f2|
54+
55+
.. only:: builder_html
56+
57+
class IR
58+
--------
59+
60+
Constructors
61+
------------
62+
63+
.. class:: IR()
64+
65+
Initializes the IR unit with the appropriate pins based on the M5Stack board type.
66+
67+
68+
UIFLOW2:
69+
70+
|init.png|
71+
72+
73+
Methods
74+
-------
75+
76+
.. method:: IR.tx(cmd, data)
77+
78+
Transmits an IR signal with the specified command and data using the NEC protocol.
79+
80+
:param cmd: The command code to be transmitted.
81+
:param data: The data associated with the command.
82+
83+
UIFLOW2:
84+
85+
|tx.png|

docs/en/hardware/pin.rst

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
Pin
2+
===
3+
4+
.. include:: ../refs/hardware.pin.ref
5+
6+
The Pin class is used to manage GPIO operations. Below is the detailed support for the Pin class:
7+
8+
Micropython Example:
9+
10+
.. literalinclude:: ../../../examples/hardware/pin/pin_cores3_example.py
11+
:language: python
12+
:linenos:
13+
14+
UIFLOW2 Example:
15+
16+
|example.png|
17+
18+
.. only:: builder_html
19+
20+
|pin_cores3_example.m5f2|
21+
22+
class Pin
23+
---------
24+
25+
Constructors
26+
------------
27+
28+
.. class:: Pin(id, mode=-1, pull=-1)
29+
30+
Access the pin peripheral (GPIO pin) associated with the given ``id``.
31+
32+
:param int id: is mandatory and can be an arbitrary object.
33+
:param int mode: specifies the pin mode.
34+
35+
- ``Pin.IN`` - Pin is configured for input. If viewed as an output the pin is in high-impedance state.
36+
37+
- ``Pin.OUT`` - Pin is configured for (normal) output.
38+
39+
:param int pull: specifies if the pin has a (weak) pull resistor attached.
40+
41+
- ``None`` - No pull up or down resistor.
42+
- ``Pin.PULL_UP`` - Pull up resistor enabled.
43+
- ``Pin.PULL_DOWN`` - Pull down resistor enabled.
44+
45+
UIFLOW2:
46+
47+
|init.png|
48+
49+
Methods
50+
--------
51+
.. method:: Pin.value([value])
52+
53+
Set the value of the pin.
54+
55+
The argument ``value`` can be anything that converts to a boolean.
56+
If it converts to ``True``, the pin is set to state '1', otherwise it is set
57+
to state '0'.
58+
59+
The behaviour of this method depends on the mode of the pin:
60+
61+
- ``Pin.IN`` - The value is stored in the output buffer for the pin. The
62+
pin state does not change, it remains in the high-impedance state. The
63+
stored value will become active on the pin as soon as it is changed to
64+
``Pin.OUT`` mode.
65+
- ``Pin.OUT`` - The output buffer is set to the given value immediately.
66+
67+
UIFLOW2:
68+
69+
|set_value.png|
70+
71+
|set_value1.png|
72+
73+
|get_value.png|
74+
75+
76+
77+
.. method:: Pin.off() -> None
78+
79+
Sets the pin to low level.
80+
81+
UIFLOW2:
82+
83+
|off.png|
84+
85+
.. method:: Pin.on() -> None
86+
87+
Sets the pin to high level.
88+
89+
UIFLOW2:
90+
91+
|on.png|
92+
93+
Constants
94+
---------
95+
96+
.. data:: Pin.IN
97+
98+
Input mode
99+
100+
.. data:: Pin.OUT
101+
102+
Output mode
103+
104+
.. data:: Pin.PULL_UP
105+
106+
Pull-up resistor
107+
108+
.. data:: Pin.PULL_DOWN
109+
110+
Pull-down resistor

docs/en/module/hmi.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
HMI Module
3-
=========
3+
==========
44

55
.. include:: ../refs/module.hmi.ref
66

@@ -143,7 +143,6 @@ Methods
143143

144144
Reset the rotary value.
145145

146-
147146
UIFLOW2:
148147

149148
|reset_rotary_value.png|

docs/en/module/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Module
1111
plus.rst
1212
pps.rst
1313
rca.rst
14+
rs232.rst

docs/en/module/plus.rst

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
PLUS Module
3-
=========
3+
============
44

55
.. include:: ../refs/module.plus.ref
66

@@ -74,7 +74,7 @@ UIFLOW2 Example:
7474
|plus_core2_example.m5f2|
7575

7676
class PLUSModule
77-
---------------
77+
-----------------
7878

7979
Constructors
8080
------------
@@ -120,16 +120,6 @@ Methods
120120

121121
|reset_rotary_value.png|
122122

123-
.. method:: PLUSModule.set_rotary_value(value)
124-
125-
Set the rotary value.
126-
127-
:param int value: rotary value.
128-
129-
UIFLOW2:
130-
131-
|set_rotary_value.png|
132-
133123
.. method:: PLUSModule.get_rotary_increments() -> int
134124

135125
Get the increments of the rotary value since the last call of this function.
@@ -140,7 +130,7 @@ Methods
140130

141131
|get_rotary_increments.png|
142132

143-
.. method:: HMIModule.get_button_status() -> int
133+
.. method:: PLUSModule.get_button_status() -> int
144134

145135
Get the state of a specific button.
146136

0 commit comments

Comments
 (0)