/*
 * eps_fw_ctrlr.h
 *
 *  Created on: Aug 21, 2023
 *      Author: Invcuser_75
 */

#ifndef EXO_SERVICES_EPS_CTRLR_INC_EPS_FW_CTRLR_H_
#define EXO_SERVICES_EPS_CTRLR_INC_EPS_FW_CTRLR_H_

#include "exo_types.h"
#include "obc_tc_tm.h"

#define   EPS_FIRMWARE_UPDATE_ADDRESS          0x08000000

typedef enum
{
	EPS_MCU1_FW_SIZE_CRC_FAIL,
	EPS_MCU2_FW_SIZE_CRC_FAIL,
	EPS_FW_MAX_ERR
}eps_fw_status_e;
/**
  * @brief This function is used to handle generate telemetry depending on the telecommand given
  */
uint8_t eps_fw_update_tc_decode(obc_pck_data_eps *eps_fw_info);

uint8_t eps_bckup_fw_integrity_check(eps_fw_data_s *fw_sts,uint32_t *check_sum,uint8_t conv_batt_selc,ptr_typ addr_sdram);

void eps_fw_avail_check(eps_fw_data_s *fw_status, obc_pck_data_eps *fw_info);

void eps_bckup_fw_avail_check(eps_fw_data_s *fw_status, obc_pck_data_eps *fw_info);

void eps_fw_update(eps_fw_data_s *fw_status, obc_pck_data_eps *fw_info, uint32_t *crc, uint32_t *len, uint8_t conv_batt_selc);

#endif /* EXO_SERVICES_EPS_CTRLR_INC_EPS_FW_CTRLR_H_ */
