/*
 * Copyright 2020-2022 Yuntu Microelectronics Co., Ltd.
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
/*!
 * @file fls_drv_table.h
 *
 */
#ifndef FLS_DRV_TABLE_H
#define FLS_DRV_TABLE_H

#include "flash_driver.h"

#define FLS_DRV_VERSION 1

/*!
 * @brief Flash driver init function.
 */
typedef status_t (*FLASH_Init_t)(void);

/*!
 * @brief Flash driver deinit function.
 */
typedef status_t (*FLASH_Deinit_t)(void);

/*!
 * @brief Flash erase sector synchronously.
 */
typedef status_t (*FLASH_EraseSector_t)(uint32_t dest, uint32_t size);

/*!
 * @brief Flash program synchronously.
 */
typedef status_t (*FLASH_Program_t)(uint32_t dest, uint32_t size, const void * pData);

/*!
 * @brief Flash driver boot swap function.
 */
typedef status_t (*FLASH_BootSwap_t)(void);

typedef struct{
    uint32_t version;
    FLASH_Init_t init;
    FLASH_Deinit_t deinit;
    FLASH_EraseSector_t eraseSector;
    FLASH_Program_t program;
#ifdef FEATURE_EFM_BOOT_SWAP_CMD_CODE
    FLASH_BootSwap_t bootSwap;
#endif
}fls_drv_tbl_t;

#endif /* FLS_DRV_TABLE_H */