/*
 * @file ds620_interface.c
 *
 * @brief This file contains function definition to read and
 * store the data from digital thermostat
 *
 * @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 "ds620_interface.h"

os_timer_handle_ptr dt_polling_tmr;

extern os_queue_handle_ptr sensor_polling_q;
extern ahw_al_dt_hdle hdt_ps;
extern ahw_al_dt_hdle hdt_edge;

/**
 * @brief Application API to read the temperature with given instance id
 */
void dt_get_func(double *dt_param,uint8 dt_inst_id)
{
    if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_EDGE)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_PS)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_SPE01)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_SPE02)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_SPW01)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_SPW02)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else if(dt_inst_id == DIGITAL_THERMOSTAT_DS620_SPB01)
    {
        ahw_al_dt_get_temperature(dt_inst_id, dt_param);
    }
    else
    {
        DEBUG_CPRINT(("Invalid ID"));
    }
}

