/*
 * @file exo_ahw_al_thruster_common.c
 *
 * @brief This file checks state of the 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 <stdlib.h>
#include "exo_ahw_al_thruster_common.h"
#include "exo_ahw_al_multifeep_thruster_wrapper.h"
#include "exo_ah_iob_csn.h"
#include "exo_ahdlsd.h"
#include "exo_osal_mem_management.h"
#include "logger.h"
#include "exo_common.h"
#include "err_handler.h"

extern void* ahw_inst_hdle_ptr[MAX_AH_INST_ID];
ahw_al_thruster_hdle* morpheus_thruster;

/**
 * @brief Initializes the thruster
 */
hal_ret_sts ahw_al_thruster_init()
{
#ifdef LINUX_TEMP_PORT
	DEBUG_CPRINT(("\n EXO AH-AL thruster Initialise"));
#endif
	hal_ret_sts sts;
	morpheus_thruster =(ahw_al_thruster_hdle*)os_malloc(sizeof(ahw_al_thruster_hdle));
	morpheus_thruster->ahw_gen_info.ahw_inst_id = THRUSTER_MORPHEUS_OBC;
	if(HAL_SCS == ahw_al_common_thruster_init(morpheus_thruster))
	{
		ahw_inst_hdle_ptr[THRUSTER_MORPHEUS_OBC] = morpheus_thruster;
		sts = HAL_SCS;
    	log_id(LOG_INFO_L1,LOG_AHW,AHW_AL_THRUSTER_INIT_SCS);
		if(HAL_SCS != ahdlsd_updt_ah_state(THRUSTER_MORPHEUS_OBC, AH_ACTIVATED))
		{
			sts = HAL_AHDLSD_FW_ERR;
		}
		if(HAL_SCS != ahiobcsn_updt_ahste(&morpheus_thruster->ahw_gen_info, AH_FREE_STATE))
		{
			sts = HAL_AHIOBCSN_FW_ERR;
		}
	}
	else
	{
		sts = HAL_AH_INIT_ERR;
    	log_id(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_INIT_ERR);
		if(HAL_SCS != ahdlsd_updt_ah_state(THRUSTER_MORPHEUS_OBC, AH_ERROR))
		{
			sts = HAL_AHDLSD_FW_ERR;
		}
	}
#ifdef LINUX_TEMP_PORT
DEBUG_CPRINT(("\n EXO AH-AL thruster Initialisation completed successfully"));
#endif
return sts;

}

#ifndef LINUX_TEMP_PORT
/*!
 *  @brief This API is used to set the force
 */
hal_ret_sts ahw_al_thruster_unit_set_frc(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,float force)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_unit_set_frc(h_thruster,system_id,force))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_UNIT_SET_FRC_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to reset the thruster
 */
hal_ret_sts ahw_al_thruster_reset(ahw_al_thruster_hdle *h_thruster)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_reset(h_thruster))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_RESET_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to boot the thruster
 */
hal_ret_sts ahw_al_thruster_boot(ahw_al_thruster_hdle *h_thruster)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_boot(h_thruster))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_BOOT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to set to on or off state
 */
hal_ret_sts ahw_al_thruster_unit_set_pwr_on_off(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t on_off)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_unit_set_pwr_on_off(h_thruster,system_id,on_off))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_UNIT_SET_PWR_ON_OFF_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to set the device  mode of the thruster
 */
hal_ret_sts ahw_al_thruster_unit_set_mode(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t mode)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_unit_set_mode(h_thruster,system_id,mode))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_UNIT_SET_MODE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to set the mode of system
 */
hal_ret_sts ahw_al_thruster_set_mode(ahw_al_thruster_hdle *h_thruster,uint8_t system_id)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_set_mode(h_thruster,system_id))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_SET_MODE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the mode of the system
 */
hal_ret_sts ahw_al_thruster_get_mode(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *mode)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_mode(h_thruster,system_id,mode))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_MODE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the device mode of the thruster
 */
hal_ret_sts ahw_al_thruster_unit_get_mode(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *mode)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_unit_get_mode(h_thruster,system_id,mode))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_UNIT_GET_MODE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the status
 */
hal_ret_sts ahw_al_thruster_get_sys_sts(ahw_al_thruster_hdle *h_thruster, uint8_t system_id,al_thruster_sts *info)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_sys_sts(h_thruster,system_id,info))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_SYS_STS_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the serial number
 */
hal_ret_sts ahw_al_thruster_get_sys_srl_num(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *srl_num)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_sys_srl_num(h_thruster,system_id,srl_num))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_SYS_SRL_NUM_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the housekeeping1 data
 */
hal_ret_sts ahw_al_thruster_get_housekeeping1_data(ahw_al_thruster_hdle *h_thruster,al_thruster_housekeeping1 *info)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_housekeeping1_data(h_thruster,info))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HOUSEKEEPING1_DATA_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the housekeeping2 data
 */
hal_ret_sts ahw_al_thruster_get_housekeeping2_data(ahw_al_thruster_hdle *h_thruster,al_thruster_housekeeping2 *info,uint8_t system_id)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_housekeeping2_data(h_thruster,info,system_id))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HOUSEKEEPING2_DATA_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the housekeeping3 data
 */
hal_ret_sts ahw_al_thruster_get_housekeeping3_data(ahw_al_thruster_hdle *h_thruster,uint8_t *housekeeping3)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_housekeeping3_data(h_thruster,housekeeping3))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HOUSEKEEPING3_DATA_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the power status of the system
 */
hal_ret_sts ahw_al_thruster_unit_get_pwr_on_off(ahw_al_thruster_hdle *h_thruster,uint8_t *on_off,uint8_t system_id)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_unit_get_pwr_on_off(h_thruster,on_off,system_id))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_UNIT_GET_PWR_ON_OFF_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the force
 */
hal_ret_sts ahw_al_thruster_unit_get_frc(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *frc)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_unit_get_frc(h_thruster,system_id,frc))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_UNIT_GET_FRC_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the master time from housekeeping1 data
 */
hal_ret_sts ahw_al_thruster_get_mst_time(ahw_al_thruster_hdle *h_thruster,uint32_t *mst_tm)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_mst_time(h_thruster,mst_tm))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_MST_TIME_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the backplane temperature
 */
hal_ret_sts ahw_al_thruster_get_bckplane_temp(ahw_al_thruster_hdle *h_thruster,uint8_t* bckpln_temp)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_bckplane_temp(h_thruster,bckpln_temp))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_BCKPLANE_TEMP_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the total force of backplane
 */
hal_ret_sts ahw_al_thruster_get_bckplane_tot_frc(ahw_al_thruster_hdle *h_thruster,uint16_t* bckpln_frc)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_bckplane_tot_frc(h_thruster,bckpln_frc))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_BCKPLANE_TOT_FRC_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the total azimuthal angle
 */
hal_ret_sts ahw_al_thruster_get_tot_azimth_ang(ahw_al_thruster_hdle *h_thruster,uint16_t* tot_azmth)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_tot_azimth_ang(h_thruster,tot_azmth))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_TOT_AZIMTH_ANG_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the total polar angle
 */
hal_ret_sts ahw_al_thruster_get_tot_polar_ang(ahw_al_thruster_hdle *h_thruster,uint8_t *tot_plr)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_tot_polar_ang(h_thruster,tot_plr))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_TOT_POLAR_ANG_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the total power consumption
 */
hal_ret_sts ahw_al_thruster_get_tot_pwr_cnsp(ahw_al_thruster_hdle *h_thruster,uint16_t *pwr_cnsp)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_tot_pwr_cnsp(h_thruster,pwr_cnsp))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_TOT_PWR_CNSP_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get unregulated voltage
 */
hal_ret_sts ahw_al_thruster_get_unreg_vol(ahw_al_thruster_hdle *h_thruster,uint8_t *unreg_vol)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unreg_vol(h_thruster,unreg_vol))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNREG_VOL_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the remaining propellant
 */
hal_ret_sts ahw_al_thruster_get_remn_prplt(ahw_al_thruster_hdle *h_thruster,uint16_t *prplt)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_remn_prplt(h_thruster,prplt))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_REMN_PRPLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the polar angle of the system
 */
hal_ret_sts ahw_al_thruster_get_unit_polar_ang(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *polar)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unit_polar_ang(h_thruster,system_id,polar))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNIT_POLAR_ANG_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the azimuthal angle of the system
 */
hal_ret_sts ahw_al_thruster_get_unit_azimth_ang(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *azimuthal)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
    	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unit_azimth_ang(h_thruster,system_id,azimuthal))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNIT_AZIMTH_ANG_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the power-consumption of the system
 */
hal_ret_sts ahw_al_thruster_get_unit_pwr(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *power)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unit_pwr(h_thruster,system_id,power))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNIT_PWR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the reset status
 */
hal_ret_sts ahw_al_thruster_get_rst_sts(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *rst_sts)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_rst_sts(h_thruster,system_id,rst_sts))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_RST_STS_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the total power
 */
hal_ret_sts ahw_al_thruster_get_tot_pwr(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *pwr)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_tot_pwr(h_thruster,system_id,pwr))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_TOT_PWR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the unregulated Voltage
 */
hal_ret_sts ahw_al_thruster_get_unreg_volt(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *unreg_vol)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unreg_volt(h_thruster,system_id,unreg_vol))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNREG_VOLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the ON status of the device
 */
hal_ret_sts ahw_al_thruster_get_dev_on_sts(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *dev_sts)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_dev_on_sts(h_thruster,system_id,dev_sts))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_DEV_ON_STS_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the reset status
 */
hal_ret_sts ahw_al_thruster_get_unit_rst_sts(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *rst_sts)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unit_rst_sts(h_thruster,system_id,rst_sts))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNIT_RST_STS_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the board temperature
 */
hal_ret_sts ahw_al_thruster_get_brd_temp(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *temp)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_brd_temp(h_thruster,system_id,temp))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_BRD_TEMP_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the remaining propellant
 */
hal_ret_sts ahw_al_thruster_get_unit_prplt(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *prplt)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_unit_prplt(h_thruster,system_id,prplt))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UNIT_PRPLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the Unregulated Voltage
 */
hal_ret_sts ahw_al_thruster_get_ureg_volt(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *unreg_vol)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_ureg_volt(h_thruster,system_id,unreg_vol))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_UREG_VOLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the calibration values
 */
hal_ret_sts ahw_al_thruster_get_calib(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint32_t *calib)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_calib(h_thruster,system_id,calib))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_CALIB_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the heater error code
 */
hal_ret_sts ahw_al_thruster_get_heat_err_code(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *err_cde)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_heat_err_code(h_thruster,system_id,err_cde))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HEAT_ERR_CODE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the duty cycle of the heater
 */
hal_ret_sts ahw_al_thruster_get_heat_duty_cycle(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *duty_cycle)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_heat_duty_cycle(h_thruster,system_id,duty_cycle))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HEAT_DUTY_CYCLE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the temperature of heater
 */
hal_ret_sts ahw_al_thruster_get_heat_temp(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,int8_t *temp)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_heat_temp(h_thruster,system_id,temp))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HEAT_TEMP_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the target temperature of heater
 */
hal_ret_sts ahw_al_thruster_get_heat_trg_temp(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,int8_t *trgt_temp)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thuster_get_heat_trgt_temp(h_thruster,system_id,trgt_temp))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_HEAT_TRG_TEMP_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the emitter voltage
 */
hal_ret_sts ahw_al_thruster_get_emit_volt(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *emt_vol)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_emit_volt(h_thruster,system_id,emt_vol))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_EMIT_VOLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the emitter current
 */
hal_ret_sts ahw_al_thruster_get_emit_cur(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *emt_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_emit_cur(h_thruster,system_id,emt_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_EMIT_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the emitter current
 */
hal_ret_sts ahw_al_thruster_get_emit_inp_cur(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *emt_ip_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_emit_inp_cur(h_thruster,system_id,emt_ip_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_EMIT_INP_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the extractor voltage
 */
hal_ret_sts ahw_al_thruster_get_ext_volt(ahw_al_thruster_hdle *h_thruster,uint8_t ext_id,uint8_t system_id,uint16_t *ext_vol)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_ext_volt(h_thruster,ext_id,system_id,ext_vol))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_EXT_VOLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the extractor currentr
 */
hal_ret_sts ahw_al_thruster_get_ext_cur(ahw_al_thruster_hdle *h_thruster,uint8_t ext_id,uint8_t system_id,uint16_t *ext_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_ext_cur(h_thruster,ext_id,system_id,ext_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_EXT_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the extractor input current
 */
hal_ret_sts ahw_al_thruster_get_ext_inp_cur(ahw_al_thruster_hdle *h_thruster,uint8_t ext_id,uint8_t system_id,uint16_t *ext_ip_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_ext_inp_cur(h_thruster,ext_id,system_id,ext_ip_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_EXT_INP_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the neutralizer voltage
 */
hal_ret_sts ahw_al_thruster_get_neutlr_volt(ahw_al_thruster_hdle *h_thruster,uint8_t neut_id,uint8_t system_id,uint16_t *neut_vol)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_neutlr_volt(h_thruster,neut_id,system_id,neut_vol))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_NEUTLR_VOLT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the neutralizer current
 */
hal_ret_sts ahw_al_thruster_get_neutlr_cur(ahw_al_thruster_hdle *h_thruster,uint8_t neut_id,uint8_t system_id,uint16_t *neut_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_neutlr_cur(h_thruster,neut_id,system_id,neut_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_NEUTLR_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the neutralizer input current
 */
hal_ret_sts ahw_al_thruster_get_neutlr_inp_cur(ahw_al_thruster_hdle *h_thruster,uint8_t neut_id,uint8_t system_id,uint16_t *neut_ip_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_neutlr_inp_cur(h_thruster,neut_id,system_id,neut_ip_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_NEUTLR_INP_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the return neutralizer current
 */
hal_ret_sts ahw_al_thruster_get_neutlr_retn_cur(ahw_al_thruster_hdle *h_thruster,uint8_t neut_id,uint8_t system_id,uint16_t *neut_ret_cur)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_neutlr_retn_cur(h_thruster,neut_id,system_id,neut_ret_cur))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_NEUTLR_RETN_CUR_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the major version number
 */
hal_ret_sts ahw_al_thruster_get_mjr_vers_no(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *mjr_vers_no)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_mjr_vers_no(h_thruster,system_id,mjr_vers_no))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_MJR_VERS_NO_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the minor version number
 */
hal_ret_sts ahw_al_thruster_get_mnr_vers_no(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *mnr_vers_no)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}


		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_mnr_vers_no(h_thruster,system_id,mnr_vers_no))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_MNR_VERS_NO_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the patch version number
 */
hal_ret_sts ahw_al_thruster_get_patch_vers_no(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint16_t *ptch_vers_no)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_patch_vers_no(h_thruster,system_id,ptch_vers_no))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_PATCH_VERS_NO_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the board error code
 */
hal_ret_sts ahw_al_thruster_get_brd_err_cde(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *err_cde)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_brd_err_cde(h_thruster,system_id,err_cde))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_BRD_ERR_CDE_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the error counter
 */
hal_ret_sts ahw_al_thruster_get_err_count(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint8_t *err_count)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_err_count(h_thruster,system_id,err_count))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_ERR_COUNT_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}

/*!
 *  @brief This API is used to get the start time
 */
hal_ret_sts ahw_al_thruster_get_strt_time(ahw_al_thruster_hdle *h_thruster,uint8_t system_id,uint32_t *strt_time)
{
	hal_ret_sts sts;
	sts = ahiobcsn_check_ste(&h_thruster->ahw_gen_info);
	if(HAL_SCS == sts)
	{
	  	sts = err_get_fault_status(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
		if(sts != 0)
		{
			return HAL_AH_DRIVER_ERR;
		}

		ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_BUSY_STATE);
		if(HAL_SCS == ahw_al_common_thruster_get_strt_time(h_thruster,system_id,strt_time))
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
			sts = HAL_SCS;
		}
		else
		{
			ahiobcsn_updt_ahste(&h_thruster->ahw_gen_info, AH_FREE_STATE);
            err_detected(ERR_GROUP_AHW_SET_1, ERR_THRUSTER_MORPHEUS_OBC);
			sts = HAL_AH_DRIVER_ERR;
            log_id_with_one_arg(LOG_ERROR,LOG_AHW,AHW_AL_THRUSTER_GET_STRT_TIME_ERR_INST_ID__eq__u8_,THRUSTER_MORPHEUS_OBC);
		}
	}
	else
	{
	}
	return sts;
}
#endif
