begin : Mon Apr 7 12:05:22 CEST 2003
copyright : (C) 2003-2014 by Intra2net AG and the libftdi developers
email : opensource@intra2net.com
+ SPDX-License-Identifier: GPL-2.0-only
***************************************************************************/
/***************************************************************************
return -1;
}
+static int parse_group0_drive(cfg_t *cfg, cfg_opt_t *opt, const char *value, void *result)
+{
+ static const char* options[] =
+ {
+ "4MA", "8MA", "12MA", "16MA"
+ };
+
+ int i;
+ for (i=0; i<sizeof(options)/sizeof(*options); i++)
+ {
+ if (!(strcasecmp(options[i], value)))
+ {
+ *(int *)result = i;
+ return 0;
+ }
+ }
+
+ cfg_error(cfg, "Invalid %s option '%s'", cfg_opt_name(opt), value);
+ return -1;
+}
+
static int parse_cbush(cfg_t *cfg, cfg_opt_t *opt, const char *value, void *result)
{
static const char* options[] =
CFG_INT_CB("cbusx1", -1, 0, parse_cbusx),
CFG_INT_CB("cbusx2", -1, 0, parse_cbusx),
CFG_INT_CB("cbusx3", -1, 0, parse_cbusx),
+ CFG_INT_CB("group0_drive", -1, 0, parse_group0_drive),
CFG_BOOL("invert_txd", cfg_false, 0),
CFG_BOOL("invert_rxd", cfg_false, 0),
CFG_BOOL("invert_rts", cfg_false, 0),
eeprom_set_value(ftdi, CBUS_FUNCTION_8, cfg_getint(cfg, "cbush8"));
if (cfg_getint(cfg, "cbush9") != -1)
eeprom_set_value(ftdi, CBUS_FUNCTION_9, cfg_getint(cfg, "cbush9"));
+ if (cfg_getint(cfg, "group0_drive") != -1)
+ eeprom_set_value(ftdi, GROUP0_DRIVE, cfg_getint(cfg, "group0_drive"));
}
else if (ftdi->type == TYPE_230X)
{