all jtag interface: don't convert verbosity level to bool
This commit is contained in:
parent
8df01663ff
commit
952084cd1d
|
|
@ -44,7 +44,7 @@ enum analogicCableFreq {
|
||||||
ANLOGICCABLE_FREQ_90K = 0xff
|
ANLOGICCABLE_FREQ_90K = 0xff
|
||||||
};
|
};
|
||||||
|
|
||||||
AnlogicCable::AnlogicCable(uint32_t clkHZ, bool verbose):
|
AnlogicCable::AnlogicCable(uint32_t clkHZ, uint8_t verbose):
|
||||||
_verbose(verbose),
|
_verbose(verbose),
|
||||||
dev_handle(NULL), usb_ctx(NULL), _tdi(0), _tms(0)
|
dev_handle(NULL), usb_ctx(NULL), _tdi(0), _tms(0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
class AnlogicCable : public JtagInterface {
|
class AnlogicCable : public JtagInterface {
|
||||||
public:
|
public:
|
||||||
AnlogicCable(uint32_t clkHZ, bool verbose);
|
AnlogicCable(uint32_t clkHZ, uint8_t verbose);
|
||||||
virtual ~AnlogicCable();
|
virtual ~AnlogicCable();
|
||||||
|
|
||||||
int setClkFreq(uint32_t clkHZ) override;
|
int setClkFreq(uint32_t clkHZ) override;
|
||||||
|
|
@ -43,7 +43,7 @@ class AnlogicCable : public JtagInterface {
|
||||||
int flush() override;
|
int flush() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _verbose;
|
uint8_t _verbose;
|
||||||
|
|
||||||
int write(uint8_t *in_buf, uint8_t *out_buf, int len, int rd_len);
|
int write(uint8_t *in_buf, uint8_t *out_buf, int len, int rd_len);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ using namespace std;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CH552_jtag::CH552_jtag(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
CH552_jtag::CH552_jtag(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
||||||
string dev, const string &serial, uint32_t clkHZ, bool verbose):
|
string dev, const string &serial, uint32_t clkHZ, uint8_t verbose):
|
||||||
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _to_read(0)
|
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _to_read(0)
|
||||||
{
|
{
|
||||||
init_internal(cable);
|
init_internal(cable);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
class CH552_jtag : public JtagInterface, private FTDIpp_MPSSE {
|
class CH552_jtag : public JtagInterface, private FTDIpp_MPSSE {
|
||||||
public:
|
public:
|
||||||
CH552_jtag(const FTDIpp_MPSSE::mpsse_bit_config &cable, std::string dev,
|
CH552_jtag(const FTDIpp_MPSSE::mpsse_bit_config &cable, std::string dev,
|
||||||
const std::string &serial, uint32_t clkHZ, bool verbose = false);
|
const std::string &serial, uint32_t clkHZ, uint8_t verbose = false);
|
||||||
virtual ~CH552_jtag();
|
virtual ~CH552_jtag();
|
||||||
|
|
||||||
int setClkFreq(uint32_t clkHZ) override;
|
int setClkFreq(uint32_t clkHZ) override;
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ enum cmsisdap_status {
|
||||||
DAP_ERROR = 0xff
|
DAP_ERROR = 0xff
|
||||||
};
|
};
|
||||||
|
|
||||||
CmsisDAP::CmsisDAP(int vid, int pid, bool verbose):_verbose(verbose),
|
CmsisDAP::CmsisDAP(int vid, int pid, uint8_t verbose):_verbose(verbose),
|
||||||
_device_idx(0), _vid(vid), _pid(pid),
|
_device_idx(0), _vid(vid), _pid(pid),
|
||||||
_serial_number(L""), _dev(NULL), _num_tms(0), _is_connect(false)
|
_serial_number(L""), _dev(NULL), _num_tms(0), _is_connect(false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ class CmsisDAP: public JtagInterface {
|
||||||
* else search for a compatible device
|
* else search for a compatible device
|
||||||
* \param[in] vid: vendor id
|
* \param[in] vid: vendor id
|
||||||
* \param[in] pid: product id
|
* \param[in] pid: product id
|
||||||
* \param[in] verbose: verbose level false normal, true verbose
|
* \param[in] verbose: verbose level 0 normal, 1 verbose
|
||||||
*/
|
*/
|
||||||
CmsisDAP(const int vid, const int pid, bool verbose);
|
CmsisDAP(const int vid, const int pid, uint8_t verbose);
|
||||||
|
|
||||||
~CmsisDAP();
|
~CmsisDAP();
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ class CmsisDAP: public JtagInterface {
|
||||||
int writeJtagSequence(uint8_t tms, uint8_t *tx, uint8_t *rx,
|
int writeJtagSequence(uint8_t tms, uint8_t *tx, uint8_t *rx,
|
||||||
uint32_t len, bool end);
|
uint32_t len, bool end);
|
||||||
|
|
||||||
bool _verbose; /**< display more message */
|
uint8_t _verbose; /**< display more message */
|
||||||
int16_t _device_idx; /**< device index */
|
int16_t _device_idx; /**< device index */
|
||||||
uint16_t _vid; /**< device Vendor ID */
|
uint16_t _vid; /**< device Vendor ID */
|
||||||
uint16_t _pid; /**< device Product ID */
|
uint16_t _pid; /**< device Product ID */
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ enum dirtyJtagSig {
|
||||||
SIG_TMS = (1 << 4)
|
SIG_TMS = (1 << 4)
|
||||||
};
|
};
|
||||||
|
|
||||||
DirtyJtag::DirtyJtag(uint32_t clkHZ, bool verbose):
|
DirtyJtag::DirtyJtag(uint32_t clkHZ, uint8_t verbose):
|
||||||
_verbose(verbose),
|
_verbose(verbose),
|
||||||
dev_handle(NULL), usb_ctx(NULL), _tdi(0), _tms(0)
|
dev_handle(NULL), usb_ctx(NULL), _tdi(0), _tms(0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
class DirtyJtag : public JtagInterface {
|
class DirtyJtag : public JtagInterface {
|
||||||
public:
|
public:
|
||||||
DirtyJtag(uint32_t clkHZ, bool verbose);
|
DirtyJtag(uint32_t clkHZ, uint8_t verbose);
|
||||||
virtual ~DirtyJtag();
|
virtual ~DirtyJtag();
|
||||||
|
|
||||||
int setClkFreq(uint32_t clkHZ) override;
|
int setClkFreq(uint32_t clkHZ) override;
|
||||||
|
|
@ -43,7 +43,7 @@ class DirtyJtag : public JtagInterface {
|
||||||
int flush() override;
|
int flush() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _verbose;
|
uint8_t _verbose;
|
||||||
|
|
||||||
int sendBitBang(uint8_t mask, uint8_t val, uint8_t *read, bool last);
|
int sendBitBang(uint8_t mask, uint8_t val, uint8_t *read, bool last);
|
||||||
void getVersion();
|
void getVersion();
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ using namespace std;
|
||||||
|
|
||||||
FtdiJtagBitBang::FtdiJtagBitBang(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
FtdiJtagBitBang::FtdiJtagBitBang(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
||||||
const jtag_pins_conf_t *pin_conf, string dev, const std::string &serial,
|
const jtag_pins_conf_t *pin_conf, string dev, const std::string &serial,
|
||||||
uint32_t clkHZ, bool verbose):
|
uint32_t clkHZ, uint8_t verbose):
|
||||||
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _bitmode(0),
|
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _bitmode(0),
|
||||||
_curr_tms(0), _rx_size(0)
|
_curr_tms(0), _rx_size(0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class FtdiJtagBitBang : public JtagInterface, private FTDIpp_MPSSE {
|
||||||
public:
|
public:
|
||||||
FtdiJtagBitBang(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
FtdiJtagBitBang(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
||||||
const jtag_pins_conf_t *pin_conf, std::string dev, const std::string &serial,
|
const jtag_pins_conf_t *pin_conf, std::string dev, const std::string &serial,
|
||||||
uint32_t clkHZ, bool verbose = false);
|
uint32_t clkHZ, uint8_t verbose = 0);
|
||||||
virtual ~FtdiJtagBitBang();
|
virtual ~FtdiJtagBitBang();
|
||||||
|
|
||||||
int setClkFreq(uint32_t clkHZ) override;
|
int setClkFreq(uint32_t clkHZ) override;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ using namespace std;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FtdiJtagMPSSE::FtdiJtagMPSSE(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
FtdiJtagMPSSE::FtdiJtagMPSSE(const FTDIpp_MPSSE::mpsse_bit_config &cable,
|
||||||
string dev, const string &serial, uint32_t clkHZ, bool verbose):
|
string dev, const string &serial, uint32_t clkHZ, uint8_t verbose):
|
||||||
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _ch552WA(false),
|
FTDIpp_MPSSE(cable, dev, serial, clkHZ, verbose), _ch552WA(false),
|
||||||
_write_mode(0), _read_mode(0)
|
_write_mode(0), _read_mode(0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
class FtdiJtagMPSSE : public JtagInterface, private FTDIpp_MPSSE {
|
class FtdiJtagMPSSE : public JtagInterface, private FTDIpp_MPSSE {
|
||||||
public:
|
public:
|
||||||
FtdiJtagMPSSE(const FTDIpp_MPSSE::mpsse_bit_config &cable, std::string dev,
|
FtdiJtagMPSSE(const FTDIpp_MPSSE::mpsse_bit_config &cable, std::string dev,
|
||||||
const std::string &serial, uint32_t clkHZ, bool verbose = false);
|
const std::string &serial, uint32_t clkHZ, uint8_t verbose = 0);
|
||||||
virtual ~FtdiJtagMPSSE();
|
virtual ~FtdiJtagMPSSE();
|
||||||
|
|
||||||
int setClkFreq(uint32_t clkHZ) override;
|
int setClkFreq(uint32_t clkHZ) override;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ using namespace std;
|
||||||
do { if (_verbose) fprintf(stdout, __VA_ARGS__);}while(0)
|
do { if (_verbose) fprintf(stdout, __VA_ARGS__);}while(0)
|
||||||
|
|
||||||
FTDIpp_MPSSE::FTDIpp_MPSSE(const mpsse_bit_config &cable, const string &dev,
|
FTDIpp_MPSSE::FTDIpp_MPSSE(const mpsse_bit_config &cable, const string &dev,
|
||||||
const std::string &serial, uint32_t clkHZ, bool verbose):
|
const std::string &serial, uint32_t clkHZ, uint8_t verbose):
|
||||||
_verbose(verbose), _cable(cable), _vid(0),
|
_verbose(verbose), _cable(cable), _vid(0),
|
||||||
_pid(0), _bus(-1), _addr(-1),
|
_pid(0), _bus(-1), _addr(-1),
|
||||||
_interface(cable.interface),
|
_interface(cable.interface),
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class FTDIpp_MPSSE {
|
||||||
} mpsse_bit_config;
|
} mpsse_bit_config;
|
||||||
|
|
||||||
FTDIpp_MPSSE(const mpsse_bit_config &cable, const std::string &dev,
|
FTDIpp_MPSSE(const mpsse_bit_config &cable, const std::string &dev,
|
||||||
const std::string &serial, uint32_t clkHZ, bool verbose = false);
|
const std::string &serial, uint32_t clkHZ, uint8_t verbose = 0);
|
||||||
~FTDIpp_MPSSE();
|
~FTDIpp_MPSSE();
|
||||||
|
|
||||||
int init(unsigned char latency, unsigned char bitmask_mode,
|
int init(unsigned char latency, unsigned char bitmask_mode,
|
||||||
|
|
@ -67,7 +67,7 @@ class FTDIpp_MPSSE {
|
||||||
int mpsse_get_buffer_size() {return _buffer_size;}
|
int mpsse_get_buffer_size() {return _buffer_size;}
|
||||||
unsigned int udevstufftoint(const char *udevstring, int base);
|
unsigned int udevstufftoint(const char *udevstring, int base);
|
||||||
bool search_with_dev(const std::string &device);
|
bool search_with_dev(const std::string &device);
|
||||||
bool _verbose;
|
uint8_t _verbose;
|
||||||
mpsse_bit_config _cable;
|
mpsse_bit_config _cable;
|
||||||
int _vid;
|
int _vid;
|
||||||
int _pid;
|
int _pid;
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ using namespace std;
|
||||||
Jtag::Jtag(cable_t &cable, const jtag_pins_conf_t *pin_conf, string dev,
|
Jtag::Jtag(cable_t &cable, const jtag_pins_conf_t *pin_conf, string dev,
|
||||||
const string &serial, uint32_t clkHZ, int8_t verbose,
|
const string &serial, uint32_t clkHZ, int8_t verbose,
|
||||||
const string &firmware_path):
|
const string &firmware_path):
|
||||||
_verbose(verbose > 1),
|
_verbose(verbose),
|
||||||
_state(RUN_TEST_IDLE),
|
_state(RUN_TEST_IDLE),
|
||||||
_tms_buffer_size(128), _num_tms(0),
|
_tms_buffer_size(128), _num_tms(0),
|
||||||
_board_name("nope"), device_index(0)
|
_board_name("nope"), device_index(0)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ using namespace std;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UsbBlaster::UsbBlaster(int vid, int pid, const std::string &firmware_path,
|
UsbBlaster::UsbBlaster(int vid, int pid, const std::string &firmware_path,
|
||||||
bool verbose):
|
uint8_t verbose):
|
||||||
_verbose(verbose), _nb_bit(0),
|
_verbose(verbose), _nb_bit(0),
|
||||||
_curr_tms(0), _buffer_size(64)
|
_curr_tms(0), _buffer_size(64)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class UsbBlaster_ll {
|
||||||
class UsbBlaster : public JtagInterface {
|
class UsbBlaster : public JtagInterface {
|
||||||
public:
|
public:
|
||||||
UsbBlaster(int vid, int pid, const std::string &firmware_path,
|
UsbBlaster(int vid, int pid, const std::string &firmware_path,
|
||||||
bool verbose = false);
|
uint8_t verbose = 0);
|
||||||
virtual ~UsbBlaster();
|
virtual ~UsbBlaster();
|
||||||
|
|
||||||
int setClkFreq(uint32_t clkHZ) override;
|
int setClkFreq(uint32_t clkHZ) override;
|
||||||
|
|
@ -86,7 +86,7 @@ class UsbBlaster : public JtagInterface {
|
||||||
int setBitmode(uint8_t mode);
|
int setBitmode(uint8_t mode);
|
||||||
uint8_t *_in_buf;
|
uint8_t *_in_buf;
|
||||||
|
|
||||||
bool _verbose;
|
uint8_t _verbose;
|
||||||
uint8_t _tck_pin; /*!< tck pin: 1 << pin id */
|
uint8_t _tck_pin; /*!< tck pin: 1 << pin id */
|
||||||
uint8_t _tms_pin; /*!< tms pin: 1 << pin id */
|
uint8_t _tms_pin; /*!< tms pin: 1 << pin id */
|
||||||
uint8_t _tdi_pin; /*!< tdi pin: 1 << pin id */
|
uint8_t _tdi_pin; /*!< tdi pin: 1 << pin id */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue