libgpiodJtagBitbang: add support for XVC server
This commit is contained in:
parent
3cf558ebe2
commit
a39aa2d43e
|
|
@ -343,3 +343,27 @@ int LibgpiodJtagBitbang::toggleClk(uint8_t tms, uint8_t tdi, uint32_t clk_len)
|
|||
|
||||
return clk_len;
|
||||
}
|
||||
|
||||
bool LibgpiodJtagBitbang::writeTMSTDI(const uint8_t *tms, const uint8_t *tdi, uint8_t *tdo,
|
||||
uint32_t len)
|
||||
{
|
||||
memset(tdo, 0, (len+7) / 8);
|
||||
|
||||
for (uint32_t i = 0; i < len; i++) {
|
||||
#ifdef GPIOD_APIV2
|
||||
gpiod_line_value tdix = (tdi[i >> 3] & (1 << (i & 7))) ? GPIOD_LINE_VALUE_ACTIVE : GPIOD_LINE_VALUE_INACTIVE;
|
||||
gpiod_line_value tmsx = (tms[i >> 3] & (1 << (i & 7))) ? GPIOD_LINE_VALUE_ACTIVE : GPIOD_LINE_VALUE_INACTIVE;
|
||||
update_pins(tmsx, tdix);
|
||||
#else
|
||||
int tdix = (tdi[i >> 3] & (1 << (i & 7))) ? 1 : 0;
|
||||
int tmsx = (tms[i >> 3] & (1 << (i & 7))) ? 1 : 0;
|
||||
|
||||
update_pins(0, tmsx, tdix);
|
||||
update_pins(1, tmsx, tdix);
|
||||
#endif
|
||||
if (read_tdo() > 0)
|
||||
tdo[i >> 3] |= 1 << (i & 7);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class LibgpiodJtagBitbang : public JtagInterface {
|
|||
int writeTMS(const uint8_t *tms_buf, uint32_t len, bool flush_buffer, const uint8_t tdi = 1) override;
|
||||
int writeTDI(const uint8_t *tx, uint8_t *rx, uint32_t len, bool end) override;
|
||||
int toggleClk(uint8_t tms, uint8_t tdo, uint32_t clk_len) override;
|
||||
bool writeTMSTDI(const uint8_t *tms, const uint8_t *tdi, uint8_t *tdo,
|
||||
uint32_t len) override;
|
||||
|
||||
int get_buffer_size() override { return 0; }
|
||||
bool isFull() override { return false; }
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
#include <stdexcept>
|
||||
|
||||
#include "ftdiJtagMPSSE.hpp"
|
||||
#ifdef ENABLE_LIBGPIOD
|
||||
#include "libgpiodJtagBitbang.hpp"
|
||||
#endif
|
||||
#include "cable.hpp"
|
||||
#include "display.hpp"
|
||||
|
||||
|
|
@ -36,6 +39,11 @@ XVC_server::XVC_server(int port, const cable_t & cable,
|
|||
_jtag = new FtdiJtagMPSSE(cable, dev, serial, clkHZ,
|
||||
invert_read_edge, _verbose);
|
||||
break;
|
||||
#ifdef ENABLE_LIBGPIOD
|
||||
case MODE_LIBGPIOD_BITBANG:
|
||||
_jtag = new LibgpiodJtagBitbang(pin_conf, dev, clkHZ, verbose);
|
||||
break;
|
||||
#endif
|
||||
#if 0
|
||||
case MODE_ANLOGICCABLE:
|
||||
_jtag = new AnlogicCable(clkHZ);
|
||||
|
|
|
|||
Loading…
Reference in New Issue