<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[My Tab5 Extended GPIO and Power management library.]]></title><description><![CDATA[<p dir="auto">Hi all;</p>
<p dir="auto">This is something I've been working on; a easy way of taking control of the Tab5's power management circuitry from <strong>vanilla</strong> MicroPython; <em>without needing a special board build</em>.</p>
<p dir="auto"><a href="https://codeberg.org/easytarget/tab5-egpio-micropython" target="_blank" rel="noopener noreferrer nofollow ugc">https://codeberg.org/easytarget/tab5-egpio-micropython</a></p>
<p dir="auto">The <a href="https://codeberg.org/easytarget/tab5-egpio-micropython#readme" target="_blank" rel="noopener noreferrer nofollow ugc">README</a> there has the full install and usage notes; plus a list of the (30!) methods it provides. This is deigned to be very simple in use; it is self-contained and lets you:</p>
<ul>
<li>Control power on/off for the WiFi chip, Speaker Amplifier, USB-A port and Expansion port 5V power.</li>
<li>Switch WiFi between internal and external antennas</li>
<li>Enable and disable battery charging, set the quick charge status, read the charge indicator pin.</li>
<li>Read the battery voltage and current in/out.</li>
<li>Detect if headphones are plugged in.</li>
<li>Set LCD backlight brightness</li>
<li>Trigger a poweroff event.</li>
<li>Send reset signals to the LCD, TouchPanel and Camera modules.</li>
</ul>
<p dir="auto">Use it to create a power control object and set the device up as you need:</p>
<pre><code class="language-python">from tab5_egpio import TAB5_EGPIO

tab5pwr = TAB5_EGPIO()
tab5pwr.wlan_pwr_on()
tab5pwr.charge_enable()

# later (let the charge controller settle first)
voltage, current = tab5pwr.battery_status()
print('Battery: {:.2f}V @ {:.3f}A'.format(voltage, current))
</code></pre>
<p dir="auto">There are some demo's in the repo that show how to use this in more detail. And I have a page where I am documenting general hardware related Tab5 micropython information at: <a href="https://codeberg.org/easytarget/m5-tab5-micropython" target="_blank" rel="noopener noreferrer nofollow ugc">https://codeberg.org/easytarget/m5-tab5-micropython</a></p>
<p dir="auto">[note: I'm cross-posting this here from the micropython official discussions, since it is specific to the Tab5]</p>
]]></description><link>https://community.m5stack.com/topic/7990/my-tab5-extended-gpio-and-power-management-library</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 16:17:43 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7990.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Jan 2026 14:27:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to My Tab5 Extended GPIO and Power management library. on Tue, 13 Jan 2026 20:02:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a><br />
Thank you! you are quite right! I hadn't really looked at what was happening properly :-(</p>
<p dir="auto">The pin needs to be toggled <code>high</code> then <code>low</code> with a ~50ms delay for a full power off, just toggling it <code>high</code> does a full reset (after 1 second). I really wish there was a state diagram (or similar) available for the code in the <code>PMS150G</code> power control MCU.</p>
<p dir="auto">I've extended my code to do the required pulse similar to your modification, and added a <code>reset_device()</code> method too. Plus relevant notes in the README etc, and done a new release.</p>
<p dir="auto">[testing shows that the poweroff happens immediately after the first pulse, I'm not sure why they attempt to pulse several times but I guess they are just making sure.. ;-)]</p>
]]></description><link>https://community.m5stack.com/post/30452</link><guid isPermaLink="true">https://community.m5stack.com/post/30452</guid><dc:creator><![CDATA[easytarget]]></dc:creator><pubDate>Tue, 13 Jan 2026 20:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to My Tab5 Extended GPIO and Power management library. on Fri, 09 Jan 2026 02:59:43 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/easytarget" aria-label="Profile: easytarget">@<bdi>easytarget</bdi></a></p>
<p dir="auto">for me your current implementation to turn off M5Tab5 actually only does a reset.</p>
<p dir="auto">The power off pulse needs to pulse to turn off M5Tab5. See <a href="https://github.com/m5stack/M5Unified/blob/master/src/utility/Power_Class.cpp#L930" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">I modified <code>poweroff_now</code> function in your library like below:</p>
<pre><code>def poweroff_now(self):
        """Instant full power off. Be sure you want to use this!"""
#        self._e2.set_output(_PWROFF_PULSE_PIN, HIGH)
        for x in range(10):
            self._e2.set_output(_PWROFF_PULSE_PIN, LOW)
            sleep(0.05)
            self._e2.set_output(_PWROFF_PULSE_PIN, HIGH)
            sleep(0.05)
</code></pre>
<p dir="auto">and now my M5Tab5 turns off.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/30424</link><guid isPermaLink="true">https://community.m5stack.com/post/30424</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 09 Jan 2026 02:59:43 GMT</pubDate></item></channel></rss>