/*1* SOC/PCB Temperature driver for Nintendo Switch's TI TMP4512*3* Copyright (c) 2018 CTCaer4*5* This program is free software; you can redistribute it and/or modify it6* under the terms and conditions of the GNU General Public License,7* version 2, as published by the Free Software Foundation.8*9* This program is distributed in the hope it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for12* more details.13*14* You should have received a copy of the GNU General Public License15* along with this program. If not, see <http://www.gnu.org/licenses/>.16*/1718#ifndef __TMP451_H_19#define __TMP451_H_2021#include <utils/types.h>2223#define TMP451_I2C_ADDR 0x4C2425#define TMP451_PCB_TEMP_REG 0x0026#define TMP451_SOC_TEMP_REG 0x012728#define TMP451_CONFIG_REG 0x0929#define TMP451_CNV_RATE_REG 0x0A3031#define TMP451_SOC_TMP_DEC_REG 0x1032#define TMP451_PCB_TMP_DEC_REG 0x153334#define TMP451_SOC_TMP_OFH_REG 0x1135#define TMP451_SOC_TMP_OFL_REG 0x123637// If input is false, the return value is packed. MSByte is the integer in oC38// and the LSByte is the decimal point truncated to 2 decimal places.39// Otherwise it's an integer oC.40u16 tmp451_get_soc_temp(bool integer);41u16 tmp451_get_pcb_temp(bool integer);42void tmp451_init();43void tmp451_end();4445#endif /* __TMP451_H_ */464748