#ifndef __IAP_UPGRADE_H__
#define __IAP_UPGRADE_H__

#include <main.h>

#define MAX_UPGRADE_SIZE   (95 * 1024)
#define PAGE_SIZE          2048
#define PACKET_SIZE        256

void send_upgrade_response(uint8_t func_code, uint16_t reg_addr, uint8_t status_code, uint16_t sliceCount);
uint32_t get_backup_app_addr(void);
void reset_upgrade_state(void);
void handle_upgrade_start_frame(uint8_t *data);
void handle_upgrade_data_frame(uint8_t *data);
void handle_upgrade_end_frame(void);

#endif

