SXXXXXXX_PyDownloadFwViaSRIO/_OLD/Vecchia_app/FpgaBeamMeUp/fpgaflashengine.h
2026-01-22 17:10:05 +01:00

53 lines
1.1 KiB
C++

#ifndef FPGAFLASHENGINE_H
#define FPGAFLASHENGINE_H
#include <stdint.h>
#include <exception>
#include "fpgaflashconfig.h"
#include "mydebug.h"
#include "fpgaflashprofile.h"
#include "FpgaFlashInterface.h"
bool decodeSPISR(unsigned int _spisr, spisr_bit_t _bit);
unsigned int encodeSPISR(unsigned int _spisr, spisr_bit_t _bit);
class FpgaFlashEngine
{
public:
FpgaFlashEngine();
void setProfile(const FpgaFlashProfile& profile);
void setInterface(FpgaFlashInterface* flashInterface);
bool fpgaErase(unsigned int size);
bool fpgaProgram(const void* data, unsigned int size);
bool fpgaReset();
bool fpgaTerminate();
bool readFlashID();
bool readStatusSPI();
bool simulateWrite(uint32_t address, const void* data, unsigned int len);
bool simulateRead(uint32_t address, void *data, unsigned int len);
bool simulateErase(uint32_t address, void *data, unsigned int len);
bool simulateReset();
bool simulateReadStatusSPI();
bool simulateTerminate();
unsigned int simulateReadFlashID();
bool getEnableMsgBlk();
};
#endif // FPGAFLASHENGINE_H