Skip to content

SwiftPM wrapper around the FTDI D2xx library.

License

Notifications You must be signed in to change notification settings

jurczo/spm-ftdi-d2xx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FTDI D2xx wrapper

As the wrapper had linker issues for now, it is converted into Framework with the plans to return back to pure Swift PM after some investigation.

Swift PM wrapper around the FTDI D2xx driver.

Example usage:

import FTDI

let candidates = try! FTDI.availableCandidates()
guard let serial = candidates.first?.serialNumber else {
   fatalError()
}
guard let handle = try? FTDI.open(using: .serialNumber, value: serial) else {
   fatalError()
}

do {
   try configure(handle, using: Configuration())
   let info = try describe(handle)
   print(info)
   
   try write(handle, string: "Hello, world!")
   let data = try read(handle, length: 30)
   
   try close(handle)
} catch {
    print(error)
    fatalError()
}

Libraries

EULA

Full FTDI D2xx license lives here.

ISC

The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

License

The MIT License (MIT)

Copyright (c) 2020 Tomáš Michalek See the file "LICENSE" for the full license governing this code.

About

SwiftPM wrapper around the FTDI D2xx library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 73.2%
  • Swift 21.2%
  • Objective-C 5.2%
  • Makefile 0.4%