From: Stephan Linz Date: Thu, 13 Aug 2015 10:03:29 +0000 (+0200) Subject: ftdi_eeprom: support channel configuration X-Git-Tag: v1.3rc1~23 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=190fca12fae231e8015f64953e51205ea3996bdf;hp=9a74ead21248e61eee24165a0a9dd059f9f67a4d ftdi_eeprom: support channel configuration Previously, the channels could not be configured and were hard set to type UART and driver VCP and further to no RS485 functionality on chips with support for this feature. With the new 'chX_*' config file options the ftdi_eeprom tool is now abel to change the channel type, set the driver autoload decision (VCP od D2XX) and enable or disable RS485. The new config file options are: * ch[a,b]_type - string of: UART, FIFO, OPTO, CPU, FT1284 * ch[a,b,c,d]_vcp - bool: true for VCP, false for D2XX * ch[a,b,c,d]_rs485 - bool: true for RS485 enabled Signed-off-by: Stephan Linz --- diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c index b279223..edcfad7 100644 --- a/ftdi_eeprom/main.c +++ b/ftdi_eeprom/main.c @@ -109,6 +109,35 @@ static int parse_cbusx(cfg_t *cfg, cfg_opt_t *opt, const char *value, void *resu return -1; } +static int parse_chtype(cfg_t *cfg, cfg_opt_t *opt, const char *value, void *result) +{ + static const struct + { + char* key; + int opt; + } options[] = + { + { "UART", CHANNEL_IS_UART }, + { "FIFO", CHANNEL_IS_FIFO }, + { "OPTO", CHANNEL_IS_OPTO }, + { "CPU", CHANNEL_IS_CPU }, + { "FT1284", CHANNEL_IS_FT1284} + }; + + int i; + for (i=0; i