Created
April 26, 2024 00:41
-
-
Save Steve-Tech/376e9ab634248056bfd50dfed9b13e1c to your computer and use it in GitHub Desktop.
Read a CrOS fan speed using the memmap, for Framework Laptops (AMD, but could be adjusted for other laptops)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires portio and usually root access | |
# If you're using a venv, run it something like `sudo .venv/bin/python ec-lpc-memmap.py` | |
import portio | |
EC_LPC_ADDR_MEMMAP = 0xE00 # will be 0x900 on most other models | |
EC_MEMMAP_SIZE = 255 | |
EC_MEMMAP_FAN = 0x10 | |
if portio.ioperm(EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE, True): | |
print("Permission denied. Try running as root.") | |
exit(1) | |
print(portio.inw(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_FAN)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment