cable: introduce communication mode (currently only ftdi serial/bitbang

This commit is contained in:
Gwenhael Goavec-Merou 2020-03-07 10:53:31 +01:00
parent 1ef72b0da6
commit f9591b89a7
1 changed files with 18 additions and 6 deletions

View File

@ -6,12 +6,24 @@
#include "ftdipp_mpsse.hpp"
static std::map <std::string, FTDIpp_MPSSE::mpsse_bit_config> cable_list = {
{"digilent", {0x0403, 0x6010, INTERFACE_A, 0xe8, 0xeb, 0x00, 0x60}},
{"digilent_hs2", {0x0403, 0x6014, INTERFACE_A, 0xe8, 0xeb, 0x00, 0x60}},
{"digilent_hs3", {0x0403, 0x6014, INTERFACE_A, 0x88, 0x8B, 0x20, 0x30}},
{"ft2232", {0x0403, 0x6010, INTERFACE_A, 0x08, 0x0B, 0x08, 0x0B}},
{"ft232RL", {0x0403, 0x6001, INTERFACE_A, 0x08, 0x0B, 0x08, 0x0B}}
/*!
* \brief define type of communication
*/
enum {
MODE_FTDI_BITBANG = 0, /*! used with ft232RL/ft231x */
MODE_FTDI_SERIAL = 1 /*! ft2232, ft232H */
} communication_type_t;
typedef struct {
int type;
FTDIpp_MPSSE::mpsse_bit_config config;
} cable_t;
static std::map <std::string, cable_t> cable_list = {
{"digilent", {MODE_FTDI_SERIAL, {0x0403, 0x6010, INTERFACE_A, 0xe8, 0xeb, 0x00, 0x60}}},
{"digilent_hs2", {MODE_FTDI_SERIAL, {0x0403, 0x6014, INTERFACE_A, 0xe8, 0xeb, 0x00, 0x60}}},
{"digilent_hs3", {MODE_FTDI_SERIAL, {0x0403, 0x6014, INTERFACE_A, 0x88, 0x8B, 0x20, 0x30}}},
{"ft2232", {MODE_FTDI_SERIAL, {0x0403, 0x6010, INTERFACE_A, 0x08, 0x0B, 0x08, 0x0B}}}
};
#endif