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

extern ahw_al_vsm_hdle *hvsm_obc;
vltg_seq_rail_cfg rail_info;
os_timer_handle_ptr vsm_polling_tmr;
extern os_queue_handle_ptr sensor_polling_q;

//static int i = 0;

/**
 * @brief Application API to get the voltage with the given instance id
 */
void vsm_get_func(vsm_get_info_s *vsm_param,uint8_t vsm_inst_id)
{
	if(vsm_inst_id == VOLTAGE_SEQUENCER_UCD9801_OBC)
	{
		ahw_al_vsm_get_voltage(vsm_inst_id,&rail_info,&vsm_param->voltage);
		vsm_param->rail_no = rail_info.rail_nu;
	}
	else
	{
		DEBUG_CPRINT(("Invalid ID"));
	}
}

