Skip to content

Commit 553c8cf

Browse files
committed
Fix and improved in documentation
1 parent 4448f25 commit 553c8cf

File tree

6 files changed

+27
-19
lines changed

6 files changed

+27
-19
lines changed

axp192.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class AXP192:
9797
should expose a property to control the DCDC3 brightness
9898
9999
:param ~busio.I2C i2c: The I2C bus AXP192 is connected to
100-
:param int device_address: The I2C bus addres. Default to `0x34`
100+
:param int device_address: The I2C bus addres. Default to 0x34
101101
102102
**Quickstart: Importing and using the device**
103103
@@ -286,15 +286,15 @@ def all_adc_enabled(self, enable: bool) -> None:
286286

287287
@property
288288
def internal_temperature(self) -> float:
289-
"""Internal AXP192 temperature in Celsius degree"""
289+
"""Internal AXP192 temperature in Celsius degrees"""
290290
return -144.7 + 0.1 * self._read_register12(0x5E)
291291

292292
@property
293293
def power_key_was_pressed(self) -> Tuple[bool, bool]:
294294
"""Power key pressed status
295295
296296
:returns: Two booleans: Power key is short press and power key is long press
297-
_rtype: tuple(bool, bool)
297+
:rtype: tuple(bool, bool)
298298
"""
299299
reg_val = self._read_register8(_AXP192_IRQ_3_STATUS)
300300
short_press = (reg_val & _AXP192_IRQ_3_STATUS_PEK_SHORT_PRESS) != 0

docs/examples.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
Simple test
22
------------
33

4-
Ensure your device works with this simple test.
4+
Ensure your device works with this simple test, it show the battery voltage
5+
if a battery is connected to AXP192
56

67
.. literalinclude:: ../examples/axp192_simpletest.py
78
:caption: examples/axp192_simpletest.py
89
:linenos:
10+
11+
Power key pressed test
12+
----------------------
13+
14+
Simple test to show how to read the power key button status
15+
16+
.. literalinclude:: ../examples/axp192_power_key_press.py
17+
:caption: examples/axp192_power_key_press.py
18+
:linenos:
19+
20+
Extending AXP192 library
21+
------------------------
22+
23+
A more complex example that show how to extend the AXP192 library. This example extend
24+
the AXP192 library and create a :py:class:`PMIC` for the `M5Stack Core2 <https://docs.m5stack.com/en/core/core2>`_
25+
26+
.. literalinclude:: ../examples/axp192_m5stack_core2_pmic.py
27+
:caption: examples/axp192_m5stack_core2_pmic.py
28+
:linenos:

docs/index.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ Table of Contents
2121

2222
api
2323

24-
.. toctree::
25-
:caption: Tutorials
26-
27-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
28-
the toctree above for use later.
29-
30-
.. toctree::
31-
:caption: Related Products
32-
33-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
34-
the toctree above for use later.
35-
3624
.. toctree::
3725
:caption: Other Links
3826

examples/axp192_m5stack_core2_pmic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2023 Dario Cammi
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

55
import time
66
import board

examples/axp192_power_key_press.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2023 Dario Cammi
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

55
import time
66
import board

examples/axp192_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2023 Dario Cammi
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

55
import time
66
import board

0 commit comments

Comments
 (0)