/* * Copyright (c) Souldbminer and Horizon OC Contributors * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /* -------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * , , * wrote this file. As long as you retain this notice you can do whatever you * want with this stuff. If you meet any of us some day, and you think this * stuff is worth it, you can buy us a beer in return. - The sys-clk authors * -------------------------------------------------------------------------- */ #pragma once #include #include #include typedef enum { SysClkSocType_Erista = 0, SysClkSocType_Mariko, SysClkSocType_MarikoLite, SysClkSocType_EnumMax } SysClkSocType; typedef enum { SysClkProfile_Handheld = 0, SysClkProfile_HandheldCharging, SysClkProfile_HandheldChargingUSB, SysClkProfile_HandheldChargingOfficial, SysClkProfile_Docked, SysClkProfile_EnumMax } SysClkProfile; typedef enum { SysClkModule_CPU = 0, SysClkModule_GPU, SysClkModule_MEM, SysClkModule_EnumMax, } SysClkModule; typedef enum { SysClkThermalSensor_SOC = 0, SysClkThermalSensor_PCB, SysClkThermalSensor_Skin, SysClkThermalSensor_EnumMax } SysClkThermalSensor; typedef enum { SysClkPowerSensor_Now = 0, SysClkPowerSensor_Avg, SysClkPowerSensor_EnumMax } SysClkPowerSensor; typedef enum { SysClkRamLoad_All = 0, SysClkRamLoad_Cpu, SysClkRamLoad_EnumMax } SysClkRamLoad; typedef enum { ReverseNX_NotFound = 0, ReverseNX_SystemDefault = 0, ReverseNX_Handheld, ReverseNX_Docked, } ReverseNXMode; #define SYSCLK_ENUM_VALID(n, v) ((v) < n##_EnumMax) static inline const char* sysclkFormatModule(SysClkModule module, bool pretty) { switch(module) { case SysClkModule_CPU: return pretty ? "CPU" : "cpu"; case SysClkModule_GPU: return pretty ? "GPU" : "gpu"; case SysClkModule_MEM: return pretty ? "Memory" : "mem"; default: return NULL; } } static inline const char* sysclkFormatThermalSensor(SysClkThermalSensor thermSensor, bool pretty) { switch(thermSensor) { case SysClkThermalSensor_SOC: return pretty ? "SOC" : "soc"; case SysClkThermalSensor_PCB: return pretty ? "PCB" : "pcb"; case SysClkThermalSensor_Skin: return pretty ? "Skin" : "skin"; default: return NULL; } } static inline const char* sysclkFormatPowerSensor(SysClkPowerSensor powSensor, bool pretty) { switch(powSensor) { case SysClkPowerSensor_Now: return pretty ? "Now" : "now"; case SysClkPowerSensor_Avg: return pretty ? "Avg" : "avg"; default: return NULL; } } static inline const char* sysclkFormatProfile(SysClkProfile profile, bool pretty) { switch(profile) { case SysClkProfile_Docked: return pretty ? "Docked" : "docked"; case SysClkProfile_Handheld: return pretty ? "Handheld" : "handheld"; case SysClkProfile_HandheldCharging: return pretty ? "Charging" : "handheld_charging"; case SysClkProfile_HandheldChargingUSB: return pretty ? "USB Charger" : "handheld_charging_usb"; case SysClkProfile_HandheldChargingOfficial: return pretty ? "PD Charger" : "handheld_charging_official"; default: return NULL; } }