/* * Copyright (c) 2018-2020 Atmosphère-NX * * 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 . */ #pragma once #include #include #include namespace ams::powctl { /* Battery API. */ Result GetBatterySocRep(float *out_percent, Session &session); Result GetBatterySocVf(float *out_percent, Session &session); Result GetBatteryFullCapacity(u32 *out_mah, Session &session); Result GetBatteryRemainingCapacity(u32 *out_mah, Session &session); Result SetBatteryPercentageMinimumAlertThreshold(Session &session, float percentage); Result SetBatteryPercentageMaximumAlertThreshold(Session &session, float percentage); Result SetBatteryPercentageFullThreshold(Session &session, float percentage); Result GetBatteryAverageCurrent(u32 *out_ma, Session &session); Result GetBatteryCurrent(u32 *out_ma, Session &session); Result GetBatteryInternalState(void *dst, size_t *out_size, Session &session, size_t dst_size); Result SetBatteryInternalState(Session &session, const void *src, size_t src_size); Result GetBatteryNeedToRestoreParameters(bool *out, Session &session); Result SetBatteryNeedToRestoreParameters(Session &session, bool en); Result IsBatteryI2cShutdownEnabled(bool *out, Session &session); Result SetBatteryI2cShutdownEnabled(Session &session, bool en); Result IsBatteryRemoved(bool *out, Session &session); Result GetBatteryCycles(u32 *out, Session &session); Result SetBatteryCycles(Session &session, u32 cycles); Result GetBatteryAge(float *out_percent, Session &session); Result GetBatteryTemperature(float *out_c, Session &session); Result GetBatteryMaximumTemperature(float *out_c, Session &session); Result SetBatteryTemperatureMinimumAlertThreshold(Session &session, float c); Result SetBatteryTemperatureMaximumAlertThreshold(Session &session, float c); Result GetBatteryVCell(u32 *out_mv, Session &session); Result GetBatteryAverageVCell(u32 *out_mv, Session &session); Result GetBatteryAverageVCellTime(TimeSpan *out, Session &session); Result GetBatteryOpenCircuitVoltage(u32 *out_mv, Session &session); Result SetBatteryVoltageMinimumAlertThreshold(Session &session, u32 mv); Result SetBatteryVoltageMaximumAlertThreshold(Session &session, u32 mv); }