/*
 * morpheus_multifeep_thruster.h
 *
 * @brief This file contains declaration of API's,enumerations,structures
 *  macros of multifeep thruster
 *
 *	@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.
 */

#ifndef DRIVERS_AHW_DRIVERS_MORPHEUS_THRUSTER_SENSOR_MORPHEUS_MULTIFEEP_INC_MORPHEUS_THRUSTER_H_
#define DRIVERS_AHW_DRIVERS_MORPHEUS_THRUSTER_SENSOR_MORPHEUS_MULTIFEEP_INC_MORPHEUS_THRUSTER_H_

#include <stdio.h>
#include <string.h>
#include <stdint.h>

#include "exo_common.h"

#define MULTIFEEP_START			 			0xB0			///< ID of the start byte
#define MULTIFEEP_STOP  					0x0D			///< ID of the stop byte
#define MULTIFEEP_ALL   					0x0F			///< ID of the all byte
#define MULTIFEEP_BACKPLANE 				        0xB0			///< ID of the backplane byte
#define MULTIFEEP_UNIT1  					0x01			///< ID of the unit1 byte
#define MULTIFEEP_UNIT2  					0x02			///< ID of the unit2 byte
#define MULTIFEEP_UNIT3  					0x03			///< ID of the unit3 byte
#define MULTIFEEP_UNIT4 					0x04			///< ID of the unit4 byte

#define MULTIFEEP_BOARD  					0x5A			///< ID of the board byte
#define MULTIFEEP_THRUSTER1 				        0x31			///< ID of the thruster1 byte
#define MULTIFEEP_HEATER1  					0x44			///< ID of the heater1 byte

#define MULTIFEEP_ON  						0x68			///< ID of the ON byte
#define MULTIFEEP_OFF 						0x6C			///< ID of the OFF byte
#define MULTIFEEP_HOUSEKEEPING1  			        0x54			///< ID of the housekeeping1 byte
#define MULTIFEEP_HOUSEKEEPING2  		 	        0x55			///< ID of the housekeeping2 byte
#define MULTIFEEP_HOUSEKEEPING3  			        0x56			///< ID of the housekeeping3 byte
#define MULTIFEEP_FORCE  					0x66			///< ID of the force byte
#define MULTIFEEP_SERIAL_NUMBER  			        0xFF			///< ID of the serial number byte
#define MULTIFEEP_BOOT  					0xE7			///< ID of the boot byte
#define MULTIFEEP_RST  						0xE1			///< ID of the reset byte
#define MULTIFEEP_STATUS  					0x53			///< ID of the status byte
#define MULTIFEEP_MODE  					0x4D			///< ID of the mode byte

#define MULTIFEEP_GET 						0x3F			///< ID of the get byte
#define MULTIFEEP_SET 						0x21			///< ID of the set byte

#define MULTIFEEP_RST_PASS 					0x12345678		///< ID of the reset password
#define MULTIFEEP_BOOT_PASS 				        0xDEADFEE6		///< ID of the boot password
#define MULTIFEEP_ON_PASS 					0x02			///< ID of the on password
#define MULTIFEEP_OFF_PASS 					0x01			///< ID of the off password

#define MULTIFEEP_MODE1 					0x01			///< ID of the mode1
#define MULTIFEEP_MODE2 					0x02			///< ID of the mode2
#define MULTIFEEP_MODE3 					0x03			///< ID of the mode3
#define MULTIFEEP_MODE4 					0x04			///< ID of the mode4
#define MULTIFEEP_MODE5 					0x05			///< ID of the mode5
#define MULTIFEEP_BUSY  					0x06			///< ID of the busy mode
#define MULTIFEEP_BURST 					0x07			///< ID of the burst mode
#define MULTIFEEP_CALIBRATION 				        0x08			///< ID of the calibration mode
#define MULTIFEEP_COOLING 					0x09			///< ID of the cooling mode

#define MORP_THRUST_CMD_LEN					11								///< length of the dataframe
#define RCV_HOUSEKEEPING1_LEN				        36								///< length of the housekeeping1 response
#define RCV_DATA_FRAME_128BYTE  			        128								///< length of the housekeeping data frame
#define RCV_HOUSEKEEPING2_LEN				RCV_DATA_FRAME_128BYTE			///< length of the housekeeping2 response
#define RCV_HOUSEKEEPING3_LEN				RCV_DATA_FRAME_128BYTE			///< length of the housekeeping2 response
#define RCV_SRL_NUM_LEN						68								///< length of the serial number response
#define RCV_STS_LEN						20								///< length of the status response
#define NEUT_ID				    			1								///< ID of the neutralizer
#define RCV_DATA_FRAME_8BYTE			                8
#define RCV_MODE_LEN						RCV_DATA_FRAME_8BYTE
#define RCV_PWR_STE_LEN						RCV_DATA_FRAME_8BYTE
#define RCV_FRC_LEN						RCV_DATA_FRAME_8BYTE

/**
 * @brief  Transmit API function pointer
 */
typedef int8_t (*multifeep_transmit_fptr)(void* intf_hdl,uint16_t slv_addr,uint8_t* data ,uint8_t len);

/**
 * @brief  Receive API function pointer
 */
typedef int8_t (*multifeep_recieve_fptr)(void* intf_hdl, uint16_t slv_addr,uint8_t *arr ,uint8_t len);

/**
 * @brief  Multifeep error status enumeration
 */
typedef enum
{
    MULTIFEEP_SUCCESS=0,				///< multifeep success
    MULTIFEEP_ERR=-1,					///< multifeep error
    MULTIFEEP_COM_FAIL=-2,				///< multifeep communication fail
    MULTIFEEP_INVLD_ARG=-3,				///< multifeep_invalid argument
    MULTIFEEP_NULL_PTR_ERR=-4,			        ///< null pointer error
    MULTIFEEP_CHECKSUM_ERR=-5
}multifeep_err;

/**
 * @brief  Multifeep system operating mode enumeration
 */
typedef enum
{
    USER_MODE=0,				///< user mode
    DEV_MODE=1					///< developer mode

}multifeep_board_mode;

/**
 * @brief Thruster unit on_off status enumeration
 */
typedef enum
{
    ON_MODE=0,					///< on mode
    OFF_MODE=1,					///< off mode

}multifeep_state;

/**
 * @brief Thruster operating mode enumeration
 */
typedef enum
{
    MODE_1=0x01,				///< mode1
    MODE_2=0x02,				///< mode2
    MODE_3=0x03,				///< mode3
    MODE_4=0x04,				///< mode4
    MODE_5=0x05,				///< mode5
    BUSY_MODE=0x06,				///< busy mode
    BURST_MODE=0x07,			        ///< burst mode
    CALIBRATION_MODE=0x08,		        ///< calibration mode
    COOLING_MODE=0x09,			        ///< cooling mode
    MAX_MODE=0x0A

}multifeep_thruster_mode;

/**
 * @brief System id enumeration
 */
typedef enum
{
    UNIT_1=0x01,				///< unit1
    UNIT_2=0x02,				///< unit2
    UNIT_3=0x03,				///< unit3
    UNIT_ALL=0x0F,				///< all unit
    MAX_UNIT=0x04

}multifeep_system_id;

/**
 * @brief  Error handling enumeration
 */
typedef enum
{
    FEEP_READY,					///< nominal status
    NEUT_ERR,					///< neutralizer error
    MDE_ERR,					///< mode error
    THRUST_INIT_ERR,			        ///< thruster initiation error
    OP_TEMP_ERR,				///< operating temperature error
    NO_RDY_FIRE,				///< thruster is not ready to fire
    THRUST_ERR,					///< thruster error
    THRUST_VOL_ERR,				///< thruster voltage error
    HEAT_ERR,					///< heater error
    HEAT_CMD_ERR,				///< heater command error
    HEAT_SEQ_ERR,				///< heater sequence error
    WTHDOG_ERR,					///< watchdog error
    OSCIL_ERR,					///< oscillator error
    PWRON_ERR,					///< power on error
    RST_ERR,					///< reset error
    CMD_UNKN,					///< unknown command
    RX_ERR,					///< reciever error
    TX_ERR,				    	///< transmitter error
    UNLCK_ERR,					///< unlocking error
    CMD_ERR,					///< command error
    SRTBYT_ERR,					///< start byte error
    SOPBYT_ERR,					///< stop byte error
    DEV_UNKN,					///< device unknown
    OP_UNKN,					///< unknown operator
    PAR_UNKN,					///< unknown parameter
    CHSM_UNKN,					///< unknown checksum
    EMTY_TRNS,					///< empty transaction
    NO_PRM,			    		///< no permission
    CMD_DEV_ERR,				///< command device error
    TME_CMD_ERR,				///< time command error
    ERR_UNT_UNKN,				///< error unit unknown
    ERR_UNT_PWR					///< error unit power
}error_info;

/**
 * @brief  Multifeep device status enumeration
 */
typedef enum
{
    THRUSTER=0,			          		///< thruster
    READY_TO_FIRE,				        ///< ready to fire
    HEATER,						///< heater
    OPRTNL_TEMP,				        ///< operational temperature
    BRST_RCMD,					        ///< burst recommand
    NEUT1,						///< neutralizer 1
    NEUT2,						///< neutralizer 2
    EXT1,						///< extractor 1
    EXT2,						///< extractor 2
    EXT3,						///< extractor 3
    EXT4,						///< extractor 4
    EXT5,						///< extractor 5
    EXT6,						///< extractor 6
    EXT7,						///< extractor 7
    MAX_DEV

}dev_sts;

/**
 * @brief Extractor enumeration
 */
typedef enum
{
    extractor_1=1,				///<extractor 1
    extractor_2,				///<extractor 2
    extractor_3,				///<extractor 3
    extractor_4,				///<extractor 4
    extractor_5,				///<extractor 5
    extractor_6,				///<extractor 6
    extractor_7,				///<extractor 7
    MAX_EXTRACTOR

}ext_id;

/**
 * @brief Neutralizer enumeration
 */
typedef enum
{
    NEUT_1=1,					///< neutralizer1
    NEUT_2,					///< neutralizer2
    MAX_NEUT

}neut_id;

/**
 * @brief Data frame structure definition
 */
typedef struct
{
    uint8_t start;			    	/*!< start byte			*/
    uint8_t system_id;				/*!< system id			*/
    uint8_t device_id;				/*!< device id			*/
    uint8_t operator_id;			/*!< operator id		*/
    uint8_t parameter_id;			/*!< parameter id		*/
    uint8_t value[4];				/*!< exemplary value	        */
    uint8_t checksum;				/*!< checksum			*/
    uint8_t stop;		    		/*!< stop byte			*/

}data_frame;

/**
 * @brief  Multifeep thruster control block structure definition
 */
typedef struct
{
    uint16_t slv_addr;					        /*!< slave address		                */
    void* intf_hdl;						/*!< IO interface handle pointer		*/
    multifeep_transmit_fptr transmit;	                        /*!< transmit API function pointer		*/
    multifeep_recieve_fptr recieve;		                /*!< recieve API function pointer		*/

}multifeep_intf;

/**
 * @brief Multifeep thruster housekeeping1 data structure definition
 */
typedef struct
{
    uint32_t master_tm;				/*!< master time					*/
    uint8_t sts;				/*!< status						*/
    int8_t temp;			    	/*!< temperature					*/
    uint16_t tot_force;				/*!< total force					*/
    uint16_t tot_azmth;				/*!< total azimuthal angle			        */
    uint8_t tot_polar;				/*!< total polar angle				        */
    uint16_t tot_pwr_cnsp;			/*!< total power consumption		                */
    uint8_t unreg_vol;				/*!< unregulated voltage			        */
    uint16_t prplt;		    		/*!< propellant						*/
    uint16_t force_unit1;			/*!< force of unit1					*/
    uint8_t azmth_unit1;			/*!< azimuthal angle of unit1		                */
    uint16_t polar_unit1;			/*!< polar angle of unit1			        */
    uint16_t pwr_unit1;				/*!< power of unit1					*/
    uint8_t mode_unit1;				/*!< mode of unit1					*/
    uint16_t force_unit2;			/*!< force of unit2					*/
    uint8_t polar_unit2;			/*!< polar angle of unit2			        */
    uint16_t azmth_unit2;			/*!< azimuthal angle of unit2		                */
    uint16_t pwr_unit2;				/*!< power of unit2					*/
    uint8_t mode_unit2;				/*!< mode of unit2					*/

}multifeep_housekeeping1;

/**
 * @brief Multifeep thruster housekeeping2 data structure definition
 */
typedef struct
{
    uint32_t bkpln_master_tm;			        /*!< master time of backplane			        */
    uint8_t sts;				    	/*!< status						*/
    uint8_t rst_backplane;		    	        /*!< backplane reset					*/
    uint16_t pwr;			    		/*!< power						*/
    uint16_t unreg_vol;			    	        /*!< unregulated voltage				*/
    uint32_t unit_master_tm;		                /*!< master time of unit				*/
    uint8_t mode;		    			/*!< mode						*/
    uint16_t dev_on_sts;			        /*!< device on status					*/
    uint8_t rst_sts_unit;		    	        /*!< reset status of unit				*/
    int8_t temp;		    			/*!< temperature					*/
    uint16_t prplt;	    				/*!< propellant						*/
    uint16_t force; 					/*!< force						*/
    uint16_t azmth;					/*!< azimuthal angle					*/
    uint8_t polar;				    	/*!< polar angle					*/
    uint16_t unregu_vol;		    	        /*!< unregulated voltage				*/
    uint32_t calib_data[7];	       		        /*!< calibration value					*/
    uint8_t heat_err;					/*!< heater error					*/
    uint8_t heat_duty;					/*!< heater duty cycle					*/
    int8_t heat_temp;					/*!< heater temperature					*/
    int8_t heat_targ_temp;				/*!< heater target temperature			        */
    uint16_t emit_vol;					/*!< emitter voltage					*/
    uint16_t emit_cur;					/*!< emitter current					*/
    uint16_t emit_ip_cur;				/*!< emitter current					*/
    uint16_t ext1_vol;					/*!< extractor1 voltage					*/
    uint16_t ext1_cur;					/*!< extractor1 current					*/
    uint16_t ext1_ip_cur;				/*!< extractor1 input current			        */
    uint16_t ext2_vol;					/*!< extractor2 voltage					*/
    uint16_t ext2_cur;					/*!< extractor2 current					*/
    uint16_t ext2_ip_cur;				/*!< extractor2 input current			        */
    uint16_t ext3_vol;					/*!< extractor3 voltage					*/
    uint16_t ext3_cur;					/*!< extractor3 voltage					*/
    uint16_t ext3_ip_cur;				/*!< extractor3 voltage					*/
    uint16_t ext4_vol;					/*!< extractor4 voltage					*/
    uint16_t ext4_cur;					/*!< extractor4 voltage					*/
    uint16_t ext4_ip_cur;				/*!< extractor4 voltage					*/
    uint16_t ext5_vol;					/*!< extractor5 voltage					*/
    uint16_t ext5_cur;					/*!< extractor5 voltage					*/
    uint16_t ext5_ip_cur;				/*!< extractor5 voltage					*/
    uint16_t ext6_vol;					/*!< extractor6 voltage					*/
    uint16_t ext6_cur;					/*!< extractor6 voltage					*/
    uint16_t ext6_ip_cur;				/*!< extractor6 voltage					*/
    uint16_t ext7_vol;					/*!< extractor7 voltage					*/
    uint16_t ext7_cur;					/*!< extractor7 voltage					*/
    uint16_t ext7_ip_cur;				/*!< extractor7 voltage					*/
    uint16_t neut1_vol;					/*!< neutralizer1 voltage				*/
    uint16_t neut1_cur;					/*!< neutralizer1 current				*/
    uint16_t neut1_ip_cur;				/*!< neutralizer1 input current			        */
    uint16_t neut1_ret_cur;				/*!< neutralizer1 return current		        */
    uint16_t neut2_vol;					/*!< neutralizer2 voltage				*/
    uint16_t neut2_cur;					/*!< neutralizer2 current				*/
    uint16_t neut2_ip_cur;				/*!< neutralizer2 input current			        */
    uint16_t neut2_ret_cur;				/*!< neutralizer2 return current		        */

}multifeep_housekeeping2;

/**
 * @brief Multifeep thruster housekeeping3 data structure definition
 */
typedef struct
{
    uint32_t sys_tm;			/*!< system time			*/
    uint8_t sys;			/*!< system				*/
    uint8_t dev;			/*!< device				*/
    uint8_t err_cde;			/*!< error code				*/
    uint8_t err_count;			/*!< error count			*/

}multifeep_err_info;

/**
 * @brief Multifeep thruster status structure definition
 */
typedef struct
{
    uint8_t mjr_vers_no;			/*!< major version number		*/
    uint8_t mnr_vers_no;			/*!< minor version number		*/
    uint16_t ptch_vers_no;			/*!< patch version number		*/
    uint8_t brd_err_cde;			/*!< board error code			*/
    uint8_t brd_err_count;			/*!< board error count			*/
    uint8_t	rst_sts;			/*!< reset status			*/
    uint8_t	brd_temp;			/*!< board temperature			*/
    uint32_t strt_tm;				/*!< start time				*/
    uint32_t master_tm;				/*!< master time	    		*/

}multifeep_sts;

/**
 * @brief This function is used to set the force in (micro Newton)
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[in] force - set the force
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_unit_thruster_set_force(multifeep_intf *inst_ptr,uint8_t system_id,float force);

/**
 * @brief  This function is used to reset the system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_reset(multifeep_intf *inst_ptr);

/**
 * @brief  This function is used to boot the system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_boot(multifeep_intf *inst_ptr);

/**
 * @brief  This function is used to set the on/off status
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[in] on_off - set the  power ON and OFF
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_unit_set_pwr_on_off(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t on_off);

/**
 * @brief  This function is used to set the mode of the thruster
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[in] mode - set the mode
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_unit_thruster_set_mode(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t mode);

/**
 * @brief  This function is used to set the mode of the system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_set_mode(multifeep_intf *inst_ptr,uint8_t system_id);

/**
 * @brief  This function is used to get the mode of the system
 * @param[in] inst_ptr - in This stance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] mode - decoded frame is updated in this pointer variable
 * @retval multifeep_board_mode - returns the mode of the system
 */
multifeep_err multifeep_get_mode(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *mode);

/**
 * @brief  This function is used to get the mode of the thruster
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] mode - decoded frame is updated in this pointer variable
 * @retval multifeep_err - returns the success or error code.
 */
multifeep_err multifeep_thruster_get_mode(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *mode);

/**
 * @brief  This function is used to get the status of the system
 * @param[in] inst - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] info - decoded frame is updated in this pointer variable
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_system_get_status(multifeep_intf *inst_ptr, uint8_t system_id,multifeep_sts *info);

/**
 * @brief  This function is used to get the serial number of the system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] srl_num - decoded frame is updated in this pointer variable
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_system_get_serial_number(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *srl_num);

/**
 * @brief  This function is used to get the housekeeping1 data
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] info - decoded frame is updated in this structure pointer variable
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_housekeeping1_data(multifeep_intf *inst_ptr, multifeep_housekeeping1 *info);

/**
 * @brief  This function is used to get the housekeeping2 data
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] info - decoded frame is updated in this structure pointer variable
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err  multifeep_get_housekeeping2_data(multifeep_intf *inst_ptr,multifeep_housekeeping2 *info,uint8_t system_id);

/**
 * @brief  This function is used to get the housekeeping3
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] housekeeping3 - decoded frame is updated in this pointer variable
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_housekeeping3_data(multifeep_intf *inst_ptr,uint8_t *housekeeping3);

/**
 * @brief  This function is used to get the power of the  system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] on_off - decoded frame is updated in this pointer variable
 * @retval multifeep_state - returns the ON or OFF status of of the system
 */
multifeep_err multifeep_unit_get_pwr_on_off(multifeep_intf *inst_ptr,uint8_t *on_off,uint8_t system_id);

/**
 * @brief  This function is used to get the force in (micro Newton)
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id - id of the system
 * @param[out] frc - decoded frame is updated in this pointer variable
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_unit_thruster_get_force(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *frc);

/**
 * @brief  This function is used to get the master time from housekeeping1 data
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] mst_tm - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_master_time(multifeep_intf *inst_ptr,uint32_t *mst_tm);

/**
 * @brief  This function is used to get the the backplane temperature
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] bckpln_temp - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_backplane_temp(multifeep_intf *inst_ptr,uint8_t* bckpln_temp);

/**
 * @brief  This function is used to get total force of thruster
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] bckpln_frc - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_backplane_total_force(multifeep_intf *inst_ptr,uint16_t* bckpln_frc);

/**
 * @brief  This function is used to get total azimuthal angle
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] tot_azmth - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_total_azimuthal_angle(multifeep_intf *inst_ptr,uint16_t* tot_azmth);

/**
 * @brief  This function is used to get the total polar angle
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] tot_plr - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_total_polar_angle(multifeep_intf *inst_ptr,uint8_t* tot_plr);

/**
 * @brief  This function is used to get the total power consumption
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] pwr_cnsp - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_total_pwr_cnsp(multifeep_intf *inst_ptr,uint16_t *pwr_cnsp);

/**
 * @brief  This function is used to get the unregulated voltage
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] unreg_vol - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_unreg_vol(multifeep_intf *inst_ptr,uint8_t *unreg_vol);

/**
 * @brief  This function is used to get the remaining propellant
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] prplt - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_remn_prplt(multifeep_intf *inst_ptr,uint16_t *prplt);

/**
 * @brief  This function is used to get the polar angle of the system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] polar - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */

multifeep_err multifeep_get_unit_polar_angle(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *polar);

/**
 * @brief  This function is used to get the Azimuthal angle of system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] azimuthal - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_unit_azimuthal_angle(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *azimuthal);

/**
 * @brief  This function is used to get the Power-Consumption of the system
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] power - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_unit_pwr(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *power);

/**
 * @brief  This function is used to get the reset status
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] rst_sts - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_rst_sts(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *rst_sts);

/**
 * @brief  This function is used to get the total power
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] pwr - pointer to a data
 * @param[in] system_id -  id of the system
 * @retval success or error code - returns the success or error code
 */
multifeep_err multifeep_get_total_pwr(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *pwr);

/**
 * @brief  This function is used to get the unregulated voltage
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] unreg_vol - pointer to a data
 * @param[in] system_id -  id of the system
 * @retval multifeep_err- returns the success or error code
 */
multifeep_err multifeep_get_unreg_voltage(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *unreg_vol);

/**
 * @brief  This function is used to get the ON status of the device
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] dev_sts - pointer to a data
 * @param[in] system_id -  id of the system
 * @retval tmultifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_device_on_sts(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *dev_sts);

/**
 * @brief  This function is used to get the reset status
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] rst_sts - pointer to a data
 * @param[in] system_id -  id of the system
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_unit_rst_sts(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *rst_sts);

/**
 * @brief  This function is used to get the board temperature
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] temp - pointer to a data
 * @param[in] system_id -  id of the system
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_board_temp(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *temp);

/**
 * @brief  This function is used to get the remaining propellant
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] prplt - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_unit_prplt(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *prplt);

/**
 * @brief  This function is used to get the Unregulated voltage
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] unreg_vol - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_ureg_voltage(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *unreg_vol);

/**
 * @brief  This function is used to get the calibration value
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] calib - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_calibration(multifeep_intf *inst_ptr,uint8_t system_id,uint32_t *calib);

/**
 * @brief  This function is used to get the heater error code
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] err_cde - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_heater_err_code(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *err_cde);

/**
 * @brief  This function is used to get the Duty cycle of the heater
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] duty_cycle - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_heater_duty_cycle(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *duty_cycle);

/**
 * @brief  This function is used to get the temperature of heater
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] temp - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_heater_temp(multifeep_intf *inst_ptr,uint8_t system_id,int8_t *temp);

/**
 * @brief  This function is used to get the target temperature of heater
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] trgt_temp - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_heater_target_temp(multifeep_intf *inst_ptr,uint8_t system_id,int8_t *trgt_temp);

/**
 * @brief  This function is used to get the emitter voltage
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] emt_vol - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_emitter_voltage(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *emt_vol);

/**
 * @brief  This function is used to get the emitter current
 * @param[in] inst_ptr - instance pointer of Multifeepnthruster
 * @param[in] system_id -  id of the system
 * @param[out] emt_cur - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_emitter_current(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *emt_cur);

/**
 * @brief  This function is used to get the emitter input current
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] emt_ip_cur - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_emitter_input_current(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *emt_ip_cur);

/**
 * @brief  This function is used to get the extractor voltage
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in]ext_id -  id of the extractor
 * @param[in] system_id -  id of the system
 * @param[out] ext_vol - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_extractor_voltage(multifeep_intf *inst_ptr,uint8_t ext_id,uint8_t system_id,uint16_t *ext_vol);

/**
 * @brief  This function is used to get the extractor current
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[out] ext_id -  id of the extractor
 * @param[in] system_id -  id of the system
 * @param[out] ext_cur - pointer to a data
 * @retval multifeep_err- returns the success or error code
 */
multifeep_err multifeep_get_extractor_current(multifeep_intf *inst_ptr,uint8_t ext_id,uint8_t system_id,uint16_t *ext_cur);

/**
 * @brief  This function is used to get the extractor input current
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] ext_id -  id of the extractor
 * @param[in] system_id -  id of the system
 * @param[out] ext_ip_cur - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_extractor_input_current(multifeep_intf *inst_ptr,uint8_t ext_id,uint8_t system_id,uint16_t *ext_ip_cur);

/**
 * @brief  This function is used to get the neutralizer voltage
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] neut_id -  id of the neutralizer
 * @param[in] system_id -  id of the system
 * @param[out] neut_vol - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_neutralizer_voltage(multifeep_intf *inst_ptr,uint8_t neut_volt,uint8_t system_id,uint16_t *neut_vol);

/**
 * @brief  This function is used to get the neutralizer current
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] neut_id -  id of the neutralizer
 * @param[in] system_id -  id of the system
 * @param[out] neut_cur - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_neutralizer_current(multifeep_intf *inst_ptr,uint8_t neut_id,uint8_t system_id,uint16_t *neut_cur);

/**
 * @brief  This function is used to get the neutralizer input current
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] neut_id -  id of the neutralizer
 * @param[in] system_id -  id of the system
 * @param[out] neut_ip_cur - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_neutralizer_input_current(multifeep_intf *inst_ptr,uint8_t neut_id,uint8_t system_id,uint16_t *neut_ip_cur);

/**
 * @brief  This function is used to get the neutralizer return current
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] neut_id -  id of the neutralizer
 * @param[in] system_id -  id of the system
 * @param[out] neut_ret_cur - pointer to a data
 * @retval multifeep_er - returns the success or error code
 */
multifeep_err multifeep_get_neutralizer_return_current(multifeep_intf *inst_ptr,uint8_t neut_id,uint8_t system_id,uint16_t *neut_ret_cur);

/**
 * @brief  This function is used to get the major version number
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] mjr_vers_no - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_major_vers_no(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *mjr_vers_no);

/**
 * @brief  This function is used to get the minor version number
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] mnr_vers_no - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_minor_vers_no(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *mnr_vers_no);

/**
 * @brief  This function is used to get the patch version number
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] ptch_vers_no - pointer to a data
 * @retval multifeep_err - returns the  success or error code
 */
multifeep_err multifeep_get_patch_vers_no(multifeep_intf *inst_ptr,uint8_t system_id,uint16_t *ptch_vers_no);

/**
 * @brief  This function is used to get the board error code
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] err_cde - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_board_err_cde(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *err_cde);

/**
 * @brief  This function is used to get the error counter
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  id of the system
 * @param[out] err_count - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_err_counter(multifeep_intf *inst_ptr,uint8_t system_id,uint8_t *err_count);

/**
 * @brief  This function is used to get the start time
 * @param[in] inst_ptr - instance pointer of Multifeep thruster
 * @param[in] system_id -  ID of the system
 * @param[out] strt_time - pointer to a data
 * @retval multifeep_err - returns the success or error code
 */
multifeep_err multifeep_get_strt_time(multifeep_intf *inst_ptr,uint8_t system_id,uint32_t *strt_time);



#endif /* DRIVERS_AHW_DRIVERS_MORPHEUS_THRUSTER_SENSOR_MORPHEUS_MULTIFEEP_INC_MORPHEUS_THRUSTER_H_ */
