2019-09-26 18:29:20 +02:00
|
|
|
#ifndef XILINX_HPP
|
|
|
|
|
#define XILINX_HPP
|
|
|
|
|
|
2020-04-21 09:08:32 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
2019-09-26 18:29:20 +02:00
|
|
|
#include "bitparser.hpp"
|
|
|
|
|
#include "device.hpp"
|
2020-03-06 09:05:57 +01:00
|
|
|
#include "jtag.hpp"
|
2020-04-21 09:08:32 +02:00
|
|
|
#include "spiInterface.hpp"
|
2019-09-26 18:29:20 +02:00
|
|
|
|
2020-04-21 09:08:32 +02:00
|
|
|
class Xilinx: public Device, SPIInterface {
|
2019-09-26 18:29:20 +02:00
|
|
|
public:
|
2020-08-19 16:57:07 +02:00
|
|
|
Xilinx(Jtag *jtag, const std::string &filename, bool verbose);
|
2019-09-26 18:29:20 +02:00
|
|
|
~Xilinx();
|
|
|
|
|
|
2019-09-28 15:27:58 +02:00
|
|
|
void program(unsigned int offset = 0) override;
|
2019-10-05 19:02:42 +02:00
|
|
|
void program_spi(unsigned int offset = 0);
|
2020-02-14 15:14:22 +01:00
|
|
|
void program_mem(BitParser &bitfile);
|
2020-08-19 16:57:07 +02:00
|
|
|
int idCode() override;
|
|
|
|
|
void reset() override;
|
2020-04-21 09:08:32 +02:00
|
|
|
|
|
|
|
|
/* spi interface */
|
|
|
|
|
int spi_put(uint8_t cmd, uint8_t *tx, uint8_t *rx,
|
|
|
|
|
uint16_t len) override;
|
|
|
|
|
int spi_put(uint8_t *tx, uint8_t *rx, uint16_t len) override;
|
|
|
|
|
int spi_wait(uint8_t cmd, uint8_t mask, uint8_t cond,
|
|
|
|
|
uint32_t timeout, bool verbose = false) override;
|
2019-09-26 18:29:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|