Skip to content

Commit 6fe3042

Browse files
Tinyu-Zhaolbuque
authored andcommitted
lib/module: Add Module FAN support.
Signed-off-by: Tinyu-Zhao <[email protected]>
1 parent 4e45758 commit 6fe3042

File tree

10 files changed

+800
-1
lines changed

10 files changed

+800
-1
lines changed

docs/en/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,20 @@
4646
]
4747

4848
autodoc_mock_imports = [
49-
"micropython"
49+
"micropython",
50+
"machine",
51+
"M5",
52+
"module.mbus",
53+
"pid",
54+
"driver",
55+
"imu"
56+
5057
]
5158

5259
autodoc_default_options = {
5360
'members': "",
5461
'show-inheritance': "",
62+
'members-order': 'bysource',
5563
}
5664

5765
autodoc_typehints = "description"

docs/en/module/fan.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Fan v1.1 Module
2+
================
3+
4+
.. sku: M013-V11
5+
6+
.. include:: ../refs/module.fan.ref
7+
8+
This is the driver library of Fan Module, which is used to control the fan.
9+
10+
Support the following products:
11+
12+
|FAN|
13+
14+
15+
UiFlow2 Example
16+
---------------
17+
18+
control module fan v1.1
19+
^^^^^^^^^^^^^^^^^^^^^^^
20+
21+
Open the |fan_cores3_example.m5f2| project in UiFlow2.
22+
23+
Initializes the fan module, sets the fan status, PWM frequency and duty cycle, and displays the fan status, speed, PWM frequency and duty cycle on the screen in real time. When the user touches the screen, the fan status toggles on/off.
24+
25+
UiFlow2 Code Block:
26+
27+
|example.png|
28+
29+
Example output:
30+
31+
None
32+
33+
MicroPython Example
34+
-------------------
35+
36+
control module fan v1.1
37+
^^^^^^^^^^^^^^^^^^^^^^^
38+
39+
Initializes the fan module, sets the fan status, PWM frequency and duty cycle, and displays the fan status, speed, PWM frequency and duty cycle on the screen in real time. When the user touches the screen, the fan status toggles on/off.
40+
41+
MicroPython Code Block:
42+
43+
.. literalinclude:: ../../../examples/module/fan/fan_cores3_example.py
44+
:language: python
45+
:linenos:
46+
47+
Example output:
48+
49+
None
50+
51+
52+
**API**
53+
-------
54+
55+
FanModule
56+
^^^^^^^^^
57+
58+
.. autoclass:: module.fan.FanModule
59+
:members:
60+
:member-order: bysource

docs/en/module/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Module
99
display.rst
1010
dmx.rst
1111
dualkmeter.rst
12+
fan.rst
1213
gnss.rst
1314
gps.rst
1415
gpsv2.rst

docs/en/refs/module.fan.ref

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. |FAN| image:: https://static-cdn.m5stack.com/resource/docs/products/module/fan/fan_01.webp
2+
:target: https://docs.m5stack.com/en/module/fan_v11
3+
:height: 200px
4+
:width: 200px
5+
.. |example.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/example.png
6+
.. |init.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/init.png
7+
8+
.. |set_fan_state.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/set_fan_state.png
9+
.. |get_fan_state.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_fan_state.png
10+
.. |set_pwm_frequency.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/set_pwm_frequency.png
11+
.. |get_pwm_frequency.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_pwm_frequency.png
12+
.. |set_pwm_duty_cycle.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/set_pwm_duty_cycle.png
13+
.. |get_pwm_duty_cycle.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_pwm_duty_cycle.png
14+
.. |get_fan_rpm.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_fan_rpm.png
15+
.. |get_single_frequency.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_single_frequency.png
16+
.. |write_flash.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/write_flash.png
17+
.. |get_firmware_version.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_firmware_version.png
18+
.. |get_i2c_address.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/get_i2c_address.png
19+
.. |set_i2c_address.png| image:: https://static-cdn.m5stack.com/mpy_docs/module/fan_v11/set_i2c_address.png
20+
21+
22+
.. |fan_cores3_example.m5f2| raw:: html
23+
24+
<a
25+
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/module/fan_v11/fan_cores3_example.m5f2"
26+
target="_blank"
27+
>
28+
fan_cores3_example.m5f2
29+
</a>

0 commit comments

Comments
 (0)