libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.5-25-g4de44fe

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 29 Aug 2023 16:40:24 +0200 (CEST)
The branch, master has been updated
       via  4de44fefc63f112f5c804c191da101cd8252978f (commit)
      from  b7e2b9c53cb1bd4c42538dfb61502f805100bf89 (commit)


- Log -----------------------------------------------------------------
commit 4de44fefc63f112f5c804c191da101cd8252978f
Author: Chris Johnson <chris.a.johnson@xxxxxxxxxx>
Date:   Wed May 3 08:52:01 2023 -0500

    Introduce ftdi_set_module_detach_mode()
    
    Added a public setter to allow the usage of the
    AUTO_DETACH_REATACH_SIO_MODULE feature added in
    5bf1c1e3ff1616fda20c26cc3e3df7b807744c99.

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

Summary of changes:
 src/ftdi.c |   18 ++++++++++++++++++
 src/ftdi.h |    1 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 6b78fa3..534e3dd 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -2218,6 +2218,24 @@ int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned 
char bitmask, unsigned
 }
 
 /**
+    Set module detach mode.
+
+    \param ftdi pointer to ftdi_context
+    \param mode detach mode to use.
+
+    \retval  0: all fine
+    \retval -1: can't enable bitbang mode
+*/
+int ftdi_set_module_detach_mode(struct ftdi_context *ftdi, enum 
ftdi_module_detach_mode mode)
+{
+    if (ftdi == NULL)
+        ftdi_error_return(-1, "FTDI context invalid");
+
+    ftdi->module_detach_mode = mode;
+    return 0;
+}
+
+/**
     Disable bitbang mode.
 
     \param ftdi pointer to ftdi_context
diff --git a/src/ftdi.h b/src/ftdi.h
index 0603335..ffeb452 100644
--- a/src/ftdi.h
+++ b/src/ftdi.h
@@ -520,6 +520,7 @@ extern "C"
     int ftdi_init(struct ftdi_context *ftdi);
     struct ftdi_context *ftdi_new(void);
     int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface 
interface);
+    int ftdi_set_module_detach_mode(struct ftdi_context *ftdi, enum 
ftdi_module_detach_mode mode);
 
     void ftdi_deinit(struct ftdi_context *ftdi);
     void ftdi_free(struct ftdi_context *ftdi);


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.5-25-g4de44fe, libftdi-git <=