Azzera filtri
Azzera filtri

FTD2XX.h & Linux Tumbleweed & LIBFTD2XX.so.1.4.27

8 visualizzazioni (ultimi 30 giorni)
Gaston Melo
Gaston Melo il 19 Apr 2023
Hi to all, Im using Matlab on linux OS and Im trying to use the FTD2XX.h with matlab. I download the source code from FTDI home pag for linux and follow the instruccion to copy libraries on /usr/local/lib. Also I use modprobe to stop the ftdi_sio in linux and be able to use the ftd2xx.h with the device attached.
Im able to run examples like Read EEPROM of the device but with the matlab code I can't make it work. What I tried:
1) Loadlibrary from /usr/local/lib
2)Copy libraries and header in the folder where I have the m file
If I run the FTDI examples like read or write EEPROM from folder examples of FTDI, Im able to run it with problems. But with Matlab I can't even open the device. Could it be that the path to libraries is wrong?
the full code:
genpath(fullfile('/home/gaston/Matlab_mfiles'));
loadlibrary('libftd2xx.so.1.4.27','ftd2xx.h','alias','d2xx');
libfunctionsview ('d2xx')
device = 0;
nullp=libpointer('voidPtr',0);
%%%%%%
pid=libpointer('uint32Ptr',0);%DWORD is uint32
vid=libpointer('uint32Ptr',0);
%%%%%library
libraryV=libpointer('uint32Ptr',0);
%%%%%deviceinfo
ptrType=libpointer('uint32Ptr',0);
ptrID=libpointer('uint32Ptr',0);
arrayA=libpointer('cstring',blanks(20));
arrayB=libpointer('cstring',blanks(20));
%%%%%
ft_handle=libpointer('voidPtr',0);
ft_status=calllib('d2xx','FT_GetLibraryVersion',libraryV);
version=libraryV.value;
dec2hex(version,6)
ft_status=calllib('d2xx','FT_GetVIDPID',vid,pid);
get(vid)
get(pid)
ft_status=calllib('d2xx','FT_GetDeviceInfo',ft_handle,ptrType,ptrID,arrayA,arrayB,nullp);
ptrType.value
ptrID.value
arrayA.value
arrayB.value

Risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by