7 #ifndef NTV2SPIINTERFACE_H
8 #define NTV2SPIINTERFACE_H
30 virtual bool Read(
const uint32_t address, std::vector<uint8_t> &data, uint32_t maxBytes = 1) = 0;
31 virtual bool Write(
const uint32_t address,
const std::vector<uint8_t> data, uint32_t maxBytes = 1) = 0;
32 virtual bool Erase(
const uint32_t address, uint32_t bytes) = 0;
33 virtual bool Verify(
const uint32_t address,
const std::vector<uint8_t>& dataWritten) = 0;
52 virtual bool Read(
const uint32_t address, std::vector<uint8_t> &data, uint32_t maxBytes = 1);
53 virtual bool Write(
const uint32_t address,
const std::vector<uint8_t> data, uint32_t maxBytes = 1);
54 virtual bool Erase(
const uint32_t address, uint32_t bytes);
55 virtual bool Verify(
const uint32_t address,
const std::vector<uint8_t>& dataWritten);
66 void SpiEnableWrite(
bool enable);
67 void SpiSendFIFOData();
68 bool SpiTransfer(std::vector<uint8_t> commandSequence,
69 const std::vector<uint8_t> inputData,
70 std::vector<uint8_t>& outputData, uint32_t maxByteCutoff = 1);
72 bool FlashDeviceInfo(uint8_t& manufactureID, uint8_t& memInerfaceType,
73 uint8_t& memDensity, uint8_t& sectorArchitecture,
75 bool FlashReadConfig(uint8_t& configValue);
76 bool FlashReadStatus(uint8_t& statusValue);
77 bool FlashReadBankAddress(uint8_t& bankAddressVal);
78 bool FlashWriteBankAddress(
const uint8_t bankAddressVal);
80 void FlashFixAddress(
const uint32_t address, std::vector<uint8_t>& commandSequence);
82 uint32_t mBaseByteAddress;
88 uint32_t mManufactureID;
89 uint32_t mSpiResetReg;
90 uint32_t mSpiControlReg;
91 uint32_t mSpiStatusReg;
92 uint32_t mSpiWriteReg;
94 uint32_t mSpiSlaveReg;
95 uint32_t mSpiGlobalIntReg;
98 #endif // NTV2SPIINTERFACE_H