#ifndef FPGAFLASHINTERFACE_H
#define FPGAFLASHINTERFACE_H

#include <stdint.h>
#include <exception>
#include "fpgaflashprofile.h"
#include "mydebug.h"
#include "fpgaflashconfig.h"

class FpgaFlashInterface
{
public:
    virtual bool rtgWrite(uint32_t address, const void* data, unsigned int len=DIM_DATA_BUFFER)=0;
    virtual bool rtgWriteDB(uint32_t address, const void* data, unsigned int len=DIM_DATA_BUFFER, unsigned int doorbell=0)=0;
    virtual bool rtgRead(uint32_t address, void* data, unsigned int len=DIM_DATA_BUFFER)=0;
    virtual bool rtgReadDB(uint32_t address, void* data, unsigned int len=DIM_DATA_BUFFER, unsigned int doorbell=0)=0;
    //virtual bool rtgErase(uint32_t address, void* data, unsigned int len=DIM_DATA_BUFFER)=0;

    virtual bool rtgReadDirect(uint32_t address, void* data, unsigned int len=DIM_DATA_BUFFER)=0;

    virtual bool rtgWaitEvent(unsigned int timeout_ms=5000)=0;

    virtual void notify(step_t sts, int progress, const char* msg, ...);

    virtual void log(type_log_t level, const char* msg, ...);//level<0: error, ==0: info, >0: success

    virtual unsigned long timeNowMs();

    virtual ~FpgaFlashInterface();
};



#endif // FPGAFLASHINTERFACE_H
