openFPGALoader/src/epcq.hpp

42 lines
783 B
C++
Raw Normal View History

2021-06-26 15:24:07 +02:00
// SPDX-License-Identifier: Apache-2.0
/*
* Copyright (C) 2019 Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
*/
#ifndef SRC_EPCQ_HPP_
#define SRC_EPCQ_HPP_
#include <cstdint>
2019-09-26 18:29:20 +02:00
#include <iostream>
#include <vector>
#include "spiInterface.hpp"
#include "spiFlash.hpp"
2019-09-26 18:29:20 +02:00
using namespace std;
class EPCQ: public SPIFlash {
2019-09-26 18:29:20 +02:00
public:
EPCQ(SPIInterface *spi, bool unprotect_flash, int8_t verbose);
2019-09-26 18:29:20 +02:00
~EPCQ();
void read_id() override;
2019-09-26 18:29:20 +02:00
void reset() override;
/* not supported */
void power_up() override {}
void power_down() override {}
2019-09-26 18:29:20 +02:00
private:
unsigned char convertLSB(unsigned char src);
/* trash */
void dumpJICFile(char *jic_file, char *out_file, size_t max_len);
unsigned char _device_id;
unsigned char _silicon_id;
};
#endif // SRC_EPCQ_HPP_