libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.4-21-gc7db7f1

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 1 Oct 2019 15:15:08 +0200 (CEST)
The branch, master has been updated
       via  c7db7f11b21d5efe6f63f1a9b5f45c99ed6c1a5c (commit)
      from  3eca5150db07262c1c6eb737e12149201f631d47 (commit)


- Log -----------------------------------------------------------------
commit c7db7f11b21d5efe6f63f1a9b5f45c99ed6c1a5c
Author: Claudio Lanconelli <claudiolanconelli@xxxxxxxxx>
Date:   Tue Oct 1 15:11:54 2019 +0200

    ftdi_eeprom: Add support for group0 drive levels on x232H chips

-----------------------------------------------------------------------

Summary of changes:
 ftdi_eeprom/main.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c
index d1c4794..16c87c9 100644
--- a/ftdi_eeprom/main.c
+++ b/ftdi_eeprom/main.c
@@ -65,6 +65,27 @@ static int parse_cbus(cfg_t *cfg, cfg_opt_t *opt, const char 
*value, void *resul
     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[] =
@@ -236,6 +257,7 @@ int main(int argc, char *argv[])
         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),
@@ -479,6 +501,8 @@ int main(int argc, char *argv[])
             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)
     {


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.4-21-gc7db7f1, libftdi-git <=