/*
 * @file mcp9843_intf.c
 *
 * @brief This file contains structures,function prototype to read and
 * store the data from temperature sensor
 *
 * @copyright Copyright 2023 Antaris, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "mcp9843_intf.h"

os_timer_handle_ptr temp_polling_tmr;
extern os_queue_handle_ptr sensor_polling_q;

extern ahw_al_temp_sensor_hdl ahw_ts_obc;
extern ahw_al_temp_sensor_hdl ahw_ts_ps;
extern ahw_al_temp_sensor_hdl ahw_ts_edge;
extern ahw_al_temp_sensor_hdl ahw_ts_gps;

/**
 * @brief Application API to get the temperature with the given instance id
 */
void temp_get_func(float *temp_param,uint8 temp_inst_id)
{
	switch(temp_inst_id)
	{
	case TEMP_SENSOR_MCP9843_OBC:
	{
		ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
	}
	break;

	case TEMP_SENSOR_MCP9843_PS:
	{
		ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
	}
	break;

	case TEMP_SENSOR_MCP9843_EDGE:
	{
		ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
	}
	break;

	case TEMP_SENSOR_MCP9843_GPS:
	{
		ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
	}
	break;

/******* GEN 2 ********/
	case TEMP_SENSOR_MCP9843_EDGE_1:
	{
		ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
	}
	break;

	case TEMP_SENSOR_MCP9843_EDGE_2:
	{
		ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
	}
	break;

	case TEMP_SENSOR_MCP9843_PS_GEN_2:
		{
			ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
		}
		break;

	case TEMP_SENSOR_MCP9843_NIC_1:
		{
			ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
		}
		break;

	case TEMP_SENSOR_MCP9843_SSD_1:
		{
			ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
		}
		break;

	case TEMP_SENSOR_MCP9843_SSD_2:
		{
			ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
		}
		break;

	case TEMP_SENSOR_MCP9843_SSD_3:
		{
			ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
		}
		break;

	case TEMP_SENSOR_MCP9843_SSD_4:
		{
			ahw_al_temp_sensor_gettemperature(temp_inst_id,temp_param);
		}
		break;

	default:
		DEBUG_CPRINT(("Invalid ID"));
		break;
	}

}
