#ifndef BOARD_SENSORS_H
#define BOARD_SENSORS_H

#include <stdio.h>

#define MAX_SENSOR_NAME_LENGTH 256

struct hwmon_sensor {
	char *driver_name;				/* Contents of /sys/class/hwmon/hwmonX/name */
	char *sensor_file_name;			/* Sysfs file to read */
	char *name_prefix;				/* Prefix to attach to temp*_label for clarity */
	char *short_name;				/* 'Category' name when using compact mode */
	char *units;					/* Units string */
	float divisor;					/* Divisor to convert temp* to units */
	float bad_value;	/* Raw value that indicates a bad (missing) sensor TODO: verfiy most of these*/
};

/* Note the order here matters, it's the order these will be printed in */
static struct hwmon_sensor hwmon_sensor_info[] = 
{
	{"zenpower",	"temp1",	"CPU ",			"CPU",	"°C",	1000.0,	-40.0},	/* Tdie */
	{"asusec",		"temp2",	"Motherboard ",	"CPU",	"°C",	1000.0,	-40.0},	/* CPU */
	{"zenpower",	"temp3",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd1 */
	{"zenpower",	"temp4",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd2 */
	{"zenpower",	"temp5",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd3 */
	{"zenpower",	"temp6",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd4 */
	{"zenpower",	"temp7",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd5 */
	{"zenpower",	"temp8",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd6 */
	{"zenpower",	"temp9",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd7 */
	{"zenpower",	"temp10",	"CPU ",			"CCD",	"°C",	1000.0,	-40.0},	/* Tccd8 */
	{"zen-rapl",	"",			"CPU ",			"POW",	" W",	0.0,	0.0},	/* Zen RAPL placeholder */
	{"asusec",		"temp1",	"Motherboard ",	"CHIP",	"°C",	1000.0,	-40.0},	/* Chipset */
	{"asusec",		"temp5",	"Motherboard ",	"VRM",	"°C",	1000.0,	-40.0},	/* VRM */
	{"asusec",		"temp3",	"",				"MOBO",	"°C",	1000.0,	-40.0},	/* Motherboard */
	{"asusec",		"temp4",	"Motherboard ",	"SENS",	"°C",	1000.0,	-40.0},	/* T_Sensor */
	{"asusec",		"temp6",	"Motherboard ",	"H2O",	"°C",	1000.0,	-40.0},	/* Water_In */
	{"asusec",		"temp7",	"Motherboard ",	"H2O",	"°C",	1000.0,	-40.0},	/* Water_Out */
	{"nvme",		"temp1",	"NVMe ",		"NVME",	"°C",	1000.0,	-40.0},	/* NVME Composite */
};

struct hwmon_avail_sensor {
	char *sensor_name;					/* Sensor name as read from the sysfs file */
	int sort_index;						/* Sort index for order to display in */
	char *file;							/* File to read from */
	struct hwmon_sensor *sensor_info;	/* Associated sensor info struct */
};

int find_board_sensors(struct hwmon_avail_sensor *board_sensors, int max_sensors);
int get_sensor_reading(struct hwmon_avail_sensor *sensor, float *reading);

#endif