Giter Site home page Giter Site logo

happyprogrammer / visual-studio-ftdi-libmpsse-i2c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from douglasprodocimo/visual-studio-ftdi-libmpsse-i2c

1.0 1.0 0.0 7 KB

Ftdi MPSSE-I2C lib with Visual Studio 2017 x86_64. Isn't a project, this is just a "HOW TO" to compile the libMPSSE-I2C from FTDI to use with Visual Studio x84_64.

visual-studio-ftdi-libmpsse-i2c's Introduction

visual-studio-ftdi-libMPSSE-I2C

Ftdi MPSSE-I2C ou MPSSE-SPI lib with Visual Studio 2017 x86_64. Isn't a project, this is just a "HOW TO" to compile the libMPSSE-I2C from FTDI to use with Visual Studio x84_64.

Content

Due the mingw incompatibility with visual studio toolchain, is necessary a new compilation to provide useful libs for visual studio. The pre-compiled x86 libs are provided with the MPSSE lib, with version for visual studio x86 and mingw, but not the x86_64 version for visual studio. This tutorial demonstrate the use of lib.exe, a Visual Studio tool and dlltool.exe from mingw, to generate a compatible lib from the .def file generated by lib compilation with mingw64.

Compilling libMPSSE-I2C

  1. Download the source code from ftdi site: LibMPSSE-I2C_source.zip

  2. Download and Install mingw64 compiller and make.

  3. Follow the instructions in file "...\LibMPSSE-I2C\Documents\BuildProcedure_LibMPSSE.txt". The ompiler will generate the .obj, .a and .def files inside the folder "...\LibMPSSE-I2C\LibMPSSE\Build\Windows\"

Generate .lib with lib.exe from Visual Studio

In Visual Studio command prompt go to libMPSSE folder and type:

lib.exe /MACHINE:X64 /DEF:libMPSSE.def

Generate .lib with dlltool.exe from mingw

Go to the to libMPSSE folder and type:

dlltool.exe -d libMPSSE.def -D libMPSSE.dll -l libMPSSE.lib

To use the files in Visual Studio

  1. Copy the important project files, libMPSSE.dll, libMPSSE.lib from local folder, and the libMPSSE_i2c.h, WinTypes.h, ftd2xx.h from "...\LibMPSSE-I2C\Release\samples\I2C" folder to your Visual Studio's project folder.

  2. The last step is change the line inside WinTypes.h:

#include <sys/time.h>

to

#include <time.h>

Considerations

  • Some times lib.exe tool ignores some functions and do not exports to the .lib file, in this case use the dlltool.

  • You can generate a complete lib I2C + SPI, fot this you need do add the SPI source folder in the Topllayer folder from libMPSSE and modify the makefile as this makefile.

visual-studio-ftdi-libmpsse-i2c's People

Contributors

douglasprodocimo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.