5more mins

This commit is contained in:
[ Kristjan Komloši HomePC ]
2017-03-09 16:51:38 +01:00
parent fc7aa25c45
commit def99f209a
113 changed files with 13989 additions and 1033 deletions

View File

@@ -1,198 +0,0 @@
The system is: Linux - 4.6.0-kali1-amd64 - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in "/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/3.7.0/CompilerIdC/a.out"
Determining if the C compiler works passed with the following output:
Change Dir: /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_1b2c5/fast"
/usr/bin/make -f CMakeFiles/cmTC_1b2c5.dir/build.make CMakeFiles/cmTC_1b2c5.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_1b2c5.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_1b2c5.dir/testCCompiler.c.o -c /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_1b2c5
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1b2c5.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_1b2c5.dir/testCCompiler.c.o -o cmTC_1b2c5 -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Detecting C compiler ABI info compiled with the following output:
Change Dir: /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_2efa5/fast"
/usr/bin/make -f CMakeFiles/cmTC_2efa5.dir/build.make CMakeFiles/cmTC_2efa5.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o
/usr/bin/cc -o CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.7/Modules/CMakeCCompilerABI.c
Linking C executable cmTC_2efa5
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2efa5.dir/link.txt --verbose=1
/usr/bin/cc -v CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o -o cmTC_2efa5 -rdynamic
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.1.1-11' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.1.1 20160802 (Debian 6.1.1-11)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_2efa5' '-rdynamic' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper -plugin-opt=-fresolution=/tmp/ccILchqh.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_2efa5 /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtend.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_2efa5' '-rdynamic' '-mtune=generic' '-march=x86-64'
make[1]: Leaving directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Parsed C implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command:"/usr/bin/make" "cmTC_2efa5/fast"]
ignore line: [/usr/bin/make -f CMakeFiles/cmTC_2efa5.dir/build.make CMakeFiles/cmTC_2efa5.dir/build]
ignore line: [make[1]: Entering directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp']
ignore line: [Building C object CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o]
ignore line: [/usr/bin/cc -o CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.7/Modules/CMakeCCompilerABI.c]
ignore line: [Linking C executable cmTC_2efa5]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2efa5.dir/link.txt --verbose=1]
ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o -o cmTC_2efa5 -rdynamic ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Debian 6.1.1-11' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
ignore line: [Thread model: posix]
ignore line: [gcc version 6.1.1 20160802 (Debian 6.1.1-11) ]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_2efa5' '-rdynamic' '-mtune=generic' '-march=x86-64']
link line: [ /usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper -plugin-opt=-fresolution=/tmp/ccILchqh.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_2efa5 /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtend.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/6/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccILchqh.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [--sysroot=/] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [-export-dynamic] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-o] ==> ignore
arg [cmTC_2efa5] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crt1.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/crtbegin.o] ==> ignore
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib]
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../..]
arg [CMakeFiles/cmTC_2efa5.dir/CMakeCCompilerABI.c.o] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--no-as-needed] ==> ignore
arg [-lc] ==> lib [c]
arg [-lgcc] ==> lib [gcc]
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--no-as-needed] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/crtend.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o] ==> ignore
remove lib [gcc]
remove lib [gcc_s]
remove lib [gcc]
remove lib [gcc_s]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6] ==> [/usr/lib/gcc/x86_64-linux-gnu/6]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../..] ==> [/usr/lib]
implicit libs: [c]
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/6;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
implicit fwks: []
Detecting C [-std=c11] compiler features compiled with the following output:
Change Dir: /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_b46d3/fast"
/usr/bin/make -f CMakeFiles/cmTC_b46d3.dir/build.make CMakeFiles/cmTC_b46d3.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b46d3.dir/feature_tests.c.o
/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_b46d3.dir/feature_tests.c.o -c /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/feature_tests.c
Linking C executable cmTC_b46d3
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b46d3.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_b46d3.dir/feature_tests.c.o -o cmTC_b46d3 -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:1c_static_assert
Feature record: C_FEATURE:1c_variadic_macros
Detecting C [-std=c99] compiler features compiled with the following output:
Change Dir: /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_9070a/fast"
/usr/bin/make -f CMakeFiles/cmTC_9070a.dir/build.make CMakeFiles/cmTC_9070a.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9070a.dir/feature_tests.c.o
/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_9070a.dir/feature_tests.c.o -c /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/feature_tests.c
Linking C executable cmTC_9070a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9070a.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_9070a.dir/feature_tests.c.o -o cmTC_9070a -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:1c_variadic_macros
Detecting C [-std=c90] compiler features compiled with the following output:
Change Dir: /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_41719/fast"
/usr/bin/make -f CMakeFiles/cmTC_41719.dir/build.make CMakeFiles/cmTC_41719.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_41719.dir/feature_tests.c.o
/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_41719.dir/feature_tests.c.o -c /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/feature_tests.c
Linking C executable cmTC_41719
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_41719.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_41719.dir/feature_tests.c.o -o cmTC_41719 -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/CMakeTmp'
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:0c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:0c_variadic_macros

View File

@@ -1,109 +0,0 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
# The generator used is:
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"CMakeFiles/3.7.0/CMakeCCompiler.cmake"
"CMakeFiles/3.7.0/CMakeSystem.cmake"
"CMakeFiles/feature_tests.c"
"CMakeLists.txt"
"cmake/helpers/libusb_version.c"
"cmake/modules/FindLibUSB.cmake"
"include/CMakeLists.txt"
"lib/CMakeLists.txt"
"tools/CMakeLists.txt"
"/usr/share/cmake-3.7/Modules/CMakeCCompiler.cmake.in"
"/usr/share/cmake-3.7/Modules/CMakeCCompilerABI.c"
"/usr/share/cmake-3.7/Modules/CMakeCInformation.cmake"
"/usr/share/cmake-3.7/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/share/cmake-3.7/Modules/CMakeCompilerIdDetection.cmake"
"/usr/share/cmake-3.7/Modules/CMakeDetermineCCompiler.cmake"
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompileFeatures.cmake"
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompilerABI.cmake"
"/usr/share/cmake-3.7/Modules/CMakeDetermineCompilerId.cmake"
"/usr/share/cmake-3.7/Modules/CMakeDetermineSystem.cmake"
"/usr/share/cmake-3.7/Modules/CMakeFindBinUtils.cmake"
"/usr/share/cmake-3.7/Modules/CMakeGenericSystem.cmake"
"/usr/share/cmake-3.7/Modules/CMakeLanguageInformation.cmake"
"/usr/share/cmake-3.7/Modules/CMakeParseArguments.cmake"
"/usr/share/cmake-3.7/Modules/CMakeParseImplicitLinkInfo.cmake"
"/usr/share/cmake-3.7/Modules/CMakeSystem.cmake.in"
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake"
"/usr/share/cmake-3.7/Modules/CMakeTestCompilerCommon.cmake"
"/usr/share/cmake-3.7/Modules/CMakeUnixFindMake.cmake"
"/usr/share/cmake-3.7/Modules/CheckIncludeFile.cmake"
"/usr/share/cmake-3.7/Modules/CheckLibraryExists.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/ADSP-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Borland-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Clang-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Cray-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GHS-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GNU-C-FeatureTests.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GNU-C.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GNU-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GNU.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/HP-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/IAR-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Intel-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/MIPSpro-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/MSVC-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/PGI-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/PathScale-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/SCO-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/TI-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/Watcom-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/XL-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
"/usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake"
"/usr/share/cmake-3.7/Modules/FindPackageMessage.cmake"
"/usr/share/cmake-3.7/Modules/FindPkgConfig.cmake"
"/usr/share/cmake-3.7/Modules/GNUInstallDirs.cmake"
"/usr/share/cmake-3.7/Modules/Internal/FeatureTesting.cmake"
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU-C.cmake"
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU.cmake"
"/usr/share/cmake-3.7/Modules/Platform/Linux.cmake"
"/usr/share/cmake-3.7/Modules/Platform/UnixPaths.cmake"
)
# The corresponding makefile is:
set(CMAKE_MAKEFILE_OUTPUTS
"Makefile"
"CMakeFiles/cmake.check_cache"
)
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/3.7.0/CMakeSystem.cmake"
"CMakeFiles/3.7.0/CMakeCCompiler.cmake"
"CMakeFiles/3.7.0/CMakeCCompiler.cmake"
"CMakeFiles/CMakeDirectoryInformation.cmake"
"include/CMakeFiles/CMakeDirectoryInformation.cmake"
"lib/CMakeFiles/CMakeDirectoryInformation.cmake"
"tools/CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"lib/CMakeFiles/cyusbserial.dir/DependInfo.cmake"
"tools/CMakeFiles/cyusbserialtest.dir/DependInfo.cmake"
)

View File

@@ -1,26 +0,0 @@
/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/install/local.dir
/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/rebuild_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/install.dir
/root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/install/local.dir
/root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/rebuild_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/install.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/install/local.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/rebuild_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/install.dir
/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/install/local.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/install.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/cyusbserialtest.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/rebuild_cache.dir

View File

@@ -1,66 +0,0 @@
#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">])
#IncludeRegexScan: ^.*$
#IncludeRegexComplain: ^$
#IncludeRegexTransform:
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
stdio.h
-
io.h
-
unistd.h
-
stdlib.h
-
string.h
-
errno.h
-
fcntl.h
-
stdbool.h
-
pthread.h
-
libusb-1.0/libusb.h
-
CyUSBSerial.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBSerial.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyi2c.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyjtag.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cymisc.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyphdc.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyspi.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
signal.h
-
sys/time.h
-
/root/projekti/CyUSB/libcyusbserial-master/lib/cyuart.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyusb.c
CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
include/CyUSBSerial.h

View File

@@ -1,33 +0,0 @@
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
"C"
)
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_C
"/root/projekti/CyUSB/libcyusbserial-master/lib/cyi2c.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o"
"/root/projekti/CyUSB/libcyusbserial-master/lib/cyjtag.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o"
"/root/projekti/CyUSB/libcyusbserial-master/lib/cymisc.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cymisc.c.o"
"/root/projekti/CyUSB/libcyusbserial-master/lib/cyphdc.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o"
"/root/projekti/CyUSB/libcyusbserial-master/lib/cyspi.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cyspi.c.o"
"/root/projekti/CyUSB/libcyusbserial-master/lib/cyuart.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cyuart.c.o"
"/root/projekti/CyUSB/libcyusbserial-master/lib/cyusb.c" "/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/cyusb.c.o"
)
set(CMAKE_C_COMPILER_ID "GNU")
# The include file search paths:
set(CMAKE_C_TARGET_INCLUDE_PATH
"include"
)
# Pairs of files generated by the same build rule.
set(CMAKE_MULTIPLE_OUTPUT_PAIRS
"/root/projekti/CyUSB/libcyusbserial-master/lib/libcyusbserial.so" "/root/projekti/CyUSB/libcyusbserial-master/lib/libcyusbserial.so.1"
)
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@@ -1,31 +0,0 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyi2c.c
include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyjtag.c
include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cymisc.c
include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyphdc.c
include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyspi.c
include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyuart.c
include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o
/root/projekti/CyUSB/libcyusbserial-master/lib/CyUSBCommon.h
/root/projekti/CyUSB/libcyusbserial-master/lib/cyusb.c
include/CyUSBSerial.h

View File

@@ -1,31 +0,0 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: lib/cyi2c.c
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: lib/cyjtag.c
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: lib/cymisc.c
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: lib/cyphdc.c
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: lib/cyspi.c
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: lib/cyuart.c
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: lib/cyusb.c
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: include/CyUSBSerial.h

View File

@@ -1,6 +0,0 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: tools/cyusbserialtest.c
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: include/CyUSBSerial.h

View File

@@ -1 +0,0 @@
/usr/bin/cc CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o -o cyusbserialtest -Wl,-rpath,/root/projekti/CyUSB/libcyusbserial-master/lib:/usr/local/lib: -rdynamic ../lib/libcyusbserial.so.1 /usr/local/lib/libusb-1.0.so

48
release/autobuilder Executable file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
#AUTOBUILDER - semi-automated build system for TinI/O
export proceed=0 #global ok flag
proceed() #exits the program if proceed isn't true
{
if [ $proceed -eq 0 ]
then
echo "Error! The last action autobuild tried to perform failed."
exit 1
fi
proceed=0
}
setcolor()#sets the color of stdout to yellow
{
tput setaf 1
tput setab 7
}
resetcolor()
{
tput sgv0
}
#START
echo " --------------------------" #fancy banner!
echo " Autobuilder for TinI/O 0.1"
echo " --------------------------"
echo " Verifying main directory..."
[ -d cylib ] && [ -d tinio ] && proceed=1 #check if we're in the right dir
proceed #error check
echo " DONE!"
echo " Entering the library directory..."
cd cylib/build && proceed=1 #cd to the lib dir
proceed #error check
echo " DONE!"
echo " Compiling and installing the library..."
cmake .. && make && sudo make install && proceed=1 #compiles the lib
#according to the lib docs
proceed
echo " DONE!"
echo " Library installation complete."
echo " Going back..."
cd ../.. && proceed=1 #goes from cylib/build to cylib then to main dir
proceed
echo " DONE!"
sleep 1 # sleep for 1 sec to let the user see the output
echo " Entering the TinI/O build directory"
cd tinio && proceed=1
echo " DONE!"

View File

@@ -0,0 +1,142 @@
cmake_minimum_required(VERSION 2.8.4)
project(libcyusbserial C)
set(CMAKE_HELPERS_BINARY_DIR ${PROJECT_SOURCE_DIR}/cmake/helpers)
set(CMAKE_HELPERS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/cmake/helpers)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
include(FindLibUSB)
################################################################################
# System configuration
################################################################################
# OSX
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if(${isSystemDir} STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
endif()
# Windows
if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
find_package(LibPThreadsWin32)
if(LIBPTHREADSWIN32_FOUND)
set(WIN_RUNTIME_ITEMS ${WIN_RUNTIME_ITEMS}
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/pthreads-win32/COPYING.LIB.txt"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pthreadVC2.dll")
add_custom_command(
OUTPUT "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/pthreads-win32/COPYING.LIB.txt"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${LIBPTHREADSWIN32_LIB_COPYING}"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/pthreads-win32/COPYING.LIB.txt"
COMMENT "Copying pthreads-win32 license to output directory..."
)
add_custom_command(
OUTPUT "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pthreadVC2.dll"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${LIBPTHREADSWIN32_PATH}/dll/${LIBPTHREADSWIN32_LIBRARY_PATH_SUFFIX}/pthreadVC2.dll"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/"
COMMENT "Copying pthreadVC2.dll to output directory..."
)
endif(LIBPTHREADSWIN32_FOUND)
if(LIBUSB_FOUND)
set(WIN_RUNTIME_ITEMS ${WIN_RUNTIME_ITEMS}
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/libusb/COPYING"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libusb-1.0.dll")
# The libusb Windows release does not appear to include a COPYING file.
# Since it's LGPLv2.1, we'll copy the equivalent license from our
# license directory
add_custom_command(
OUTPUT "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/libusb/COPYING.LESSER.txt"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LESSER.txt"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/libusb/COPYING.LESSER.txt"
COMMENT "Copying libusb license to output directory..."
)
add_custom_command(
OUTPUT "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libusb-1.0.dll"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${LIBUSB_PATH}/${LIBUSB_LIBRARY_PATH_SUFFIX}/libusb-1.0.dll"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/"
COMMENT "Copying libusb-1.0.dll to output directory..."
)
endif(LIBUSB_FOUND)
set(WIN_RUNTIME_ITEMS ${WIN_RUNTIME_ITEMS}
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/libcyusbserial/COPYING.LESSER.txt"
)
add_custom_command(
OUTPUT "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/libcyusbserial/COPYING.LESSER.txt"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/COPYING.LESSER.txt"
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/licenses/libcyusbserial/COPYING.LESSER.txt"
COMMENT "Copying libcyusbserial COPYING.LESSER.txt file to output directory..."
)
include_directories(${PROJECT_SOURCE_DIR}/windows/include)
endif(WIN32 AND NOT CMAKE_CROSSCOMPILING)
################################################################################
# GCC and Clang
################################################################################
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_definitions(-Wall)
add_definitions(-Wextra)
add_definitions(-Wno-unused-parameter)
if(TREAT_WARNINGS_AS_ERRORS)
add_definitions(-Werror)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG=1)
add_definitions(-O0)
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
endif(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
CMAKE_C_COMPILER_ID STREQUAL "Clang")
################################################################################
# MS Visual Studio
################################################################################
if(MSVC)
if(TREAT_WARNINGS_AS_ERRORS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
endif()
# Prior to V12.0 2013, certain C99 headers we use were not supported.
# We have to supply our own.
if(MSVC_VERSION LESS 1800)
set(MSVC_C99_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/windows/include/c99)
endif()
endif(MSVC)
################################################################################
# Process subdirectories
################################################################################
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory(include)
add_subdirectory(lib)
# Only build the tools on Linux
if(NOT WIN32 OR CMAKE_CROSSCOMPILING)
add_subdirectory(tools)
endif(NOT WIN32 OR CMAKE_CROSSCOMPILING)

View File

@@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

2437
release/cylib/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

38
release/cylib/README.md Normal file
View File

@@ -0,0 +1,38 @@
# Cypress Semiconductor Corporation CyUSB Serial Library
[![LGPLv2.1+ License](http://img.shields.io/badge/license-LGPLv2.1+-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1.html)
[![Travis-CI Build Status](https://travis-ci.org/cyrozap/libcyusbserial.svg?branch=master)](https://travis-ci.org/cyrozap/libcyusbserial)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/2c5g7ncuqabs4h6m/branch/master?svg=true)](https://ci.appveyor.com/project/cyrozap/libcyusbserial/branch/master)
[![Coverity Scan](https://img.shields.io/coverity/scan/4500.svg)](https://scan.coverity.com/projects/cyrozap-libcyusbserial)
## Pre-requisites
1. libusb 1.0.9 (or higher) is required for compilation and functioning of the
APIs in the library.
2. GNU Make, the GCC toolchain, and CMake are used for the build process.
## Building the library and the test utility
1. Make a build directory and `cd` to it. Example: `mkdir build && cd build`
2. Run `cmake` on the source directory and then make. Example:
`cmake ../ && make`
3. Run `sudo make install` to install the header file, libraries, and test
utility into `PREFIX` (`/usr/local/` by default).
4. If you're on Linux, you might need to run `ldconfig` now.
5. You can now launch the application and communication with the Cypress
USB-Serial DVK in vendor mode.
## Note
Refer to the [CyUSBSerial API documentation][1] for descriptions of all the
vendor mode APIs. The header file of the library is in
`./include/CyUSBSerial.h`.
[1]: http://www.cypress.com/?docID=45725

View File

@@ -0,0 +1,23 @@
os: Visual Studio 2013
platform:
- x86
- x64
install:
- ps: (new-object System.Net.WebClient).Downloadfile("https://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.19/libusb-1.0.19-rc1-win.7z", "$($env:APPVEYOR_BUILD_FOLDER)\\libusb-1.0.19-rc1-win.7z")
- cmd: 7z x -y "%APPVEYOR_BUILD_FOLDER%\libusb-1.0.19-rc1-win.7z" -o"C:\Program Files\libusb-1.0.19"
- ps: (new-object System.Net.WebClient).Downloadfile("ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip", "$($env:APPVEYOR_BUILD_FOLDER)\\pthreads-w32-2-9-1-release.zip")
- cmd: 7z x -y "%APPVEYOR_BUILD_FOLDER%\pthreads-w32-2-9-1-release.zip" -o"%APPVEYOR_BUILD_FOLDER%\pthreads-w32-2-9-1-release"
- cmd: mv "%APPVEYOR_BUILD_FOLDER%\pthreads-w32-2-9-1-release\Pre-built.2" "C:\Program Files\pthreads-win32"
before_build:
- cmd: mkdir build
- cmd: chdir build
build_script:
- cmd: cmake ..
- cmd: cmake --build .
artifacts:
- path: build\lib\Debug\cyusbserial.dll

View File

@@ -1,5 +1,5 @@
# This is the CMakeCache file. # This is the CMakeCache file.
# For build in directory: /root/projekti/CyUSB/libcyusbserial-master # For build in directory: /root/projekti/CyUSB/release/cylib/build
# It was generated by CMake: /usr/bin/cmake # It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake. # You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor. # If you do not want to change any of the values, simply exit the editor.
@@ -195,13 +195,13 @@ CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config
//Dependencies for the target //Dependencies for the target
cyusbserial_LIB_DEPENDS:STATIC=general;/usr/local/lib/libusb-1.0.so; cyusbserial_LIB_DEPENDS:STATIC=general;-lpthread;general;/usr/local/lib/libusb-1.0.so;
//Value Computed by CMake //Value Computed by CMake
libcyusbserial_BINARY_DIR:STATIC=/root/projekti/CyUSB/libcyusbserial-master libcyusbserial_BINARY_DIR:STATIC=/root/projekti/CyUSB/release/cylib/build
//Value Computed by CMake //Value Computed by CMake
libcyusbserial_SOURCE_DIR:STATIC=/root/projekti/CyUSB/libcyusbserial-master libcyusbserial_SOURCE_DIR:STATIC=/root/projekti/CyUSB/release/cylib
//Path to a library. //Path to a library.
usb_LIBRARY:FILEPATH=/usr/local/lib/libusb-1.0.so usb_LIBRARY:FILEPATH=/usr/local/lib/libusb-1.0.so
@@ -214,13 +214,13 @@ usb_LIBRARY:FILEPATH=/usr/local/lib/libusb-1.0.so
//ADVANCED property for variable: CMAKE_AR //ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1 CMAKE_AR-ADVANCED:INTERNAL=1
//This is the directory where this CMakeCache.txt was created //This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/root/projekti/CyUSB/libcyusbserial-master CMAKE_CACHEFILE_DIR:INTERNAL=/root/projekti/CyUSB/release/cylib/build
//Major version of cmake used to create the current loaded cache //Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
//Minor version of cmake used to create the current loaded cache //Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=7 CMAKE_CACHE_MINOR_VERSION:INTERNAL=7
//Patch version of cmake used to create the current loaded cache //Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE //ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable. //Path to CMake executable.
@@ -263,9 +263,17 @@ CMAKE_GENERATOR:INTERNAL=Unix Makefiles
CMAKE_GENERATOR_PLATFORM:INTERNAL= CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset. //Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL= CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Have symbol pthread_create
CMAKE_HAVE_LIBC_CREATE:INTERNAL=
//Have library pthreads
CMAKE_HAVE_PTHREADS_CREATE:INTERNAL=
//Have library pthread
CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1
//Have include pthread.h
CMAKE_HAVE_PTHREAD_H:INTERNAL=1
//Source directory with the top level CMakeLists.txt file for this //Source directory with the top level CMakeLists.txt file for this
// project // project
CMAKE_HOME_DIRECTORY:INTERNAL=/root/projekti/CyUSB/libcyusbserial-master CMAKE_HOME_DIRECTORY:INTERNAL=/root/projekti/CyUSB/release/cylib
//ADVANCED property for variable: CMAKE_INSTALL_BINDIR //ADVANCED property for variable: CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_BINDIR-ADVANCED:INTERNAL=1 CMAKE_INSTALL_BINDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DATADIR //ADVANCED property for variable: CMAKE_INSTALL_DATADIR
@@ -356,6 +364,8 @@ CMAKE_UNAME:INTERNAL=/bin/uname
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//Details about finding PkgConfig //Details about finding PkgConfig
FIND_PACKAGE_MESSAGE_DETAILS_PkgConfig:INTERNAL=[/usr/bin/pkg-config][v0.29()] FIND_PACKAGE_MESSAGE_DETAILS_PkgConfig:INTERNAL=[/usr/bin/pkg-config][v0.29()]
//Details about finding Threads
FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()]
//Result of TRY_COMPILE //Result of TRY_COMPILE
LIBUSB_VERCHECK_COMPILED:INTERNAL=TRUE LIBUSB_VERCHECK_COMPILED:INTERNAL=TRUE
//Result of TRY_RUN //Result of TRY_RUN

View File

@@ -1,7 +1,7 @@
set(CMAKE_C_COMPILER "/usr/bin/cc") set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_C_COMPILER_ARG1 "") set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "GNU") set(CMAKE_C_COMPILER_ID "GNU")
set(CMAKE_C_COMPILER_VERSION "6.1.1") set(CMAKE_C_COMPILER_VERSION "6.3.0")
set(CMAKE_C_COMPILER_WRAPPER "") set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert") set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert")

View File

@@ -1,13 +1,13 @@
set(CMAKE_HOST_SYSTEM "Linux-4.6.0-kali1-amd64") set(CMAKE_HOST_SYSTEM "Linux-4.9.0-kali2-amd64")
set(CMAKE_HOST_SYSTEM_NAME "Linux") set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "4.6.0-kali1-amd64") set(CMAKE_HOST_SYSTEM_VERSION "4.9.0-kali2-amd64")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-4.6.0-kali1-amd64") set(CMAKE_SYSTEM "Linux-4.9.0-kali2-amd64")
set(CMAKE_SYSTEM_NAME "Linux") set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "4.6.0-kali1-amd64") set(CMAKE_SYSTEM_VERSION "4.9.0-kali2-amd64")
set(CMAKE_SYSTEM_PROCESSOR "x86_64") set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE") set(CMAKE_CROSSCOMPILING "FALSE")

Binary file not shown.

View File

@@ -2,8 +2,8 @@
# Generated by "Unix Makefiles" Generator, CMake Version 3.7 # Generated by "Unix Makefiles" Generator, CMake Version 3.7
# Relative path conversion top directories. # Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/release/cylib")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/release/cylib/build")
# Force unix paths in dependencies. # Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1) set(CMAKE_FORCE_UNIX_PATHS 1)

View File

@@ -0,0 +1,55 @@
Determining if the pthread_create exist failed with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_b2324/fast"
/usr/bin/make -f CMakeFiles/cmTC_b2324.dir/build.make CMakeFiles/cmTC_b2324.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b2324.dir/CheckSymbolExists.c.o
/usr/bin/cc -I/usr/local/include/libusb-1.0 -o CMakeFiles/cmTC_b2324.dir/CheckSymbolExists.c.o -c /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_b2324
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b2324.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_b2324.dir/CheckSymbolExists.c.o -o cmTC_b2324 -rdynamic
CMakeFiles/cmTC_b2324.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_b2324.dir/build.make:97: recipe for target 'cmTC_b2324' failed
make[1]: *** [cmTC_b2324] Error 1
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_b2324/fast' failed
make: *** [cmTC_b2324/fast] Error 2
File /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_f6be8/fast"
/usr/bin/make -f CMakeFiles/cmTC_f6be8.dir/build.make CMakeFiles/cmTC_f6be8.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f6be8.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_f6be8.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.7/Modules/CheckFunctionExists.c
Linking C executable cmTC_f6be8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f6be8.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_f6be8.dir/CheckFunctionExists.c.o -o cmTC_f6be8 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_f6be8.dir/build.make:97: recipe for target 'cmTC_f6be8' failed
make[1]: *** [cmTC_f6be8] Error 1
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_f6be8/fast' failed
make: *** [cmTC_f6be8/fast] Error 2

View File

@@ -0,0 +1,227 @@
The system is: Linux - 4.9.0-kali2-amd64 - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in "/root/projekti/CyUSB/release/cylib/build/CMakeFiles/3.7.2/CompilerIdC/a.out"
Determining if the C compiler works passed with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_4bf42/fast"
/usr/bin/make -f CMakeFiles/cmTC_4bf42.dir/build.make CMakeFiles/cmTC_4bf42.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_4bf42.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_4bf42.dir/testCCompiler.c.o -c /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_4bf42
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4bf42.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_4bf42.dir/testCCompiler.c.o -o cmTC_4bf42 -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Detecting C compiler ABI info compiled with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_39aa0/fast"
/usr/bin/make -f CMakeFiles/cmTC_39aa0.dir/build.make CMakeFiles/cmTC_39aa0.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o
/usr/bin/cc -o CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.7/Modules/CMakeCCompilerABI.c
Linking C executable cmTC_39aa0
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_39aa0.dir/link.txt --verbose=1
/usr/bin/cc -v CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o -o cmTC_39aa0 -rdynamic
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170205 (Debian 6.3.0-6)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_39aa0' '-rdynamic' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper -plugin-opt=-fresolution=/tmp/ccYqCjNB.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_39aa0 /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_39aa0' '-rdynamic' '-mtune=generic' '-march=x86-64'
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Parsed C implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command:"/usr/bin/make" "cmTC_39aa0/fast"]
ignore line: [/usr/bin/make -f CMakeFiles/cmTC_39aa0.dir/build.make CMakeFiles/cmTC_39aa0.dir/build]
ignore line: [make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp']
ignore line: [Building C object CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o]
ignore line: [/usr/bin/cc -o CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.7/Modules/CMakeCCompilerABI.c]
ignore line: [Linking C executable cmTC_39aa0]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_39aa0.dir/link.txt --verbose=1]
ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o -o cmTC_39aa0 -rdynamic ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper]
ignore line: [Target: x86_64-linux-gnu]
ignore line: [Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
ignore line: [Thread model: posix]
ignore line: [gcc version 6.3.0 20170205 (Debian 6.3.0-6) ]
ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_39aa0' '-rdynamic' '-mtune=generic' '-march=x86-64']
link line: [ /usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper -plugin-opt=-fresolution=/tmp/ccYqCjNB.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o cmTC_39aa0 /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/6/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccYqCjNB.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [--sysroot=/] ==> ignore
arg [--build-id] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [-export-dynamic] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-pie] ==> ignore
arg [-o] ==> ignore
arg [cmTC_39aa0] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o] ==> ignore
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib]
arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
arg [-L/lib/../lib] ==> dir [/lib/../lib]
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/6/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../..]
arg [CMakeFiles/cmTC_39aa0.dir/CMakeCCompilerABI.c.o] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--no-as-needed] ==> ignore
arg [-lc] ==> lib [c]
arg [-lgcc] ==> lib [gcc]
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--no-as-needed] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o] ==> ignore
remove lib [gcc]
remove lib [gcc_s]
remove lib [gcc]
remove lib [gcc_s]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6] ==> [/usr/lib/gcc/x86_64-linux-gnu/6]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib] ==> [/usr/lib]
collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
collapse library dir [/lib/../lib] ==> [/lib]
collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/6/../../..] ==> [/usr/lib]
implicit libs: [c]
implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/6;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
implicit fwks: []
Detecting C [-std=c11] compiler features compiled with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_98c40/fast"
/usr/bin/make -f CMakeFiles/cmTC_98c40.dir/build.make CMakeFiles/cmTC_98c40.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_98c40.dir/feature_tests.c.o
/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_98c40.dir/feature_tests.c.o -c /root/projekti/CyUSB/release/cylib/build/CMakeFiles/feature_tests.c
Linking C executable cmTC_98c40
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_98c40.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_98c40.dir/feature_tests.c.o -o cmTC_98c40 -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:1c_static_assert
Feature record: C_FEATURE:1c_variadic_macros
Detecting C [-std=c99] compiler features compiled with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_9784e/fast"
/usr/bin/make -f CMakeFiles/cmTC_9784e.dir/build.make CMakeFiles/cmTC_9784e.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9784e.dir/feature_tests.c.o
/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_9784e.dir/feature_tests.c.o -c /root/projekti/CyUSB/release/cylib/build/CMakeFiles/feature_tests.c
Linking C executable cmTC_9784e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9784e.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_9784e.dir/feature_tests.c.o -o cmTC_9784e -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:1c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:1c_variadic_macros
Detecting C [-std=c90] compiler features compiled with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a77f2/fast"
/usr/bin/make -f CMakeFiles/cmTC_a77f2.dir/build.make CMakeFiles/cmTC_a77f2.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a77f2.dir/feature_tests.c.o
/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_a77f2.dir/feature_tests.c.o -c /root/projekti/CyUSB/release/cylib/build/CMakeFiles/feature_tests.c
Linking C executable cmTC_a77f2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a77f2.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_a77f2.dir/feature_tests.c.o -o cmTC_a77f2 -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Feature record: C_FEATURE:1c_function_prototypes
Feature record: C_FEATURE:0c_restrict
Feature record: C_FEATURE:0c_static_assert
Feature record: C_FEATURE:0c_variadic_macros
Determining if the include file pthread.h exists passed with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_7956f/fast"
/usr/bin/make -f CMakeFiles/cmTC_7956f.dir/build.make CMakeFiles/cmTC_7956f.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7956f.dir/CheckIncludeFile.c.o
/usr/bin/cc -I/usr/local/include/libusb-1.0 -o CMakeFiles/cmTC_7956f.dir/CheckIncludeFile.c.o -c /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
Linking C executable cmTC_7956f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7956f.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_7956f.dir/CheckIncludeFile.c.o -o cmTC_7956f -rdynamic
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Determining if the function pthread_create exists in the pthread passed with the following output:
Change Dir: /root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_89d9a/fast"
/usr/bin/make -f CMakeFiles/cmTC_89d9a.dir/build.make CMakeFiles/cmTC_89d9a.dir/build
make[1]: Entering directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_89d9a.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_89d9a.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.7/Modules/CheckFunctionExists.c
Linking C executable cmTC_89d9a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_89d9a.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_89d9a.dir/CheckFunctionExists.c.o -o cmTC_89d9a -rdynamic -lpthread
make[1]: Leaving directory '/root/projekti/CyUSB/release/cylib/build/CMakeFiles/CMakeTmp'

View File

@@ -0,0 +1,58 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
# The generator used is:
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"../CMakeLists.txt"
"CMakeFiles/3.7.2/CMakeCCompiler.cmake"
"CMakeFiles/3.7.2/CMakeSystem.cmake"
"../cmake/helpers/libusb_version.c"
"../cmake/modules/FindLibUSB.cmake"
"../include/CMakeLists.txt"
"../lib/CMakeLists.txt"
"../tools/CMakeLists.txt"
"/usr/share/cmake-3.7/Modules/CMakeCInformation.cmake"
"/usr/share/cmake-3.7/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/share/cmake-3.7/Modules/CMakeGenericSystem.cmake"
"/usr/share/cmake-3.7/Modules/CMakeLanguageInformation.cmake"
"/usr/share/cmake-3.7/Modules/CMakeParseArguments.cmake"
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/share/cmake-3.7/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/share/cmake-3.7/Modules/CheckIncludeFile.cmake"
"/usr/share/cmake-3.7/Modules/CheckLibraryExists.cmake"
"/usr/share/cmake-3.7/Modules/CheckSymbolExists.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GNU-C.cmake"
"/usr/share/cmake-3.7/Modules/Compiler/GNU.cmake"
"/usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake"
"/usr/share/cmake-3.7/Modules/FindPackageMessage.cmake"
"/usr/share/cmake-3.7/Modules/FindPkgConfig.cmake"
"/usr/share/cmake-3.7/Modules/FindThreads.cmake"
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU-C.cmake"
"/usr/share/cmake-3.7/Modules/Platform/Linux-GNU.cmake"
"/usr/share/cmake-3.7/Modules/Platform/Linux.cmake"
"/usr/share/cmake-3.7/Modules/Platform/UnixPaths.cmake"
)
# The corresponding makefile is:
set(CMAKE_MAKEFILE_OUTPUTS
"Makefile"
"CMakeFiles/cmake.check_cache"
)
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/CMakeDirectoryInformation.cmake"
"include/CMakeFiles/CMakeDirectoryInformation.cmake"
"lib/CMakeFiles/CMakeDirectoryInformation.cmake"
"tools/CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"lib/CMakeFiles/cyusbserial.dir/DependInfo.cmake"
"tools/CMakeFiles/cyusbserialtest.dir/DependInfo.cmake"
)

View File

@@ -54,10 +54,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
#============================================================================= #=============================================================================
# Directory level rules for directory include # Directory level rules for directory include
@@ -102,7 +102,7 @@ lib/preinstall:
lib/CMakeFiles/cyusbserial.dir/all: lib/CMakeFiles/cyusbserial.dir/all:
$(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/depend $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/depend
$(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/build $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=1,2,3,4,5,6,7,8 "Built target cyusbserial" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=1,2,3,4,5,6,7,8 "Built target cyusbserial"
.PHONY : lib/CMakeFiles/cyusbserial.dir/all .PHONY : lib/CMakeFiles/cyusbserial.dir/all
# Include target in all. # Include target in all.
@@ -112,9 +112,9 @@ all: lib/CMakeFiles/cyusbserial.dir/all
# Build rule for subdir invocation for target. # Build rule for subdir invocation for target.
lib/CMakeFiles/cyusbserial.dir/rule: cmake_check_build_system lib/CMakeFiles/cyusbserial.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 8 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 8
$(MAKE) -f CMakeFiles/Makefile2 lib/CMakeFiles/cyusbserial.dir/all $(MAKE) -f CMakeFiles/Makefile2 lib/CMakeFiles/cyusbserial.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 0 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 0
.PHONY : lib/CMakeFiles/cyusbserial.dir/rule .PHONY : lib/CMakeFiles/cyusbserial.dir/rule
# Convenience name for target. # Convenience name for target.
@@ -157,7 +157,7 @@ tools/preinstall:
tools/CMakeFiles/cyusbserialtest.dir/all: lib/CMakeFiles/cyusbserial.dir/all tools/CMakeFiles/cyusbserialtest.dir/all: lib/CMakeFiles/cyusbserial.dir/all
$(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/depend $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/depend
$(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/build $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=9,10 "Built target cyusbserialtest" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=9,10 "Built target cyusbserialtest"
.PHONY : tools/CMakeFiles/cyusbserialtest.dir/all .PHONY : tools/CMakeFiles/cyusbserialtest.dir/all
# Include target in all. # Include target in all.
@@ -167,9 +167,9 @@ all: tools/CMakeFiles/cyusbserialtest.dir/all
# Build rule for subdir invocation for target. # Build rule for subdir invocation for target.
tools/CMakeFiles/cyusbserialtest.dir/rule: cmake_check_build_system tools/CMakeFiles/cyusbserialtest.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 10 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 10
$(MAKE) -f CMakeFiles/Makefile2 tools/CMakeFiles/cyusbserialtest.dir/all $(MAKE) -f CMakeFiles/Makefile2 tools/CMakeFiles/cyusbserialtest.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 0 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 0
.PHONY : tools/CMakeFiles/cyusbserialtest.dir/rule .PHONY : tools/CMakeFiles/cyusbserialtest.dir/rule
# Convenience name for target. # Convenience name for target.

View File

@@ -0,0 +1,26 @@
/root/projekti/CyUSB/release/cylib/build/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/release/cylib/build/CMakeFiles/install/local.dir
/root/projekti/CyUSB/release/cylib/build/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/release/cylib/build/CMakeFiles/rebuild_cache.dir
/root/projekti/CyUSB/release/cylib/build/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/release/cylib/build/CMakeFiles/install.dir
/root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/install/local.dir
/root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/rebuild_cache.dir
/root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/install.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/install/local.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/rebuild_cache.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/install.dir
/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/install/strip.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/install/local.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/install.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/list_install_components.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/cyusbserialtest.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/edit_cache.dir
/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/rebuild_cache.dir

Binary file not shown.

View File

@@ -48,10 +48,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
#============================================================================= #=============================================================================
# Targets provided globally by CMake. # Targets provided globally by CMake.
@@ -124,9 +124,9 @@ install/fast: preinstall/fast
# The main all target # The main all target
all: cmake_check_build_system all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles/progress.marks $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles /root/projekti/CyUSB/release/cylib/build/CMakeFiles/progress.marks
$(MAKE) -f CMakeFiles/Makefile2 all $(MAKE) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 0 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 0
.PHONY : all .PHONY : all
# The main clean target # The main clean target

View File

@@ -1,4 +1,4 @@
# Install script for directory: /root/projekti/CyUSB/libcyusbserial-master # Install script for directory: /root/projekti/CyUSB/release/cylib
# Set the install prefix # Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -34,9 +34,9 @@ endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY) if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory. # Include the install script for each subdirectory.
include("/root/projekti/CyUSB/libcyusbserial-master/include/cmake_install.cmake") include("/root/projekti/CyUSB/release/cylib/build/include/cmake_install.cmake")
include("/root/projekti/CyUSB/libcyusbserial-master/lib/cmake_install.cmake") include("/root/projekti/CyUSB/release/cylib/build/lib/cmake_install.cmake")
include("/root/projekti/CyUSB/libcyusbserial-master/tools/cmake_install.cmake") include("/root/projekti/CyUSB/release/cylib/build/tools/cmake_install.cmake")
endif() endif()
@@ -48,5 +48,5 @@ endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}") "${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/root/projekti/CyUSB/libcyusbserial-master/${CMAKE_INSTALL_MANIFEST}" file(WRITE "/root/projekti/CyUSB/release/cylib/build/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}") "${CMAKE_INSTALL_MANIFEST_CONTENT}")

View File

@@ -2,8 +2,8 @@
# Generated by "Unix Makefiles" Generator, CMake Version 3.7 # Generated by "Unix Makefiles" Generator, CMake Version 3.7
# Relative path conversion top directories. # Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/release/cylib")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/release/cylib/build")
# Force unix paths in dependencies. # Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1) set(CMAKE_FORCE_UNIX_PATHS 1)

View File

@@ -48,10 +48,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
#============================================================================= #=============================================================================
# Targets provided globally by CMake. # Targets provided globally by CMake.
@@ -124,14 +124,14 @@ install/fast: preinstall/fast
# The main all target # The main all target
all: cmake_check_build_system all: cmake_check_build_system
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles /root/projekti/CyUSB/libcyusbserial-master/include/CMakeFiles/progress.marks cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles /root/projekti/CyUSB/release/cylib/build/include/CMakeFiles/progress.marks
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 include/all cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 include/all
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 0 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 0
.PHONY : all .PHONY : all
# The main clean target # The main clean target
clean: clean:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 include/clean cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 include/clean
.PHONY : clean .PHONY : clean
# The main clean target # The main clean target
@@ -141,17 +141,17 @@ clean/fast: clean
# Prepare targets for installation. # Prepare targets for installation.
preinstall: all preinstall: all
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 include/preinstall cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 include/preinstall
.PHONY : preinstall .PHONY : preinstall
# Prepare targets for installation. # Prepare targets for installation.
preinstall/fast: preinstall/fast:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 include/preinstall cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 include/preinstall
.PHONY : preinstall/fast .PHONY : preinstall/fast
# clear depends # clear depends
depend: depend:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend .PHONY : depend
# Help Target # Help Target
@@ -177,6 +177,6 @@ help:
# No rule that depends on this can have commands that come from listfiles # No rule that depends on this can have commands that come from listfiles
# because they might be regenerated. # because they might be regenerated.
cmake_check_build_system: cmake_check_build_system:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system .PHONY : cmake_check_build_system

View File

@@ -1,4 +1,4 @@
# Install script for directory: /root/projekti/CyUSB/libcyusbserial-master/include # Install script for directory: /root/projekti/CyUSB/release/cylib/include
# Set the install prefix # Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -33,6 +33,6 @@ if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
endif() endif()
if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES "/root/projekti/CyUSB/libcyusbserial-master/include/CyUSBSerial.h") file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES "/root/projekti/CyUSB/release/cylib/include/CyUSBSerial.h")
endif() endif()

View File

@@ -2,8 +2,8 @@
# Generated by "Unix Makefiles" Generator, CMake Version 3.7 # Generated by "Unix Makefiles" Generator, CMake Version 3.7
# Relative path conversion top directories. # Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/release/cylib")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/release/cylib/build")
# Force unix paths in dependencies. # Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1) set(CMAKE_FORCE_UNIX_PATHS 1)

View File

@@ -0,0 +1,80 @@
#IncludeRegexLine: ^[ ]*#[ ]*(include|import)[ ]*[<"]([^">]+)([">])
#IncludeRegexScan: ^.*$
#IncludeRegexComplain: ^$
#IncludeRegexTransform:
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
stdio.h
-
io.h
-
unistd.h
-
stdlib.h
-
string.h
-
errno.h
-
fcntl.h
-
stdbool.h
-
pthread.h
-
libusb.h
-
CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/cyi2c.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyjtag.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cymisc.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyphdc.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyspi.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
signal.h
-
sys/time.h
-
/root/projekti/CyUSB/release/cylib/lib/cyuart.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyusb.c
CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/usr/local/include/libusb-1.0/libusb.h
stdint.h
-
sys/types.h
-
time.h
-
limits.h
-
sys/time.h
-
windows.h
-

View File

@@ -0,0 +1,35 @@
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
"C"
)
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_C
"/root/projekti/CyUSB/release/cylib/lib/cyi2c.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o"
"/root/projekti/CyUSB/release/cylib/lib/cyjtag.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o"
"/root/projekti/CyUSB/release/cylib/lib/cymisc.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cymisc.c.o"
"/root/projekti/CyUSB/release/cylib/lib/cyphdc.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o"
"/root/projekti/CyUSB/release/cylib/lib/cyspi.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cyspi.c.o"
"/root/projekti/CyUSB/release/cylib/lib/cyuart.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cyuart.c.o"
"/root/projekti/CyUSB/release/cylib/lib/cyusb.c" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/cyusb.c.o"
)
set(CMAKE_C_COMPILER_ID "GNU")
# The include file search paths:
set(CMAKE_C_TARGET_INCLUDE_PATH
"../include"
"../lib/../include"
"/usr/local/include/libusb-1.0"
)
# Pairs of files generated by the same build rule.
set(CMAKE_MULTIPLE_OUTPUT_PAIRS
"/root/projekti/CyUSB/release/cylib/build/lib/libcyusbserial.so" "/root/projekti/CyUSB/release/cylib/build/lib/libcyusbserial.so.1"
)
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

View File

@@ -43,10 +43,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
# Include any dependencies generated for this target. # Include any dependencies generated for this target.
include lib/CMakeFiles/cyusbserial.dir/depend.make include lib/CMakeFiles/cyusbserial.dir/depend.make
@@ -58,17 +58,17 @@ include lib/CMakeFiles/cyusbserial.dir/progress.make
include lib/CMakeFiles/cyusbserial.dir/flags.make include lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: lib/cyusb.c lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: ../lib/cyusb.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object lib/CMakeFiles/cyusbserial.dir/cyusb.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object lib/CMakeFiles/cyusbserial.dir/cyusb.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyusb.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cyusb.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyusb.c.o -c /root/projekti/CyUSB/release/cylib/lib/cyusb.c
lib/CMakeFiles/cyusbserial.dir/cyusb.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cyusb.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyusb.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyusb.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cyusb.c > CMakeFiles/cyusbserial.dir/cyusb.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cyusb.c > CMakeFiles/cyusbserial.dir/cyusb.c.i
lib/CMakeFiles/cyusbserial.dir/cyusb.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cyusb.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyusb.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyusb.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cyusb.c -o CMakeFiles/cyusbserial.dir/cyusb.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cyusb.c -o CMakeFiles/cyusbserial.dir/cyusb.c.s
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cyusb.c.o.requires:
@@ -82,17 +82,17 @@ lib/CMakeFiles/cyusbserial.dir/cyusb.c.o.provides.build: lib/CMakeFiles/cyusbser
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: lib/cyuart.c lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: ../lib/cyuart.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object lib/CMakeFiles/cyusbserial.dir/cyuart.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object lib/CMakeFiles/cyusbserial.dir/cyuart.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyuart.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cyuart.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyuart.c.o -c /root/projekti/CyUSB/release/cylib/lib/cyuart.c
lib/CMakeFiles/cyusbserial.dir/cyuart.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cyuart.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyuart.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyuart.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cyuart.c > CMakeFiles/cyusbserial.dir/cyuart.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cyuart.c > CMakeFiles/cyusbserial.dir/cyuart.c.i
lib/CMakeFiles/cyusbserial.dir/cyuart.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cyuart.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyuart.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyuart.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cyuart.c -o CMakeFiles/cyusbserial.dir/cyuart.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cyuart.c -o CMakeFiles/cyusbserial.dir/cyuart.c.s
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cyuart.c.o.requires:
@@ -106,17 +106,17 @@ lib/CMakeFiles/cyusbserial.dir/cyuart.c.o.provides.build: lib/CMakeFiles/cyusbse
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: lib/cyi2c.c lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: ../lib/cyi2c.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyi2c.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cyi2c.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyi2c.c.o -c /root/projekti/CyUSB/release/cylib/lib/cyi2c.c
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cyi2c.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyi2c.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyi2c.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cyi2c.c > CMakeFiles/cyusbserial.dir/cyi2c.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cyi2c.c > CMakeFiles/cyusbserial.dir/cyi2c.c.i
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cyi2c.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyi2c.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyi2c.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cyi2c.c -o CMakeFiles/cyusbserial.dir/cyi2c.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cyi2c.c -o CMakeFiles/cyusbserial.dir/cyi2c.c.s
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o.requires:
@@ -130,17 +130,17 @@ lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o.provides.build: lib/CMakeFiles/cyusbser
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: lib/cyspi.c lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: ../lib/cyspi.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building C object lib/CMakeFiles/cyusbserial.dir/cyspi.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building C object lib/CMakeFiles/cyusbserial.dir/cyspi.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyspi.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cyspi.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyspi.c.o -c /root/projekti/CyUSB/release/cylib/lib/cyspi.c
lib/CMakeFiles/cyusbserial.dir/cyspi.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cyspi.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyspi.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyspi.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cyspi.c > CMakeFiles/cyusbserial.dir/cyspi.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cyspi.c > CMakeFiles/cyusbserial.dir/cyspi.c.i
lib/CMakeFiles/cyusbserial.dir/cyspi.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cyspi.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyspi.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyspi.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cyspi.c -o CMakeFiles/cyusbserial.dir/cyspi.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cyspi.c -o CMakeFiles/cyusbserial.dir/cyspi.c.s
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cyspi.c.o.requires:
@@ -154,17 +154,17 @@ lib/CMakeFiles/cyusbserial.dir/cyspi.c.o.provides.build: lib/CMakeFiles/cyusbser
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: lib/cyphdc.c lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: ../lib/cyphdc.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building C object lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building C object lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyphdc.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cyphdc.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyphdc.c.o -c /root/projekti/CyUSB/release/cylib/lib/cyphdc.c
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cyphdc.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyphdc.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyphdc.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cyphdc.c > CMakeFiles/cyusbserial.dir/cyphdc.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cyphdc.c > CMakeFiles/cyusbserial.dir/cyphdc.c.i
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cyphdc.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyphdc.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyphdc.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cyphdc.c -o CMakeFiles/cyusbserial.dir/cyphdc.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cyphdc.c -o CMakeFiles/cyusbserial.dir/cyphdc.c.s
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o.requires:
@@ -178,17 +178,17 @@ lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o.provides.build: lib/CMakeFiles/cyusbse
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: lib/cyjtag.c lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: ../lib/cyjtag.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building C object lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building C object lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyjtag.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cyjtag.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cyjtag.c.o -c /root/projekti/CyUSB/release/cylib/lib/cyjtag.c
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cyjtag.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyjtag.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cyjtag.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cyjtag.c > CMakeFiles/cyusbserial.dir/cyjtag.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cyjtag.c > CMakeFiles/cyusbserial.dir/cyjtag.c.i
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cyjtag.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyjtag.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cyjtag.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cyjtag.c -o CMakeFiles/cyusbserial.dir/cyjtag.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cyjtag.c -o CMakeFiles/cyusbserial.dir/cyjtag.c.s
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o.requires:
@@ -202,17 +202,17 @@ lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o.provides.build: lib/CMakeFiles/cyusbse
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: lib/CMakeFiles/cyusbserial.dir/flags.make
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: lib/cymisc.c lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: ../lib/cymisc.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building C object lib/CMakeFiles/cyusbserial.dir/cymisc.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building C object lib/CMakeFiles/cyusbserial.dir/cymisc.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cymisc.c.o -c /root/projekti/CyUSB/libcyusbserial-master/lib/cymisc.c cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserial.dir/cymisc.c.o -c /root/projekti/CyUSB/release/cylib/lib/cymisc.c
lib/CMakeFiles/cyusbserial.dir/cymisc.c.i: cmake_force lib/CMakeFiles/cyusbserial.dir/cymisc.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cymisc.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserial.dir/cymisc.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/lib/cymisc.c > CMakeFiles/cyusbserial.dir/cymisc.c.i cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/lib/cymisc.c > CMakeFiles/cyusbserial.dir/cymisc.c.i
lib/CMakeFiles/cyusbserial.dir/cymisc.c.s: cmake_force lib/CMakeFiles/cyusbserial.dir/cymisc.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cymisc.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserial.dir/cymisc.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/lib/cymisc.c -o CMakeFiles/cyusbserial.dir/cymisc.c.s cd /root/projekti/CyUSB/release/cylib/build/lib && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/lib/cymisc.c -o CMakeFiles/cyusbserial.dir/cymisc.c.s
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o.requires: lib/CMakeFiles/cyusbserial.dir/cymisc.c.o.requires:
@@ -248,9 +248,9 @@ lib/libcyusbserial.so.1: lib/CMakeFiles/cyusbserial.dir/cymisc.c.o
lib/libcyusbserial.so.1: lib/CMakeFiles/cyusbserial.dir/build.make lib/libcyusbserial.so.1: lib/CMakeFiles/cyusbserial.dir/build.make
lib/libcyusbserial.so.1: /usr/local/lib/libusb-1.0.so lib/libcyusbserial.so.1: /usr/local/lib/libusb-1.0.so
lib/libcyusbserial.so.1: lib/CMakeFiles/cyusbserial.dir/link.txt lib/libcyusbserial.so.1: lib/CMakeFiles/cyusbserial.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Linking C shared library libcyusbserial.so" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Linking C shared library libcyusbserial.so"
cd /root/projekti/CyUSB/libcyusbserial-master/lib && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/cyusbserial.dir/link.txt --verbose=$(VERBOSE) cd /root/projekti/CyUSB/release/cylib/build/lib && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/cyusbserial.dir/link.txt --verbose=$(VERBOSE)
cd /root/projekti/CyUSB/libcyusbserial-master/lib && $(CMAKE_COMMAND) -E cmake_symlink_library libcyusbserial.so.1 libcyusbserial.so.1 libcyusbserial.so cd /root/projekti/CyUSB/release/cylib/build/lib && $(CMAKE_COMMAND) -E cmake_symlink_library libcyusbserial.so.1 libcyusbserial.so.1 libcyusbserial.so
lib/libcyusbserial.so: lib/libcyusbserial.so.1 lib/libcyusbserial.so: lib/libcyusbserial.so.1
@$(CMAKE_COMMAND) -E touch_nocreate lib/libcyusbserial.so @$(CMAKE_COMMAND) -E touch_nocreate lib/libcyusbserial.so
@@ -271,10 +271,10 @@ lib/CMakeFiles/cyusbserial.dir/requires: lib/CMakeFiles/cyusbserial.dir/cymisc.c
.PHONY : lib/CMakeFiles/cyusbserial.dir/requires .PHONY : lib/CMakeFiles/cyusbserial.dir/requires
lib/CMakeFiles/cyusbserial.dir/clean: lib/CMakeFiles/cyusbserial.dir/clean:
cd /root/projekti/CyUSB/libcyusbserial-master/lib && $(CMAKE_COMMAND) -P CMakeFiles/cyusbserial.dir/cmake_clean.cmake cd /root/projekti/CyUSB/release/cylib/build/lib && $(CMAKE_COMMAND) -P CMakeFiles/cyusbserial.dir/cmake_clean.cmake
.PHONY : lib/CMakeFiles/cyusbserial.dir/clean .PHONY : lib/CMakeFiles/cyusbserial.dir/clean
lib/CMakeFiles/cyusbserial.dir/depend: lib/CMakeFiles/cyusbserial.dir/depend:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /root/projekti/CyUSB/libcyusbserial-master /root/projekti/CyUSB/libcyusbserial-master/lib /root/projekti/CyUSB/libcyusbserial-master /root/projekti/CyUSB/libcyusbserial-master/lib /root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/DependInfo.cmake --color=$(COLOR) cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /root/projekti/CyUSB/release/cylib /root/projekti/CyUSB/release/cylib/lib /root/projekti/CyUSB/release/cylib/build /root/projekti/CyUSB/release/cylib/build/lib /root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : lib/CMakeFiles/cyusbserial.dir/depend .PHONY : lib/CMakeFiles/cyusbserial.dir/depend

View File

@@ -0,0 +1,38 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyi2c.c
/usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyjtag.c
/usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cymisc.c
/usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyphdc.c
/usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyspi.c
/usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyuart.c
/usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o
../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/lib/CyUSBCommon.h
/root/projekti/CyUSB/release/cylib/lib/cyusb.c
/usr/local/include/libusb-1.0/libusb.h

View File

@@ -0,0 +1,38 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: ../lib/cyi2c.c
lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o: /usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: ../lib/cyjtag.c
lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o: /usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: ../lib/cymisc.c
lib/CMakeFiles/cyusbserial.dir/cymisc.c.o: /usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: ../lib/cyphdc.c
lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o: /usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: ../lib/cyspi.c
lib/CMakeFiles/cyusbserial.dir/cyspi.c.o: /usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: ../lib/cyuart.c
lib/CMakeFiles/cyusbserial.dir/cyuart.c.o: /usr/local/include/libusb-1.0/libusb.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: ../include/CyUSBSerial.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: ../lib/CyUSBCommon.h
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: ../lib/cyusb.c
lib/CMakeFiles/cyusbserial.dir/cyusb.c.o: /usr/local/include/libusb-1.0/libusb.h

View File

@@ -6,5 +6,5 @@ C_FLAGS = -fPIC -Wall -Wextra -Wno-unused-parameter
C_DEFINES = -Dcyusbserial_EXPORTS C_DEFINES = -Dcyusbserial_EXPORTS
C_INCLUDES = -I/root/projekti/CyUSB/libcyusbserial-master/include C_INCLUDES = -I/root/projekti/CyUSB/release/cylib/include -I/root/projekti/CyUSB/release/cylib/lib/../include -I/usr/local/include/libusb-1.0

View File

@@ -1 +1 @@
/usr/bin/cc -fPIC -shared -Wl,-soname,libcyusbserial.so.1 -o libcyusbserial.so.1 CMakeFiles/cyusbserial.dir/cyusb.c.o CMakeFiles/cyusbserial.dir/cyuart.c.o CMakeFiles/cyusbserial.dir/cyi2c.c.o CMakeFiles/cyusbserial.dir/cyspi.c.o CMakeFiles/cyusbserial.dir/cyphdc.c.o CMakeFiles/cyusbserial.dir/cyjtag.c.o CMakeFiles/cyusbserial.dir/cymisc.c.o -Wl,-rpath,/usr/local/lib: /usr/local/lib/libusb-1.0.so /usr/bin/cc -fPIC -shared -Wl,-soname,libcyusbserial.so.1 -o libcyusbserial.so.1 CMakeFiles/cyusbserial.dir/cyusb.c.o CMakeFiles/cyusbserial.dir/cyuart.c.o CMakeFiles/cyusbserial.dir/cyi2c.c.o CMakeFiles/cyusbserial.dir/cyspi.c.o CMakeFiles/cyusbserial.dir/cyphdc.c.o CMakeFiles/cyusbserial.dir/cyjtag.c.o CMakeFiles/cyusbserial.dir/cymisc.c.o -Wl,-rpath,/usr/local/lib: -lpthread /usr/local/lib/libusb-1.0.so

View File

@@ -48,10 +48,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
#============================================================================= #=============================================================================
# Targets provided globally by CMake. # Targets provided globally by CMake.
@@ -124,14 +124,14 @@ list_install_components/fast: list_install_components
# The main all target # The main all target
all: cmake_check_build_system all: cmake_check_build_system
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles /root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/progress.marks cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles /root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/progress.marks
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 lib/all cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 lib/all
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 0 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 0
.PHONY : all .PHONY : all
# The main clean target # The main clean target
clean: clean:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 lib/clean cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 lib/clean
.PHONY : clean .PHONY : clean
# The main clean target # The main clean target
@@ -141,22 +141,22 @@ clean/fast: clean
# Prepare targets for installation. # Prepare targets for installation.
preinstall: all preinstall: all
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 lib/preinstall cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 lib/preinstall
.PHONY : preinstall .PHONY : preinstall
# Prepare targets for installation. # Prepare targets for installation.
preinstall/fast: preinstall/fast:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 lib/preinstall cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 lib/preinstall
.PHONY : preinstall/fast .PHONY : preinstall/fast
# clear depends # clear depends
depend: depend:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend .PHONY : depend
# Convenience name for target. # Convenience name for target.
lib/CMakeFiles/cyusbserial.dir/rule: lib/CMakeFiles/cyusbserial.dir/rule:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 lib/CMakeFiles/cyusbserial.dir/rule cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 lib/CMakeFiles/cyusbserial.dir/rule
.PHONY : lib/CMakeFiles/cyusbserial.dir/rule .PHONY : lib/CMakeFiles/cyusbserial.dir/rule
# Convenience name for target. # Convenience name for target.
@@ -166,7 +166,7 @@ cyusbserial: lib/CMakeFiles/cyusbserial.dir/rule
# fast build rule for target. # fast build rule for target.
cyusbserial/fast: cyusbserial/fast:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/build cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/build
.PHONY : cyusbserial/fast .PHONY : cyusbserial/fast
cyi2c.o: cyi2c.c.o cyi2c.o: cyi2c.c.o
@@ -175,7 +175,7 @@ cyi2c.o: cyi2c.c.o
# target to build an object file # target to build an object file
cyi2c.c.o: cyi2c.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.o
.PHONY : cyi2c.c.o .PHONY : cyi2c.c.o
cyi2c.i: cyi2c.c.i cyi2c.i: cyi2c.c.i
@@ -184,7 +184,7 @@ cyi2c.i: cyi2c.c.i
# target to preprocess a source file # target to preprocess a source file
cyi2c.c.i: cyi2c.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.i
.PHONY : cyi2c.c.i .PHONY : cyi2c.c.i
cyi2c.s: cyi2c.c.s cyi2c.s: cyi2c.c.s
@@ -193,7 +193,7 @@ cyi2c.s: cyi2c.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyi2c.c.s: cyi2c.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyi2c.c.s
.PHONY : cyi2c.c.s .PHONY : cyi2c.c.s
cyjtag.o: cyjtag.c.o cyjtag.o: cyjtag.c.o
@@ -202,7 +202,7 @@ cyjtag.o: cyjtag.c.o
# target to build an object file # target to build an object file
cyjtag.c.o: cyjtag.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.o
.PHONY : cyjtag.c.o .PHONY : cyjtag.c.o
cyjtag.i: cyjtag.c.i cyjtag.i: cyjtag.c.i
@@ -211,7 +211,7 @@ cyjtag.i: cyjtag.c.i
# target to preprocess a source file # target to preprocess a source file
cyjtag.c.i: cyjtag.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.i
.PHONY : cyjtag.c.i .PHONY : cyjtag.c.i
cyjtag.s: cyjtag.c.s cyjtag.s: cyjtag.c.s
@@ -220,7 +220,7 @@ cyjtag.s: cyjtag.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyjtag.c.s: cyjtag.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyjtag.c.s
.PHONY : cyjtag.c.s .PHONY : cyjtag.c.s
cymisc.o: cymisc.c.o cymisc.o: cymisc.c.o
@@ -229,7 +229,7 @@ cymisc.o: cymisc.c.o
# target to build an object file # target to build an object file
cymisc.c.o: cymisc.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.o
.PHONY : cymisc.c.o .PHONY : cymisc.c.o
cymisc.i: cymisc.c.i cymisc.i: cymisc.c.i
@@ -238,7 +238,7 @@ cymisc.i: cymisc.c.i
# target to preprocess a source file # target to preprocess a source file
cymisc.c.i: cymisc.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.i
.PHONY : cymisc.c.i .PHONY : cymisc.c.i
cymisc.s: cymisc.c.s cymisc.s: cymisc.c.s
@@ -247,7 +247,7 @@ cymisc.s: cymisc.c.s
# target to generate assembly for a file # target to generate assembly for a file
cymisc.c.s: cymisc.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cymisc.c.s
.PHONY : cymisc.c.s .PHONY : cymisc.c.s
cyphdc.o: cyphdc.c.o cyphdc.o: cyphdc.c.o
@@ -256,7 +256,7 @@ cyphdc.o: cyphdc.c.o
# target to build an object file # target to build an object file
cyphdc.c.o: cyphdc.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.o
.PHONY : cyphdc.c.o .PHONY : cyphdc.c.o
cyphdc.i: cyphdc.c.i cyphdc.i: cyphdc.c.i
@@ -265,7 +265,7 @@ cyphdc.i: cyphdc.c.i
# target to preprocess a source file # target to preprocess a source file
cyphdc.c.i: cyphdc.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.i
.PHONY : cyphdc.c.i .PHONY : cyphdc.c.i
cyphdc.s: cyphdc.c.s cyphdc.s: cyphdc.c.s
@@ -274,7 +274,7 @@ cyphdc.s: cyphdc.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyphdc.c.s: cyphdc.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyphdc.c.s
.PHONY : cyphdc.c.s .PHONY : cyphdc.c.s
cyspi.o: cyspi.c.o cyspi.o: cyspi.c.o
@@ -283,7 +283,7 @@ cyspi.o: cyspi.c.o
# target to build an object file # target to build an object file
cyspi.c.o: cyspi.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.o
.PHONY : cyspi.c.o .PHONY : cyspi.c.o
cyspi.i: cyspi.c.i cyspi.i: cyspi.c.i
@@ -292,7 +292,7 @@ cyspi.i: cyspi.c.i
# target to preprocess a source file # target to preprocess a source file
cyspi.c.i: cyspi.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.i
.PHONY : cyspi.c.i .PHONY : cyspi.c.i
cyspi.s: cyspi.c.s cyspi.s: cyspi.c.s
@@ -301,7 +301,7 @@ cyspi.s: cyspi.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyspi.c.s: cyspi.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyspi.c.s
.PHONY : cyspi.c.s .PHONY : cyspi.c.s
cyuart.o: cyuart.c.o cyuart.o: cyuart.c.o
@@ -310,7 +310,7 @@ cyuart.o: cyuart.c.o
# target to build an object file # target to build an object file
cyuart.c.o: cyuart.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.o
.PHONY : cyuart.c.o .PHONY : cyuart.c.o
cyuart.i: cyuart.c.i cyuart.i: cyuart.c.i
@@ -319,7 +319,7 @@ cyuart.i: cyuart.c.i
# target to preprocess a source file # target to preprocess a source file
cyuart.c.i: cyuart.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.i
.PHONY : cyuart.c.i .PHONY : cyuart.c.i
cyuart.s: cyuart.c.s cyuart.s: cyuart.c.s
@@ -328,7 +328,7 @@ cyuart.s: cyuart.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyuart.c.s: cyuart.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyuart.c.s
.PHONY : cyuart.c.s .PHONY : cyuart.c.s
cyusb.o: cyusb.c.o cyusb.o: cyusb.c.o
@@ -337,7 +337,7 @@ cyusb.o: cyusb.c.o
# target to build an object file # target to build an object file
cyusb.c.o: cyusb.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.o
.PHONY : cyusb.c.o .PHONY : cyusb.c.o
cyusb.i: cyusb.c.i cyusb.i: cyusb.c.i
@@ -346,7 +346,7 @@ cyusb.i: cyusb.c.i
# target to preprocess a source file # target to preprocess a source file
cyusb.c.i: cyusb.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.i
.PHONY : cyusb.c.i .PHONY : cyusb.c.i
cyusb.s: cyusb.c.s cyusb.s: cyusb.c.s
@@ -355,7 +355,7 @@ cyusb.s: cyusb.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyusb.c.s: cyusb.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f lib/CMakeFiles/cyusbserial.dir/build.make lib/CMakeFiles/cyusbserial.dir/cyusb.c.s
.PHONY : cyusb.c.s .PHONY : cyusb.c.s
# Help Target # Help Target
@@ -403,6 +403,6 @@ help:
# No rule that depends on this can have commands that come from listfiles # No rule that depends on this can have commands that come from listfiles
# because they might be regenerated. # because they might be regenerated.
cmake_check_build_system: cmake_check_build_system:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system .PHONY : cmake_check_build_system

View File

@@ -1,4 +1,4 @@
# Install script for directory: /root/projekti/CyUSB/libcyusbserial-master/lib # Install script for directory: /root/projekti/CyUSB/release/cylib/lib
# Set the install prefix # Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -45,8 +45,8 @@ if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMP
endif() endif()
endforeach() endforeach()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE SHARED_LIBRARY FILES
"/root/projekti/CyUSB/libcyusbserial-master/lib/libcyusbserial.so.1" "/root/projekti/CyUSB/release/cylib/build/lib/libcyusbserial.so.1"
"/root/projekti/CyUSB/libcyusbserial-master/lib/libcyusbserial.so" "/root/projekti/CyUSB/release/cylib/build/lib/libcyusbserial.so"
) )
foreach(file foreach(file
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcyusbserial.so.1" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/libcyusbserial.so.1"

View File

@@ -0,0 +1 @@
libcyusbserial.so.1

Binary file not shown.

View File

@@ -2,8 +2,8 @@
# Generated by "Unix Makefiles" Generator, CMake Version 3.7 # Generated by "Unix Makefiles" Generator, CMake Version 3.7
# Relative path conversion top directories. # Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/root/projekti/CyUSB/release/cylib")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/libcyusbserial-master") set(CMAKE_RELATIVE_PATH_TOP_BINARY "/root/projekti/CyUSB/release/cylib/build")
# Force unix paths in dependencies. # Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1) set(CMAKE_FORCE_UNIX_PATHS 1)

View File

@@ -6,7 +6,9 @@
#IncludeRegexTransform: #IncludeRegexTransform:
/root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest.c ../include/CyUSBSerial.h
/root/projekti/CyUSB/release/cylib/tools/cyusbserialtest.c
stdio.h stdio.h
- -
unistd.h unistd.h
@@ -30,7 +32,5 @@ pthread.h
ctype.h ctype.h
- -
CyUSBSerial.h CyUSBSerial.h
/root/projekti/CyUSB/libcyusbserial-master/tools/CyUSBSerial.h /root/projekti/CyUSB/release/cylib/tools/CyUSBSerial.h
include/CyUSBSerial.h

View File

@@ -4,18 +4,18 @@ set(CMAKE_DEPENDS_LANGUAGES
) )
# The set of files for implicit dependencies of each language: # The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_C set(CMAKE_DEPENDS_CHECK_C
"/root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest.c" "/root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o" "/root/projekti/CyUSB/release/cylib/tools/cyusbserialtest.c" "/root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o"
) )
set(CMAKE_C_COMPILER_ID "GNU") set(CMAKE_C_COMPILER_ID "GNU")
# The include file search paths: # The include file search paths:
set(CMAKE_C_TARGET_INCLUDE_PATH set(CMAKE_C_TARGET_INCLUDE_PATH
"include" "../include"
) )
# Targets to which this target links. # Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES set(CMAKE_TARGET_LINKED_INFO_FILES
"/root/projekti/CyUSB/libcyusbserial-master/lib/CMakeFiles/cyusbserial.dir/DependInfo.cmake" "/root/projekti/CyUSB/release/cylib/build/lib/CMakeFiles/cyusbserial.dir/DependInfo.cmake"
) )
# Fortran module output directory. # Fortran module output directory.

View File

@@ -43,10 +43,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
# Include any dependencies generated for this target. # Include any dependencies generated for this target.
include tools/CMakeFiles/cyusbserialtest.dir/depend.make include tools/CMakeFiles/cyusbserialtest.dir/depend.make
@@ -58,17 +58,17 @@ include tools/CMakeFiles/cyusbserialtest.dir/progress.make
include tools/CMakeFiles/cyusbserialtest.dir/flags.make include tools/CMakeFiles/cyusbserialtest.dir/flags.make
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: tools/CMakeFiles/cyusbserialtest.dir/flags.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: tools/CMakeFiles/cyusbserialtest.dir/flags.make
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: tools/cyusbserialtest.c tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: ../tools/cyusbserialtest.c
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o"
cd /root/projekti/CyUSB/libcyusbserial-master/tools && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o -c /root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest.c cd /root/projekti/CyUSB/release/cylib/build/tools && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o -c /root/projekti/CyUSB/release/cylib/tools/cyusbserialtest.c
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i: cmake_force tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i"
cd /root/projekti/CyUSB/libcyusbserial-master/tools && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest.c > CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i cd /root/projekti/CyUSB/release/cylib/build/tools && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /root/projekti/CyUSB/release/cylib/tools/cyusbserialtest.c > CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s: cmake_force tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s"
cd /root/projekti/CyUSB/libcyusbserial-master/tools && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest.c -o CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s cd /root/projekti/CyUSB/release/cylib/build/tools && /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /root/projekti/CyUSB/release/cylib/tools/cyusbserialtest.c -o CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o.requires: tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o.requires:
@@ -93,8 +93,8 @@ tools/cyusbserialtest: tools/CMakeFiles/cyusbserialtest.dir/build.make
tools/cyusbserialtest: lib/libcyusbserial.so.1 tools/cyusbserialtest: lib/libcyusbserial.so.1
tools/cyusbserialtest: /usr/local/lib/libusb-1.0.so tools/cyusbserialtest: /usr/local/lib/libusb-1.0.so
tools/cyusbserialtest: tools/CMakeFiles/cyusbserialtest.dir/link.txt tools/cyusbserialtest: tools/CMakeFiles/cyusbserialtest.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/root/projekti/CyUSB/libcyusbserial-master/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C executable cyusbserialtest" @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/root/projekti/CyUSB/release/cylib/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C executable cyusbserialtest"
cd /root/projekti/CyUSB/libcyusbserial-master/tools && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/cyusbserialtest.dir/link.txt --verbose=$(VERBOSE) cd /root/projekti/CyUSB/release/cylib/build/tools && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/cyusbserialtest.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target. # Rule to build all files generated by this target.
tools/CMakeFiles/cyusbserialtest.dir/build: tools/cyusbserialtest tools/CMakeFiles/cyusbserialtest.dir/build: tools/cyusbserialtest
@@ -106,10 +106,10 @@ tools/CMakeFiles/cyusbserialtest.dir/requires: tools/CMakeFiles/cyusbserialtest.
.PHONY : tools/CMakeFiles/cyusbserialtest.dir/requires .PHONY : tools/CMakeFiles/cyusbserialtest.dir/requires
tools/CMakeFiles/cyusbserialtest.dir/clean: tools/CMakeFiles/cyusbserialtest.dir/clean:
cd /root/projekti/CyUSB/libcyusbserial-master/tools && $(CMAKE_COMMAND) -P CMakeFiles/cyusbserialtest.dir/cmake_clean.cmake cd /root/projekti/CyUSB/release/cylib/build/tools && $(CMAKE_COMMAND) -P CMakeFiles/cyusbserialtest.dir/cmake_clean.cmake
.PHONY : tools/CMakeFiles/cyusbserialtest.dir/clean .PHONY : tools/CMakeFiles/cyusbserialtest.dir/clean
tools/CMakeFiles/cyusbserialtest.dir/depend: tools/CMakeFiles/cyusbserialtest.dir/depend:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /root/projekti/CyUSB/libcyusbserial-master /root/projekti/CyUSB/libcyusbserial-master/tools /root/projekti/CyUSB/libcyusbserial-master /root/projekti/CyUSB/libcyusbserial-master/tools /root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/cyusbserialtest.dir/DependInfo.cmake --color=$(COLOR) cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /root/projekti/CyUSB/release/cylib /root/projekti/CyUSB/release/cylib/tools /root/projekti/CyUSB/release/cylib/build /root/projekti/CyUSB/release/cylib/build/tools /root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/cyusbserialtest.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : tools/CMakeFiles/cyusbserialtest.dir/depend .PHONY : tools/CMakeFiles/cyusbserialtest.dir/depend

View File

@@ -2,5 +2,5 @@
# Generated by "Unix Makefiles" Generator, CMake Version 3.7 # Generated by "Unix Makefiles" Generator, CMake Version 3.7
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o
/root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest.c ../include/CyUSBSerial.h
include/CyUSBSerial.h /root/projekti/CyUSB/release/cylib/tools/cyusbserialtest.c

View File

@@ -0,0 +1,6 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: ../include/CyUSBSerial.h
tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o: ../tools/cyusbserialtest.c

View File

@@ -6,5 +6,5 @@ C_FLAGS = -Wall -Wextra -Wno-unused-parameter
C_DEFINES = C_DEFINES =
C_INCLUDES = -I/root/projekti/CyUSB/libcyusbserial-master/include C_INCLUDES = -I/root/projekti/CyUSB/release/cylib/include

View File

@@ -0,0 +1 @@
/usr/bin/cc CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o -o cyusbserialtest -Wl,-rpath,/root/projekti/CyUSB/release/cylib/build/lib:/usr/local/lib: -rdynamic ../lib/libcyusbserial.so.1 -lpthread /usr/local/lib/libusb-1.0.so

View File

@@ -48,10 +48,10 @@ RM = /usr/bin/cmake -E remove -f
EQUALS = = EQUALS = =
# The top-level source directory on which CMake was run. # The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_SOURCE_DIR = /root/projekti/CyUSB/release/cylib
# The top-level build directory on which CMake was run. # The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /root/projekti/CyUSB/libcyusbserial-master CMAKE_BINARY_DIR = /root/projekti/CyUSB/release/cylib/build
#============================================================================= #=============================================================================
# Targets provided globally by CMake. # Targets provided globally by CMake.
@@ -124,14 +124,14 @@ rebuild_cache/fast: rebuild_cache
# The main all target # The main all target
all: cmake_check_build_system all: cmake_check_build_system
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles /root/projekti/CyUSB/libcyusbserial-master/tools/CMakeFiles/progress.marks cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles /root/projekti/CyUSB/release/cylib/build/tools/CMakeFiles/progress.marks
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 tools/all cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 tools/all
$(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/libcyusbserial-master/CMakeFiles 0 $(CMAKE_COMMAND) -E cmake_progress_start /root/projekti/CyUSB/release/cylib/build/CMakeFiles 0
.PHONY : all .PHONY : all
# The main clean target # The main clean target
clean: clean:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 tools/clean cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 tools/clean
.PHONY : clean .PHONY : clean
# The main clean target # The main clean target
@@ -141,22 +141,22 @@ clean/fast: clean
# Prepare targets for installation. # Prepare targets for installation.
preinstall: all preinstall: all
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall
.PHONY : preinstall .PHONY : preinstall
# Prepare targets for installation. # Prepare targets for installation.
preinstall/fast: preinstall/fast:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall
.PHONY : preinstall/fast .PHONY : preinstall/fast
# clear depends # clear depends
depend: depend:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend .PHONY : depend
# Convenience name for target. # Convenience name for target.
tools/CMakeFiles/cyusbserialtest.dir/rule: tools/CMakeFiles/cyusbserialtest.dir/rule:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f CMakeFiles/Makefile2 tools/CMakeFiles/cyusbserialtest.dir/rule cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f CMakeFiles/Makefile2 tools/CMakeFiles/cyusbserialtest.dir/rule
.PHONY : tools/CMakeFiles/cyusbserialtest.dir/rule .PHONY : tools/CMakeFiles/cyusbserialtest.dir/rule
# Convenience name for target. # Convenience name for target.
@@ -166,7 +166,7 @@ cyusbserialtest: tools/CMakeFiles/cyusbserialtest.dir/rule
# fast build rule for target. # fast build rule for target.
cyusbserialtest/fast: cyusbserialtest/fast:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/build cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/build
.PHONY : cyusbserialtest/fast .PHONY : cyusbserialtest/fast
cyusbserialtest.o: cyusbserialtest.c.o cyusbserialtest.o: cyusbserialtest.c.o
@@ -175,7 +175,7 @@ cyusbserialtest.o: cyusbserialtest.c.o
# target to build an object file # target to build an object file
cyusbserialtest.c.o: cyusbserialtest.c.o:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.o
.PHONY : cyusbserialtest.c.o .PHONY : cyusbserialtest.c.o
cyusbserialtest.i: cyusbserialtest.c.i cyusbserialtest.i: cyusbserialtest.c.i
@@ -184,7 +184,7 @@ cyusbserialtest.i: cyusbserialtest.c.i
# target to preprocess a source file # target to preprocess a source file
cyusbserialtest.c.i: cyusbserialtest.c.i:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.i
.PHONY : cyusbserialtest.c.i .PHONY : cyusbserialtest.c.i
cyusbserialtest.s: cyusbserialtest.c.s cyusbserialtest.s: cyusbserialtest.c.s
@@ -193,7 +193,7 @@ cyusbserialtest.s: cyusbserialtest.c.s
# target to generate assembly for a file # target to generate assembly for a file
cyusbserialtest.c.s: cyusbserialtest.c.s:
cd /root/projekti/CyUSB/libcyusbserial-master && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s cd /root/projekti/CyUSB/release/cylib/build && $(MAKE) -f tools/CMakeFiles/cyusbserialtest.dir/build.make tools/CMakeFiles/cyusbserialtest.dir/cyusbserialtest.c.s
.PHONY : cyusbserialtest.c.s .PHONY : cyusbserialtest.c.s
# Help Target # Help Target
@@ -223,6 +223,6 @@ help:
# No rule that depends on this can have commands that come from listfiles # No rule that depends on this can have commands that come from listfiles
# because they might be regenerated. # because they might be regenerated.
cmake_check_build_system: cmake_check_build_system:
cd /root/projekti/CyUSB/libcyusbserial-master && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 cd /root/projekti/CyUSB/release/cylib/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system .PHONY : cmake_check_build_system

View File

@@ -1,4 +1,4 @@
# Install script for directory: /root/projekti/CyUSB/libcyusbserial-master/tools # Install script for directory: /root/projekti/CyUSB/release/cylib/tools
# Set the install prefix # Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -39,12 +39,12 @@ if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMP
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest" FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest"
RPATH "") RPATH "")
endif() endif()
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/root/projekti/CyUSB/libcyusbserial-master/tools/cyusbserialtest") file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/root/projekti/CyUSB/release/cylib/build/tools/cyusbserialtest")
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest" AND if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest" AND
NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest") NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest")
file(RPATH_CHANGE file(RPATH_CHANGE
FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest" FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest"
OLD_RPATH "/root/projekti/CyUSB/libcyusbserial-master/lib:/usr/local/lib:" OLD_RPATH "/root/projekti/CyUSB/release/cylib/build/lib:/usr/local/lib:"
NEW_RPATH "") NEW_RPATH "")
if(CMAKE_INSTALL_DO_STRIP) if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest") execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/cyusbserialtest")

Binary file not shown.

View File

@@ -0,0 +1,46 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libusb.h>
#if WIN32
#include <winbase.h>
typedef const struct libusb_version * (__stdcall * version_fn)(void);
#endif
int main(int argc, char *argv[])
{
int status = 0;
const struct libusb_version *ver;
#if WIN32
if (argc > 1) {
HINSTANCE dll;
version_fn get_version;
dll = LoadLibraryA(argv[1]);
if (!dll) {
fprintf(stderr, "Failed to load %s\n", argv[1]);
return -1;
}
get_version = (version_fn) GetProcAddress(dll, "libusb_get_version");
if (get_version) {
ver = get_version();
printf("%u.%u.%u\n", ver->major, ver->minor, ver->micro);
} else{
fprintf(stderr, "Failed to get address of libusb_get_version()\n");
status = -1;
}
FreeLibrary(dll);
} else {
fprintf(stderr, "Windows usage: %s <libusb.dll>\n", argv[0]);
return -1;
}
#else
ver = libusb_get_version();
printf("%u.%u.%u\n", ver->major, ver->minor, ver->micro);
#endif
return status;
}

View File

@@ -0,0 +1,97 @@
# This is file is based off of the FindLibUSB.cmake file written by Hendrik Sattler,
# from the OpenOBEX project (licensed GPLv2/LGPL). (If this is not correct,
# please contact us so we can attribute the author appropriately.)
#
# https://github.com/zuckschwerdt/openobex/blob/master/CMakeModules/FindLibUSB.cmake
# http://dev.zuckschwerdt.org/openobex/
#
# Find pthreads-win32
#
# This requires the LIBPTHREADSWIN32_PATH variable to be set to the path to the
# a pthreads-win32 release, such as the Pre-built.2 directory from the 2.9.1 release:
# ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip
#
# The following standard variables get defined:
# LIBPTHREADSWIN32_FOUND: true if LibUSB was found
# LIBPTHREADSWIN32_HEADER_FILE: the location of the C header file
# LIBPTHREADSWIN32_INCLUDE_DIRS: the directories that contain headers
# LIBPTHREADSWIN32_LIBRARIES: the library files
# LIBPTHREADSWIN32_LIB_COPYING: the license associated with the library
if(DEFINED __INCLUDED_BLADERF_FINDLIBPTHREADSWIN32_CMAKE)
return()
endif()
set(__INCLUDED_BLADERF_FINDLIBPTHREADSWIN32_CMAKE TRUE)
include ( CheckLibraryExists )
include ( CheckIncludeFile )
set(LIBPTHREADSWIN32_PATH
"C:/Program Files/pthreads-win32"
CACHE
PATH
"Path to win-pthreads files. (This is generally only needed for Windows users who downloaded binary distributions.)"
)
find_file ( LIBPTHREADSWIN32_HEADER_FILE
NAMES
pthread.h
PATHS
${LIBPTHREADSWIN32_PATH}
PATH_SUFFIXES
include include
)
mark_as_advanced ( LIBPTHREADSWIN32_HEADER_FILE )
get_filename_component ( LIBPTHREADSWIN32_INCLUDE_DIRS "${LIBPTHREADSWIN32_HEADER_FILE}" PATH )
if ( WIN32 )
if ( MSVC )
if ( CMAKE_CL_64 )
set ( LIBPTHREADSWIN32_LIBRARY_PATH_SUFFIX x64 )
else ( CMAKE_CL_64 )
set ( LIBPTHREADSWIN32_LIBRARY_PATH_SUFFIX x86 )
endif ( CMAKE_CL_64 )
elseif ( CMAKE_COMPILER_IS_GNUCC )
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( LIBPTHREADSWIN32_LIBRARY_PATH_SUFFIX x64 )
else ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( LIBPTHREADSWIN32_LIBRARY_PATH_SUFFIX x86 )
endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
endif ( MSVC )
find_library ( PTHREAD_LIBRARY
NAMES
pthreadVC2
PATHS
${LIBPTHREADSWIN32_PATH}
PATH_SUFFIXES
lib/${LIBPTHREADSWIN32_LIBRARY_PATH_SUFFIX}
)
mark_as_advanced ( PTHREAD_LIBRARY )
if ( PTHREAD_LIBRARY )
set ( LIBPTHREADSWIN32_LIBRARIES ${PTHREAD_LIBRARY} )
endif ( PTHREAD_LIBRARY )
else ( WIN32 )
message(FATAL_ERROR "This file only supports Windows")
endif ( WIN32 )
set ( LIBPTHREADSWIN32_LIB_COPYING
"${LIBPTHREADSWIN32_PATH}/COPYING.LIB" )
if ( NOT EXISTS "${LIBPTHREADSWIN32_LIB_COPYING}" )
message(FATAL_ERROR "Unable to find pthread-win32 COPYING.LIB file")
endif ()
if ( LIBPTHREADSWIN32_INCLUDE_DIRS AND LIBPTHREADSWIN32_LIBRARIES )
set ( LIBPTHREADSWIN32_FOUND true )
endif ( LIBPTHREADSWIN32_INCLUDE_DIRS AND LIBPTHREADSWIN32_LIBRARIES )
if ( LIBPTHREADSWIN32_FOUND )
set ( CMAKE_REQUIRED_INCLUDES "${LIBPTHREADSWIN32_INCLUDE_DIRS}" )
check_include_file ( "{LIBPTHREADSWIN32_HEADER_FILE}" LIBPTHREADSWIN32_FOUND )
endif ( LIBPTHREADSWIN32_FOUND )
if ( NOT LIBPTHREADSWIN32_FOUND )
message ( FATAL_ERROR "pthreads-win32 not found. If you're using a binary distribution, try setting -DLIBPTHREADSWIN32_PATH=<path_to_win_pthread_files>." )
endif ( NOT LIBPTHREADSWIN32_FOUND )

View File

@@ -0,0 +1,168 @@
# This is a modified version of the file written by Hedrik Sattler,
# from the OpenOBEX project (licensed GPLv2/LGPL). (If this is not correct,
# please contact us so we can attribute the author appropriately.)
#
# https://github.com/zuckschwerdt/openobex/blob/master/CMakeModules/FindLibUSB.cmake
# http://dev.zuckschwerdt.org/openobex/
#
# Find libusb-1.0
#
# It will use PkgConfig if present and supported, otherwise this
# script searches for binary distribution in the path defined by
# the LIBUSB_PATH variable.
#
# Define LIBUSB_SKIP_VERSION_CHECK=Yes to skip the execution of a program to fetch
# libusb's version number. LIBUSB_VERSION will not be set if this if this is used.
# To check the version number, this script expects CMAKE_HELPERS_SOURCE_DIR to
# be defined with the path to libusb_version.c.
#
# The following standard variables get defined:
# LIBUSB_FOUND: true if LibUSB was found
# LIBUSB_HEADER_FILE: the location of the C header file
# LIBUSB_INCLUDE_DIRS: the directorys that contain headers
# LIBUSB_LIBRARIES: the library files
# LIBUSB_VERSION the detected libusb version
# LIBUSB_HAVE_GET_VERSION True if libusb has libusb_get_version()
if(DEFINED __INCLUDED_BLADERF_FINDLIBUSB_CMAKE)
return()
endif()
set(__INCLUDED_BLADERF_FINDLIBUSB_CMAKE TRUE)
include(CheckLibraryExists)
include(CheckIncludeFile)
# In Linux, folks should generally be able to simply fetch the libusb library and
# development packages from their distros package repository. Windows users will
# likely want to fetch a binary distribution, hence the Windows-oriented default.
#
# See http://www.libusb.org/wiki/windows_backend#LatestBinarySnapshots
if(WIN32)
set(LIBUSB_PATH
"C:/Program Files/libusb-1.0.19"
CACHE
PATH
"Path to libusb files. (This is generally only needed for Windows users who downloaded binary distributions.)"
)
endif()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PKGCONFIG_LIBUSB libusb-1.0 QUIET)
endif(PKG_CONFIG_FOUND)
if(PKGCONFIG_LIBUSB_FOUND)
set(LIBUSB_INCLUDE_DIRS ${PKGCONFIG_LIBUSB_INCLUDE_DIRS})
foreach(i ${PKGCONFIG_LIBUSB_LIBRARIES})
string(REGEX MATCH "[^-]*" ibase "${i}")
find_library(${ibase}_LIBRARY
NAMES ${i}
PATHS ${PKGCONFIG_LIBUSB_LIBRARY_DIRS}
)
if(${ibase}_LIBRARY)
list(APPEND LIBUSB_LIBRARIES ${${ibase}_LIBRARY})
endif(${ibase}_LIBRARY)
mark_as_advanced(${ibase}_LIBRARY)
endforeach(i)
else(PKGCONFIG_LIBUSB_FOUND)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
# The libusbx binary distribution contains several libs.
# Use the lib that got compiled with the same compiler.
if(MSVC)
if(CMAKE_CL_64)
set(LIBUSB_LIBRARY_PATH_SUFFIX MS64/dll)
else(CMAKE_CL_64)
set(LIBUSB_LIBRARY_PATH_SUFFIX MS32/dll)
endif(CMAKE_CL_64)
elseif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(LIBUSB_LIBRARY_PATH_SUFFIX MinGW32/dll)
else(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(LIBUSB_LIBRARY_PATH_SUFFIX MinGW64/dll)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
endif(MSVC)
else()
set(LIBUSB_LIBRARY_PATH_SUFFIX lib)
set(LIBUSB_EXTRA_PATHS /usr /usr/local /opt/local)
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
find_file(LIBUSB_HEADER_FILE
NAMES
libusb.h
PATHS
${LIBUSB_PATH}
${LIBUSB_EXTRA_PATHS}
PATH_SUFFIXES
include include/libusbx-1.0 include/libusb-1.0
)
mark_as_advanced(LIBUSB_HEADER_FILE)
get_filename_component(LIBUSB_INCLUDE_DIRS "${LIBUSB_HEADER_FILE}" PATH)
find_library(usb_LIBRARY
NAMES
libusb-1.0 usb-1.0
PATHS
${LIBUSB_PATH}
${LIBUSB_EXTRA_PATHS}
PATH_SUFFIXES
${LIBUSB_LIBRARY_PATH_SUFFIX}
)
mark_as_advanced(usb_LIBRARY)
if(usb_LIBRARY)
set(LIBUSB_LIBRARIES ${usb_LIBRARY})
endif(usb_LIBRARY)
endif(PKGCONFIG_LIBUSB_FOUND)
if(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES)
set(LIBUSB_FOUND true)
endif(LIBUSB_INCLUDE_DIRS AND LIBUSB_LIBRARIES)
if(LIBUSB_FOUND)
set(CMAKE_REQUIRED_INCLUDES "${LIBUSB_INCLUDE_DIRS}")
check_include_file("{LIBUSB_HEADER_FILE}" LIBUSB_FOUND)
endif(LIBUSB_FOUND)
if(LIBUSB_FOUND AND NOT CMAKE_CROSSCOMPILING)
if(LIBUSB_SKIP_VERSION_CHECK)
message(STATUS "Skipping libusb version number check.")
unset(LIBUSB_VERSION)
else()
message(STATUS "Checking libusb version...")
if(WIN32)
string(REPLACE ".lib" ".dll" LIBUSB_DLL "${LIBUSB_LIBRARIES}")
try_run(LIBUSB_VERCHECK_RUN_RESULT
LIBUSB_VERCHECK_COMPILED
${CMAKE_HELPERS_BINARY_DIR}
${CMAKE_HELPERS_SOURCE_DIR}/libusb_version.c
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${LIBUSB_INCLUDE_DIRS}"
RUN_OUTPUT_VARIABLE LIBUSB_VERSION
ARGS "\"${LIBUSB_DLL}\""
)
else()
try_run(LIBUSB_VERCHECK_RUN_RESULT
LIBUSB_VERCHECK_COMPILED
${CMAKE_HELPERS_BINARY_DIR}
${CMAKE_HELPERS_SOURCE_DIR}/libusb_version.c
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${LIBUSB_INCLUDE_DIRS}" "-DLINK_LIBRARIES=${LIBUSB_LIBRARIES}"
RUN_OUTPUT_VARIABLE LIBUSB_VERSION
)
endif()
if (NOT LIBUSB_VERCHECK_COMPILED OR NOT LIBUSB_VERCHECK_RUN_RESULT EQUAL 0 )
message(STATUS "${LIBUSB_VERSION}")
set(LIBUSB_VERSION "0.0.0")
message(WARNING "\nFailed to compile (compiled=${LIBUSB_VERCHECK_COMPILED}) or run (retval=${LIBUSB_VERCHECK_RUN_RESULT}) libusb version check.\n"
"This may occur if libusb is earlier than v1.0.10.\n"
"Setting LIBUSB_VERSION to ${LIBUSB_VERSION}.\n")
return()
endif()
message(STATUS "libusb version: ${LIBUSB_VERSION}")
endif()
endif(LIBUSB_FOUND AND NOT CMAKE_CROSSCOMPILING)

View File

@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 2.8)
################################################################################
# Install libbladeRF header files
################################################################################
install(FILES
CyUSBSerial.h
DESTINATION include
)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,156 @@
set(VERSION_INFO_MAJOR 1)
set(VERSION_INFO_MINOR 0)
set(VERSION_INFO_PATCH 0)
if (NOT CMAKE_INSTALL_LIBDIR)
include(GNUInstallDirs)
endif (NOT CMAKE_INSTALL_LIBDIR)
# Fall back to just "lib" if the item provided by GNUInstallDirs doesn't exist
# For example, on Ubuntu 13.10 with CMake 2.8.11.2,
# /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} doesn't exist.
if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
message(STATUS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} does not exist. Defaulting libcyusbserial install location to ${CMAKE_INSTALL_PREFIX}/lib.")
set(CMAKE_INSTALL_LIBDIR lib)
endif()
################################################################################
# Include paths
################################################################################
set(LIBCYUSBSERIAL_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/../include
)
################################################################################
# Build dependencies
################################################################################
if(MSVC)
set(LIBCYUSBSERIAL_INCLUDES ${LIBCYUSBSERIAL_INCLUDES} ${MSVC_C99_INCLUDES})
find_package(LibPThreadsWin32 REQUIRED)
if(LIBPTHREADSWIN32_FOUND)
set(HAVE_THREADS true)
set(LIBCYUSBSERIAL_INCLUDES
${LIBCYUSBSERIAL_INCLUDES} ${LIBPTHREADSWIN32_INCLUDE_DIRS})
set(LIBCYUSBSERIAL_LIBS
${LIBCYUSBSERIAL_LIBS} ${LIBPTHREADSWIN32_LIBRARIES})
add_definitions(-DHAVE_STRUCT_TIMESPEC)
else()
set(HAVE_THREADS false)
endif()
else(MSVC)
find_package(Threads REQUIRED)
if(Threads_FOUND)
set(HAVE_THREADS true)
else()
set(HAVE_THREADS false)
endif()
endif(MSVC)
if (NOT HAVE_THREADS)
message(FATAL_ERROR "pthreads not found. This is required to build libcyusbserial.")
endif()
if(NOT LIBUSB_FOUND)
message(FATAL_ERROR "libusb-1.0 not found. This is required to use the libcyusbserial libusb backend. For binary releases, try setting LIBUSB_PATH.")
else(NOT LIBUSB_FOUND)
if(LIBUSB_VERSION)
if(NOT LIBUSB_VERSION VERSION_LESS "1.0.10")
add_definitions(-DHAVE_LIBUSB_GET_VERSION)
endif()
if(WIN32)
# We require v1.0.19 because it provides Windows 8 USB 3.0
# speed detection fixes, additional AMD/Intel USB 3.0 root
# hub support, and some fixes to issues reported on v1.0.18
# that yielded corrupted samples.
if(${LIBUSB_VERSION} VERSION_LESS "1.0.19")
message(FATAL_ERROR "libusb v1.0.19 is required in Windows.\n"
"Please update libusb or consider using the Cypress backend if this is not possible.\n"
"Detected version: ${LIBUSB_VERSION}\n")
endif()
elseif(APPLE)
# A number of important changes were included in libusb
# v1.0.16 hrough v1.0.18, including SuperSpeed support, 64-bit support,
# and various build and crash fixes.
if(${LIBUSB_VERSION} VERSION_LESS "1.0.18")
message(FATAL_ERROR "libusb v1.0.18 is required in OS X. Please update libusb."
"Detected version: ${LIBUSB_VERSION}\n")
endif()
elseif(UNIX)
# A number of reported issues supposedly became resolved after
# updating to >= 1.0.16.
if(${LIBUSB_VERSION} VERSION_LESS "1.0.16")
message(WARNING "\nlibusb >= 1.0.16 is HIGHLY recommended. "
"If you experience issues or poor performance, please try updating libusb.\n"
"Detected version: ${LIBUSB_VERSION}")
endif()
else()
message(WARNING "Unexpected system type. Please report this warning to developers.")
endif()
else()
message(WARNING "Not checking libcyusbserial/libusb compatibility because LIBUSB_VERSION is not defined.")
endif()
set(LIBCYUSBSERIAL_INCLUDES ${LIBCYUSBSERIAL_INCLUDES} ${LIBUSB_INCLUDE_DIRS})
endif(NOT LIBUSB_FOUND)
if(MSVC)
set(LIBCYUSBSERIAL_INCLUDES ${LIBCYUSBSERIAL_INCLUDES}
${LIBPTHREADSWIN32_INCLUDE_DIRS})
endif()
include_directories(${LIBCYUSBSERIAL_INCLUDES})
################################################################################
# Configure source files
################################################################################
set(LIBCYUSBSERIAL_SOURCE
cyusb.c
cyuart.c
cyi2c.c
cyspi.c
cyphdc.c
cyjtag.c
cymisc.c
)
if(MSVC)
set(LIBCYUSBSERIAL_SOURCE ${LIBCYUSBSERIAL_SOURCE}
${PROJECT_SOURCE_DIR}/windows/gettimeofday.c
${PROJECT_SOURCE_DIR}/windows/usleep.c
)
endif(MSVC)
add_library(cyusbserial SHARED ${LIBCYUSBSERIAL_SOURCE})
################################################################################
# Build configuration
################################################################################
if(MSVC)
add_definitions(-DCYUSBSERIAL_EXPORTS)
set(LIBCYUSBSERIAL_LIBS ${LIBCYUSBSERIAL_LIBS} ${LIBPTHREADSWIN32_LIBRARIES})
else()
set(LIBCYUSBSERIAL_LIBS ${LIBCYUSBSERIAL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
endif(MSVC)
set(LIBCYUSBSERIAL_LIBS ${LIBCYUSBSERIAL_LIBS} ${LIBUSB_LIBRARIES})
target_link_libraries(cyusbserial ${LIBCYUSBSERIAL_LIBS})
# Set shared library version
set_target_properties(cyusbserial PROPERTIES SOVERSION ${VERSION_INFO_MAJOR})
################################################################################
# Library installation information
################################################################################
install(TARGETS cyusbserial
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # .so/.dylib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # .a/.lib
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} # .dll
)

View File

@@ -0,0 +1,255 @@
/*
* Common header file of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** \file CyUSBCommon.h
* \brief Common header file of Cypress USB Serial
*/
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <pthread.h>
#include <libusb.h>
#include "CyUSBSerial.h"
typedef struct CY_DEVICE {
#pragma pack(1)
unsigned char inEndpoint;
unsigned char outEndpoint;
unsigned char interruptEndpoint;
unsigned char interfaceNum;
bool i2cCancelEvent;
bool spiCancelEvent;
bool uartCancelEvent;
bool rtsValue;
bool dtrValue;
unsigned short numEndpoints;
CY_FLOW_CONTROL_MODES uartFlowControlMode;
struct libusb_transfer *spiTransfer;
struct libusb_transfer *uartTransfer;
libusb_device_handle *devHandle;
pthread_t spiThread;
bool spiThreadRunning;
pthread_t uartThread;
bool uartThreadRunning;
#pragma pack()
pthread_mutex_t readLock;
pthread_mutex_t writeLock;
pthread_mutex_t notificationLock;
#pragma pack(1)
CY_DEVICE_TYPE deviceType;
#pragma pack()
}CY_DEVICE,*PCY_DEVICE;
CY_RETURN_STATUS CyResetPipe (CY_HANDLE handl, UINT8);
#define CY_DEBUG_PRINT_INFO(...) //User need to enable this
#define CY_DEBUG_PRINT_ERROR(...) //printf
#define DUMP_DATA 1
#ifdef DUMP_DATA
#define CY_DUMP_DATA(INPUT,LEN)\
{\
int i = 0, len = LEN;\
while ((len)) {\
printf ("%x ", (INPUT)[i++]);\
len--;\
}\
printf ("\n");\
}
#else
#define CY_DUMP_DATA (INPUT, LEN) do { }while (0);
#endif
#define CY_USB_SERIAL_TIMEOUT 5000
#define CY_EVENT_NOTIFICATION_TIMEOUT 0 //This will make the transfer infinite
#define CY_VENDOR_REQUEST_DEVICE_TO_HOST 0xC0
#define CY_VENDOR_REQUEST_HOST_TO_DEVICE 0x40
#define CY_CLASS_INTERFACE_REQUEST_DEVICE_TO_HOST 0XA1
#define CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE 0x21
//I2C related macros
#define CY_SCB_INDEX_POS 15
#define CY_I2C_CONFIG_LENGTH 16
#define CY_I2C_WRITE_COMMAND_POS 3
#define CY_I2C_WRITE_COMMAND_LEN_POS 4
#define CY_I2C_GET_STATUS_LEN 3
#define CY_I2C_MODE_WRITE 1
#define CY_I2C_MODE_READ 0
#define CY_I2C_ERROR_BIT (1)
#define CY_I2C_ARBITRATION_ERROR_BIT (1 << 1)
#define CY_I2C_NAK_ERROR_BIT (1 << 2)
#define CY_I2C_BUS_ERROR_BIT (1 << 3)
#define CY_I2C_STOP_BIT_ERROR (1 << 4)
#define CY_I2C_BUS_BUSY_ERROR (1 << 5)
#define CY_I2C_ENABLE_PRECISE_TIMING 1
#define CY_I2C_EVENT_NOTIFICATION_LEN 3
//SPI related Macros
#define CY_SPI_CONFIG_LEN 16
#define CY_SPI_EVENT_NOTIFICATION_LEN 2
#define CY_SPI_READ_BIT (1)
#define CY_SPI_WRITE_BIT (1 << 1)
#define CY_SPI_SCB_INDEX_BIT (1 << 15)
#define CY_SPI_GET_STATUS_LEN 4
#define CY_SPI_UNDERFLOW_ERROR (1)
#define CY_SPI_BUS_ERROR (1 << 1)
//Vendor UART related macros
#define CY_UART_SET_FLOW_CONTROL_CMD 0x60
#define CY_UART_SEND_BREAK_CMD 0x17
#define CY_UART_CONFIG_LEN 16
#define CY_SET_LINE_CONTROL_STATE_CMD 0x22
#define CY_UART_EVENT_NOTIFICATION_LEN 10
#define CY_UART_SERIAL_STATE_CARRIER_DETECT 1
#define CY_UART_SERIAL_STATE_TRANSMISSION_CARRIER (1 << 1)
#define CY_UART_SERIAL_STATE_BREAK_DETECTION (1<< 2)
#define CY_UART_SERIAL_STATE_RING_SIGNAL_DETECTION (1 << 3)
#define CY_UART_SERIAL_STATE_FRAMING_ERROR (1 << 4)
#define CY_UART_SERIAL_STATE_PARITY_ERROR (1 << 5)
#define CY_UART_SERIAL_STATUE_OVERRUN (1 << 6)
//Bootloader related macros
#define CY_BOOT_CONFIG_SIZE 64
#define CY_DEVICE_CONFIG_SIZE 512
#define CY_FIRMWARE_BREAKUP_SIZE 4096
#define CY_GET_SILICON_ID_LEN 4
#define CY_GET_FIRMWARE_VERSION_LEN 8
#define CY_GET_SIGNATURE_LEN 4
//JTAG related Macros
#define CY_JTAG_OUT_EP 0x04
#define CY_JTAG_IN_EP 0x85
//GPIO related Macros
#define CY_GPIO_GET_LEN 2
#define CY_GPIO_SET_LEN 1
//PHDC related macros
#define CY_PHDC_SET_FEATURE 0X03
#define CY_PHDC_SET_FEATURE_WVALUE 0x0101
#define CY_PHDC_CLR_FEATURE 0X01
#define CY_PHDC_CLR_FEATURE_WVALUE 0x1
#define CY_PHDC_GET_DATA_STATUS 0x00
#define CY_PHDC_GET_STATUS_LEN 2
typedef enum CY_VENDOR_CMDS
{
CY_GET_VERSION_CMD = 0xB0, /**< Get the version of the boot-loader.
* value = 0, index = 0, length = 4;
* data_in = 32 bit version.
*/
CY_GET_SIGNATURE_CMD = 0xBD, /**< Get the signature of the firmware
* It is suppose to be 'CYUS' for normal firmware
* and 'CYBL' for Bootloader.
*/
CY_UART_GET_CONFIG_CMD = 0xC0, /**< Retreive the 16 byte UART configuration information.
* MS bit of value indicates the SCB index.
* length = 16, data_in = 16 byte configuration.
*/
CY_UART_SET_CONFIG_CMD, /**< Update the 16 byte UART configuration information.
* MS bit of value indicates the SCB index.
* length = 16, data_out = 16 byte configuration information.
*/
CY_SPI_GET_CONFIG_CMD, /**< Retreive the 16 byte SPI configuration information.
* MS bit of value indicates the SCB index.
* length = 16, data_in = 16 byte configuration.
*/
CY_SPI_SET_CONFIG_CMD, /**< Update the 16 byte SPI configuration information.
* MS bit of value indicates the SCB index.
* length = 16, data_out = 16 byte configuration information.
*/
CY_I2C_GET_CONFIG_CMD, /**< Retreive the 16 byte I2C configuration information.
* MS bit of value indicates the SCB index.
* length = 16, data_in = 16 byte configuration.
*/
CY_I2C_SET_CONFIG_CMD = 0xC5, /**< Update the 16 byte I2C configuration information.
* MS bit of value indicates the SCB index.
* length = 16, data_out = 16 byte configuration information.
*/
CY_I2C_WRITE_CMD, /**< Perform I2C write operation.
* value = bit0 - start, bit1 - stop, bit3 - start on idle,
* bits[14:8] - slave address, bit15 - scbIndex. length = 0. The
* data is provided over the bulk endpoints.
*/
CY_I2C_READ_CMD, /**< Perform I2C read operation.
* value = bit0 - start, bit1 - stop, bit2 - Nak last byte,
* bit3 - start on idle, bits[14:8] - slave address, bit15 - scbIndex,
* length = 0. The data is provided over the bulk endpoints.
*/
CY_I2C_GET_STATUS_CMD, /**< Retreive the I2C bus status.
* value = bit0 - 0: TX 1: RX, bit15 - scbIndex, length = 3,
* data_in = byte0: bit0 - flag, bit1 - bus_state, bit2 - SDA state,
* bit3 - TX underflow, bit4 - arbitration error, bit5 - NAK
* bit6 - bus error,
* byte[2:1] Data count remaining.
*/
CY_I2C_RESET_CMD, /**< The command cleans up the I2C state machine and frees the bus.
* value = bit0 - 0: TX path, 1: RX path; bit15 - scbIndex,
* length = 0.
*/
CY_SPI_READ_WRITE_CMD = 0xCA, /**< The command starts a read / write operation at SPI.
* value = bit 0 - RX enable, bit 1 - TX enable, bit 15 - scbIndex;
* index = length of transfer.
*/
CY_SPI_RESET_CMD, /**< The command resets the SPI pipes and allows it to receive new
* request.
* value = bit 15 - scbIndex
*/
CY_SPI_GET_STATUS_CMD, /**< The command returns the current transfer status. The count will match
* the TX pipe status at SPI end. For completion of read, read all data
* at the USB end signifies the end of transfer.
* value = bit 15 - scbIndex
*/
CY_JTAG_ENABLE_CMD = 0xD0, /**< Enable JTAG module */
CY_JTAG_DISABLE_CMD, /**< Disable JTAG module */
CY_JTAG_READ_CMD, /**< JTAG read vendor command */
CY_JTAG_WRITE_CMD, /**< JTAG write vendor command */
CY_GPIO_GET_CONFIG_CMD = 0xD8, /**< Get the GPIO configuration */
CY_GPIO_SET_CONFIG_CMD, /**< Set the GPIO configuration */
CY_GPIO_GET_VALUE_CMD, /**< Get GPIO value */
CY_GPIO_SET_VALUE_CMD, /**< Set the GPIO value */
CY_PROG_USER_FLASH_CMD = 0xE0, /**< Program user flash area. The total space available is 512 bytes.
* This can be accessed by the user from USB. The flash area
* address offset is from 0x0000 to 0x00200 and can be written to
* page wise (128 byte).
*/
CY_READ_USER_FLASH_CMD, /**< Read user flash area. The total space available is 512 bytes.
* This can be accessed by the user from USB. The flash area
* address offset is from 0x0000 to 0x00200 and can be written to
* page wise (128 byte).
*/
CY_DEVICE_RESET_CMD = 0xE3, /**< Performs a device reset from firmware */
} CY_VENDOR_CMDS;
extern libusb_context *glContext;

686
release/cylib/lib/cyi2c.c Normal file
View File

@@ -0,0 +1,686 @@
/*
* I2C routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
#pragma pack(1)
typedef struct
{
UINT32 frequency; /**< Frequency of operation. Only valid values are
100KHz and 400KHz. */
UINT8 sAddress; /**< Slave address to be used when in slave mode. */
BOOL isMsbFirst; /**< Whether to transmit most significant bit first. */
BOOL isMaster; /**< Whether to block is to be configured as a master:
CyTrue - The block functions as I2C master.
CyFalse - The block functions as I2C slave. */
BOOL sIgnore; /**< Ignore general call in slave mode. */
BOOL clockStretch; /**< Wheteher to stretch clock in case of no FIFO availability. */
BOOL isLoopback; /**< Whether to loop back TX data to RX. Valid only
for debug purposes. */
UCHAR reserved[6]; /**< Reserved for future use */
} CyUsI2cConfig_t;
#pragma pack()
#ifdef CY_I2C_ENABLE_PRECISE_TIMING
struct timeval startTimeWrite, endTimeWrite, startTimeRead, endTimeRead;
//Timer helper functions for proper timing
void startI2cTick (bool isWrite) {
if (isWrite)
gettimeofday (&startTimeWrite, NULL);
else
gettimeofday (&startTimeRead, NULL);
}
UINT32 getI2cLapsedTime (bool isWrite){
signed int currentTime_sec, currentTime_usec, currentTime;
if (isWrite){
gettimeofday (&endTimeWrite, NULL);
currentTime_sec = (endTimeWrite.tv_sec - startTimeWrite.tv_sec) * 1000;
currentTime_usec = ((endTimeWrite.tv_usec - startTimeWrite.tv_usec)) / 1000;
currentTime = currentTime_sec + currentTime_usec;
return (unsigned int)currentTime;
}
else{
gettimeofday (&endTimeRead, NULL);
currentTime_sec = (endTimeRead.tv_sec - startTimeRead.tv_sec) * 1000;
currentTime_usec = ((endTimeRead.tv_usec - startTimeRead.tv_usec)) / 1000;
currentTime = currentTime_sec + currentTime_usec;
return (unsigned int)currentTime;
}
}
#endif
CY_RETURN_STATUS handleI2cError (UINT8 i2cStatus){
if (i2cStatus & CY_I2C_NAK_ERROR_BIT){
CY_DEBUG_PRINT_ERROR ("CY:Error Nacked by device ...Function is %s\n", __func__);
return CY_ERROR_I2C_NAK_ERROR;
}
if (i2cStatus & CY_I2C_BUS_ERROR_BIT){
CY_DEBUG_PRINT_ERROR ("CY:Error bus error occured... Function is %s\n", __func__);
return CY_ERROR_I2C_BUS_ERROR;
}
if (i2cStatus & CY_I2C_ARBITRATION_ERROR_BIT){
CY_DEBUG_PRINT_ERROR ("CY:Error Arbitration error occured.. Function is %s\n", __func__);
return CY_ERROR_I2C_ARBITRATION_ERROR;
}
if (i2cStatus & CY_I2C_STOP_BIT_ERROR){
CY_DEBUG_PRINT_ERROR ("CY:Error Stop bit set by master..Function is %s\n", __func__);
return CY_ERROR_I2C_STOP_BIT_SET;
}
else {
//We should never hit this case!!!!
CY_DEBUG_PRINT_ERROR ("CY:Unknown error..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
//Used internally by read and write API to check if data is received at the I2C end.
CY_RETURN_STATUS CyI2cGetStatus (CY_HANDLE handle, bool mode, UCHAR *i2cStatus);
CY_RETURN_STATUS waitForNotification (CY_HANDLE handle, UINT16 *bytesPending, UINT32 ioTimeout);
/*
* This API gets the current I2C config
* for the particluar interface of the device
*/
CY_RETURN_STATUS CyGetI2cConfig (
CY_HANDLE handle,
CY_I2C_CONFIG *i2cConfig
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
CyUsI2cConfig_t localI2cConfig;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 scbIndex = 0;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (i2cConfig == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_I2C) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not i2c ..Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
scbIndex = device->interfaceNum;
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_I2C_GET_CONFIG_CMD;
wValue = (scbIndex << CY_SCB_INDEX_POS);
wIndex = 0x00;
wLength = CY_I2C_CONFIG_LENGTH;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)&localI2cConfig, wLength, ioTimeout);
if (rStatus == CY_I2C_CONFIG_LENGTH){
CY_DEBUG_PRINT_INFO ("CY: Read I2C config ...size is %d \n", rStatus);
i2cConfig->frequency = localI2cConfig.frequency;
i2cConfig->slaveAddress = localI2cConfig.sAddress;
i2cConfig->isMaster = localI2cConfig.isMaster;
i2cConfig->isClockStretch = localI2cConfig.clockStretch;
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s\n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Error time out ....Function is %s\n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in doing I2C read ...libusb error is %d function is %s!\n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
* This API sets I2C config of the device for that
* interface
*/
CY_RETURN_STATUS CySetI2cConfig (
CY_HANDLE handle,
CY_I2C_CONFIG *i2cConfig
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
CyUsI2cConfig_t localI2cConfig;
int rStatus;
CY_DEVICE *device = NULL;
libusb_device_handle *devHandle;
UINT16 scbIndex = 0;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (i2cConfig == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if (i2cConfig->frequency < 1000 || i2cConfig->frequency > 400000){
CY_DEBUG_PRINT_ERROR ("CY:Error frequency trying to set in out of ..range Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if ((i2cConfig->slaveAddress % 2) != 0){
CY_DEBUG_PRINT_ERROR ("CY:Error slave address needs to even..Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
scbIndex = device->interfaceNum;
if (device->deviceType != CY_TYPE_I2C) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not i2c ..Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_I2C_SET_CONFIG_CMD;
wValue = (scbIndex << CY_SCB_INDEX_POS);
wIndex = 0x00;
wLength = CY_I2C_CONFIG_LENGTH;
//We need to pass entire 16 bytes config structure to firmware
//but we will not expose all the structure elements to user.
//so filling some of the values.
memset (&localI2cConfig, 0, CY_I2C_CONFIG_LENGTH);
localI2cConfig.frequency = i2cConfig->frequency;
localI2cConfig.sAddress = i2cConfig->slaveAddress;
localI2cConfig.isMaster = i2cConfig->isMaster;
localI2cConfig.clockStretch = i2cConfig->isClockStretch;
localI2cConfig.isMsbFirst = 1;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)&localI2cConfig, wLength, ioTimeout);
if (rStatus == CY_I2C_CONFIG_LENGTH){
CY_DEBUG_PRINT_INFO ("CY: Setting I2C config successful ...\n");
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s\n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Error time out ....Function is %s\n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in doing I2C read ...libusb error is %d function is %s!\n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
* This API reads I2C data from the specified interface of the device
* interface
*/
CY_RETURN_STATUS CyI2cRead (
CY_HANDLE handle,
CY_I2C_DATA_CONFIG *i2cDataConfig,
CY_DATA_BUFFER *readBuffer,
UINT32 ioTimeout
)
{
int rStatus;
CY_DEVICE *device = NULL;
libusb_device_handle *devHandle;
UINT16 wValue = 0, wIndex, wLength, bytesPending = 0;
UINT8 bmRequestType, bmRequest;
UCHAR i2cStatus[CY_I2C_GET_STATUS_LEN];
UINT16 scbIndex = 0;
bool mode = CY_I2C_MODE_READ;
UINT32 elapsedTime;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if ((readBuffer == NULL) || (readBuffer->buffer == NULL) || (readBuffer->length == 0)){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
readBuffer->transferCount = 0;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_I2C) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not i2c ..Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (pthread_mutex_trylock (&device->readLock) == 0){
scbIndex = device->interfaceNum;
if (scbIndex > 0)
scbIndex = 1;
i2cDataConfig->slaveAddress = ((i2cDataConfig->slaveAddress & 0x7F) | (scbIndex << 7));
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_I2C_READ_CMD;
wValue = ((i2cDataConfig->isStopBit) | (i2cDataConfig->isNakBit << 1));
wValue |= (((i2cDataConfig->slaveAddress) << 8));
wIndex = readBuffer->length;
wLength = 0;
rStatus = CyI2cGetStatus (handle, mode, (UCHAR *)i2cStatus);
if (rStatus == CY_SUCCESS)
{
if ((i2cStatus[0] & CY_I2C_ERROR_BIT)){
CY_DEBUG_PRINT_ERROR ("CY:Error device busy ... function is %s \n", __func__);
pthread_mutex_unlock (&device->readLock);
return CY_ERROR_I2C_DEVICE_BUSY;
}
}
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == LIBUSB_ERROR_NO_DEVICE){
CY_DEBUG_PRINT_ERROR ("CY:Error device disconnected ... \n");
pthread_mutex_unlock (&device->readLock);
return CY_ERROR_DEVICE_NOT_FOUND;
}
if (rStatus < 0){
CY_DEBUG_PRINT_ERROR ("CY:Error in sending Read vendor command ... Libusb Error is %d .. Function is %s \n", rStatus, __func__);
pthread_mutex_unlock (&device->readLock);
return CY_ERROR_I2C_DEVICE_BUSY;
}
//Hoping that previous calls do not take much time!!
#ifdef CY_I2C_ENABLE_PRECISE_TIMING
startI2cTick(false);
#endif
rStatus = libusb_bulk_transfer (devHandle, device->inEndpoint, readBuffer->buffer, readBuffer->length,
(int*)&readBuffer->transferCount, ioTimeout);
#ifdef CY_I2C_ENABLE_PRECISE_TIMING
elapsedTime = getI2cLapsedTime(false);
//Giving an extra 10 msec to notification to findout the status
ioTimeout = (ioTimeout - elapsedTime);
if (ioTimeout == 0)
ioTimeout = 10;
#endif
if (rStatus == LIBUSB_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY: Successfully read i2c data.. %d bytes Read ...\n", readBuffer->transferCount);
bytesPending = readBuffer->length;
rStatus = waitForNotification (handle, &bytesPending, ioTimeout);
if (rStatus)
readBuffer->transferCount = (readBuffer->length - bytesPending);
else
readBuffer->transferCount = readBuffer->length;
pthread_mutex_unlock (&device->readLock);
return rStatus;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Timeout error ..Function is %s\n", __func__);
pthread_mutex_unlock (&device->readLock);
return CY_ERROR_IO_TIMEOUT;
}
else if (rStatus == LIBUSB_ERROR_PIPE){
CY_DEBUG_PRINT_INFO ("Pipe Error \n");
rStatus = CyResetPipe (handle, device->outEndpoint);
if (rStatus != CY_SUCCESS){
CY_DEBUG_PRINT_ERROR ("Error in reseting the pipe \n");
}
else {
CY_DEBUG_PRINT_INFO ("Reset pipe succeded \n");
}
rStatus = CyI2cGetStatus (handle, mode, (UCHAR *)i2cStatus);
if (rStatus == CY_SUCCESS)
{
CyI2cReset (handle, mode);
rStatus = handleI2cError (i2cStatus[0]);
pthread_mutex_unlock (&device->readLock);
return rStatus;
}
else {
pthread_mutex_unlock (&device->readLock);
return CY_ERROR_I2C_DEVICE_BUSY;
}
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
pthread_mutex_unlock (&device->readLock);
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s\n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else {
pthread_mutex_unlock (&device->readLock);
CY_DEBUG_PRINT_ERROR ("CY: Error in doing I2C read ...libusb error is %d function is %s!\n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
else{
CY_DEBUG_PRINT_ERROR ("CY: Error API busy in servicing previous request... function is %s!\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
* This API writes I2C data into the specified interface of the device
*/
CY_RETURN_STATUS CyI2cWrite (
CY_HANDLE handle,
CY_I2C_DATA_CONFIG *i2cDataConfig,
CY_DATA_BUFFER *writeBuffer,
UINT32 ioTimeout
)
{
int rStatus;
UCHAR i2cStatus[CY_I2C_GET_STATUS_LEN];
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue = 0, wIndex, wLength, bytesPending = 0;
UINT8 bmRequestType, bmRequest;
UINT16 scbIndex = 0;
BOOL mode = CY_I2C_MODE_WRITE;
UINT32 elapsedTime;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if ((writeBuffer == NULL) || (writeBuffer->buffer == NULL) || (writeBuffer->length == 0)){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
writeBuffer->transferCount = 0;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
scbIndex = device->interfaceNum;
if (device->deviceType != CY_TYPE_I2C){
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not i2c ..Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (pthread_mutex_trylock (&device->writeLock) == 0){
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_I2C_WRITE_CMD;
i2cDataConfig->slaveAddress = ((i2cDataConfig->slaveAddress & 0x7F) | (scbIndex << 7));
wValue = ((i2cDataConfig->isStopBit));
wValue |= (((i2cDataConfig->slaveAddress) << 8));
wIndex = (UINT16)(writeBuffer->length);
wLength = 0;
CY_DEBUG_PRINT_INFO ("wValue is %x \n", wValue);
//Send I2C write vendor command before actually sending the data over bulk ep
rStatus = CyI2cGetStatus (handle, mode, (UCHAR *)i2cStatus);
if (rStatus == CY_SUCCESS)
{
if ((i2cStatus[0] & CY_I2C_ERROR_BIT)){
CY_DEBUG_PRINT_ERROR ("CY:Error ... Device busy ... function is %s \n", __func__);
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_I2C_DEVICE_BUSY;
}
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE){
CY_DEBUG_PRINT_ERROR ("CY:Error device not found \n");
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_DEVICE_NOT_FOUND;
}
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == LIBUSB_ERROR_NO_DEVICE){
CY_DEBUG_PRINT_ERROR ("CY:Error device not found \n");
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_DEVICE_NOT_FOUND;
}
if (rStatus < 0){
CY_DEBUG_PRINT_ERROR ("CY:Error in sending write vendor command ... Libusb Error is %d \n", rStatus);
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_I2C_DEVICE_BUSY;
}
//After vendor command is sent send the actual data to be sent to i2c devic
#ifdef CY_I2C_ENABLE_PRECISE_TIMING
startI2cTick(true);
#endif
rStatus = libusb_bulk_transfer (devHandle, device->outEndpoint, writeBuffer->buffer, writeBuffer->length,
(int*)&(writeBuffer->transferCount), ioTimeout);
#ifdef CY_I2C_ENABLE_PRECISE_TIMING
elapsedTime = getI2cLapsedTime(true);
ioTimeout = (ioTimeout - elapsedTime);
//Giving an extra 10 msec to notification to findout the status
if (ioTimeout == 0)
ioTimeout = 10;
#endif
//Once the data is sent to usbserial, check if it was actually written to i2c device.
if (rStatus == LIBUSB_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY: Successfully written i2c data.. %d bytes written ...\n", writeBuffer->transferCount);
bytesPending = writeBuffer->length;
rStatus = waitForNotification (handle, &bytesPending, ioTimeout);
if (rStatus)
writeBuffer->transferCount = (writeBuffer->length - bytesPending);
else
writeBuffer->transferCount = writeBuffer->length;
pthread_mutex_unlock (&device->writeLock);
return rStatus;
}
//Transaction is stallled when we hit some I2C error while the transfer
//was going on. After we hit this error clear stall and check why we hit this by
//CyGetStatus.
else if (rStatus == LIBUSB_ERROR_PIPE){
CY_DEBUG_PRINT_INFO ("CY:Pipe Error ... Function is %s\n", __func__);
rStatus = CyResetPipe (handle, device->outEndpoint);
if (rStatus != CY_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in reseting the pipe ..Function is %s\n", __func__);
}
else {
CY_DEBUG_PRINT_INFO ("Reset pipe succeded \n");
}
rStatus = CyI2cGetStatus (handle, mode, (UCHAR *)i2cStatus);
if (rStatus == CY_SUCCESS)
{
CyI2cReset (handle, mode);
rStatus = handleI2cError (i2cStatus[0]);
pthread_mutex_unlock (&device->writeLock);
return rStatus;
}
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s\n", __func__);
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Error time out ....Function is %s\n", __func__);
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_IO_TIMEOUT;
}
else{
CY_DEBUG_PRINT_ERROR ("CY: Error in doing I2C read ...libusb error is %d function is %s!\n", rStatus, __func__);
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_REQUEST_FAILED;
}
}
else{
CY_DEBUG_PRINT_ERROR ("CY:API busy with servicing previous request... function is %s!\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_REQUEST_FAILED;
}
/*
* This API gets the current status of the I2C data transaction
*/
CY_RETURN_STATUS CyI2cGetStatus (
CY_HANDLE handle,
bool mode,
UCHAR *i2cStatus
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue, wIndex, wLength, bmRequestType, bmRequest;;
UINT16 scbIndex = 0;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
if (i2cStatus == NULL)
return CY_ERROR_INVALID_PARAMETER;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_I2C) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not i2c .. \n");
return CY_ERROR_REQUEST_FAILED;
}
scbIndex = device->interfaceNum;
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_I2C_GET_STATUS_CMD;
wValue = ((scbIndex << CY_SCB_INDEX_POS) | mode);
wIndex = 0;
wLength = CY_I2C_GET_STATUS_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,wValue, wIndex, (UCHAR*)i2cStatus, wLength, ioTimeout);
if (rStatus < CY_I2C_GET_STATUS_LEN){
CY_DEBUG_PRINT_INFO ("CY:Error in sending I2C Get Status command...Libusb error is %d\n", rStatus);
return rStatus;
}
return CY_SUCCESS;
}
/*
* This API resets the I2C module
*/
CY_RETURN_STATUS CyI2cReset (
CY_HANDLE handle,
BOOL resetMode
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue, wIndex, wLength, bmRequestType, bmRequest;
UINT16 scbIndex = 0;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_I2C) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not i2c .. \n");
return CY_ERROR_REQUEST_FAILED;
}
scbIndex = device->interfaceNum;
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_I2C_RESET_CMD;
wValue = ((scbIndex << CY_SCB_INDEX_POS) | resetMode );
wIndex = 0;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus < 0){
CY_DEBUG_PRINT_ERROR ("CY:Error in sending I2C Reset command ..libusb error is %d\n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
return CY_SUCCESS;
}
static void LIBUSB_CALL i2c_notification_cb(struct libusb_transfer *transfer)
{
UINT32 *completed = transfer->user_data;
*completed = 1;
}
CY_RETURN_STATUS waitForNotification (CY_HANDLE handle, UINT16 *bytesPending, UINT32 ioTimeout){
UINT32 transferCompleted = 0, length = CY_I2C_EVENT_NOTIFICATION_LEN;
CY_DEVICE *device;
libusb_device_handle *devHandle;
struct libusb_transfer *transfer;
CY_RETURN_STATUS errorStatus, rStatus;
UCHAR i2cStatus[CY_I2C_EVENT_NOTIFICATION_LEN];
struct timeval time;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
transfer = libusb_alloc_transfer(0);
if (transfer == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error in allocating trasnfer \n");
errorStatus = CY_ERROR_ALLOCATION_FAILED;
(*bytesPending) = 0;
return errorStatus;
//callbackFn (errorStatus, 0);
}
libusb_fill_interrupt_transfer (transfer, devHandle, device->interruptEndpoint, i2cStatus, length,
i2c_notification_cb, &transferCompleted, ioTimeout);
if (libusb_submit_transfer (transfer)){
CY_DEBUG_PRINT_ERROR ("CY:Error in submitting interrupt transfer ...\n");
libusb_cancel_transfer (transfer);
libusb_free_transfer (transfer);
(*bytesPending) = 0;
//callbackFn (CY_ERROR_REQUEST_FAILED, 0);
return CY_ERROR_REQUEST_FAILED;
}
time.tv_sec = 0;
time.tv_usec = 50;//polling timeout.
while (transferCompleted == 0){
libusb_handle_events_timeout (glContext, &time);
}
transferCompleted = 0;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED){
CY_DEBUG_PRINT_INFO ("CY:Info successfully recieved data on interrupt pipe length is %d \n", transfer->actual_length);
if (i2cStatus[0] & 0x80){ //Error notification is for write
if ((i2cStatus[0] & CY_I2C_ERROR_BIT)){
CY_DEBUG_PRINT_INFO ("Bytes pending is %x %x %x", i2cStatus[0], i2cStatus[1], i2cStatus[2]);
//There was some error, so reset the i2c module and usb module
//of the device, so branch out of the loop(Check below for the errors reported).
rStatus = CyI2cReset (device, CY_I2C_MODE_WRITE);
if (rStatus != CY_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY:i2c reset failed \n");
}
//Report the amount of byte that were actually written
memcpy(bytesPending, &i2cStatus[1], 2);
errorStatus = handleI2cError (i2cStatus[0]);
}
else
errorStatus = CY_SUCCESS;
}
else //Error notification is for read
{
if ((i2cStatus[0] & CY_I2C_ERROR_BIT)){
CY_DEBUG_PRINT_INFO ("Bytes pending is %x %x %x", i2cStatus[0], i2cStatus[1], i2cStatus[2]);
rStatus = CyI2cReset (device, CY_I2C_MODE_READ);
if (rStatus != CY_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY:i2c reset failed \n");
}
//Report the amount of byte that were actually written
memcpy(bytesPending, &i2cStatus[1], 2);
errorStatus = handleI2cError (i2cStatus[0]);
}
else
errorStatus = CY_SUCCESS;
}
libusb_free_transfer (transfer);
return errorStatus;
}
else{
libusb_cancel_transfer (transfer);
if (transfer->status == LIBUSB_TRANSFER_TIMED_OUT){
CY_DEBUG_PRINT_ERROR ("CY:Error Timeout in getting i2c transfer status ....\n");
CyI2cGetStatus (handle, 1, (UCHAR *)&errorStatus);
errorStatus = CY_ERROR_IO_TIMEOUT;
}
if (transfer->status == LIBUSB_TRANSFER_OVERFLOW){
CY_DEBUG_PRINT_ERROR ("CY:Error buffer overFlow in i2c transfer status ....\n");
errorStatus = CY_ERROR_BUFFER_OVERFLOW;
}
if (transfer->status != LIBUSB_TRANSFER_COMPLETED){
CY_DEBUG_PRINT_ERROR ("CY:Error in i2c transfer status ... Libusb transfer error is %d \n", transfer->status);
errorStatus = CY_ERROR_REQUEST_FAILED;
}
libusb_free_transfer (transfer);
return CY_ERROR_REQUEST_FAILED;
}
}

248
release/cylib/lib/cyjtag.c Normal file
View File

@@ -0,0 +1,248 @@
/*
* JTAG routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
/*
* This API enables the Jtag module
*/
CY_RETURN_STATUS CyJtagEnable (
CY_HANDLE handle
)
{
UINT16 wValue, wIndex, wLength;
UINT16 bmRequestType, bmRequest;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_JTAG) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not jtag ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_JTAG_ENABLE_CMD;
wValue = 0x00;
wIndex = 0;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus >= 0){
CY_DEBUG_PRINT_INFO ("CY: JTAG enable successfully \n");
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
* This API disables the Jtag module
*/
CY_RETURN_STATUS CyJtagDisable (
CY_HANDLE handle
)
{
UINT16 wValue, wIndex, wLength;
UINT16 bmRequestType, bmRequest;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_JTAG) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not jtag ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_JTAG_DISABLE_CMD;
wValue = 0x00;
wIndex = 0;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus >= 0){
CY_DEBUG_PRINT_INFO ("CY: JTAG disable successfully \n");
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error while enabling JTAG ..\n");
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error while enabling JTAG ...libusb error is %d function is %s!\n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
* This API is used to do jtag write
*/
CY_RETURN_STATUS CyJtagWrite (
CY_HANDLE handle,
CY_DATA_BUFFER *writeBuffer,
UINT32 ioTimeout
)
{
int rStatus = 0;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue, wIndex, wLength;
UINT16 bmRequestType, bmRequest;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if ((writeBuffer == NULL) || (writeBuffer->buffer == NULL) || (writeBuffer->length == 0)){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_JTAG) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not jtag ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_JTAG_WRITE_CMD;
wValue = writeBuffer->length;
wIndex = 0;
wLength = 0;
writeBuffer->transferCount = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus < 0){
CY_DEBUG_PRINT_ERROR ("CY: JTAG Vendor command failed %d...function is %s \n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
rStatus = libusb_bulk_transfer (devHandle, CY_JTAG_OUT_EP, writeBuffer->buffer, writeBuffer->length,
(int*)&(writeBuffer->transferCount), ioTimeout);
if (rStatus == CY_SUCCESS) {
CY_DEBUG_PRINT_ERROR ("CY: Number of bytes written is .... %d \n", writeBuffer->transferCount);
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:TimeOut error ...Function is %s %d\n", __func__, writeBuffer->transferCount);
return CY_ERROR_IO_TIMEOUT;
}
else if (rStatus == LIBUSB_ERROR_PIPE){
CY_DEBUG_PRINT_ERROR ("CY:Pipe error Function is %s \n", __func__);
CyResetPipe (handle, CY_JTAG_OUT_EP);
return CY_ERROR_PIPE_HALTED;
}
else if (rStatus == LIBUSB_ERROR_OVERFLOW){
CY_DEBUG_PRINT_ERROR ("CY:Error Buffer Overflow..Function is %s \n", __func__);
return CY_ERROR_BUFFER_OVERFLOW;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s \n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in Function %s...Libusb Error is %d !\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This API is used to read JTAG data from device interface
*/
CY_RETURN_STATUS CyJtagRead (
CY_HANDLE handle,
CY_DATA_BUFFER *readBuffer,
UINT32 ioTimeout
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue, wIndex, wLength;
UINT16 bmRequestType, bmRequest;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if ((readBuffer == NULL) || (readBuffer->buffer == NULL) || (readBuffer->length == 0)){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_JTAG) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not jtag ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_JTAG_READ_CMD;
wValue = readBuffer->length;
wIndex = 0;
wLength = 0;
readBuffer->transferCount = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus < 0){
CY_DEBUG_PRINT_INFO ("CY: JTAG Vendor Command failed %d.. Function is %s \n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
rStatus = libusb_bulk_transfer (devHandle, CY_JTAG_IN_EP, readBuffer->buffer, readBuffer->length,
(int*)&(readBuffer->transferCount), ioTimeout);
if (rStatus == CY_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY: Number of bytes read is .... %d \n", readBuffer->transferCount);
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:TimeOut error ...Function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else if (rStatus == LIBUSB_ERROR_PIPE){
CY_DEBUG_PRINT_ERROR ("CY:Pipe error Function is %s \n", __func__);
CyResetPipe (handle, CY_JTAG_IN_EP);
return CY_ERROR_PIPE_HALTED;
}
else if (rStatus == LIBUSB_ERROR_OVERFLOW){
CY_DEBUG_PRINT_ERROR ("CY:Error Buffer Overflow..Function is %s \n", __func__);
return CY_ERROR_BUFFER_OVERFLOW;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s \n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function is %s ...Libusb Error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}

591
release/cylib/lib/cymisc.c Normal file
View File

@@ -0,0 +1,591 @@
/*
* Miscellaneous routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
typedef struct NOTIFICATION_CB_PARAM{
CY_HANDLE handle;
CY_EVENT_NOTIFICATION_CB_FN notificationCbFn;
}NOTIFICATION_CB_PARAM;
/*
This API is used to Read the Bootloder version
*/
CY_RETURN_STATUS CyGetFirmwareVersion(
CY_HANDLE handle,
CY_FIRMWARE_VERSION *firmwareVersion
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_GET_VERSION_CMD;
wValue = 0x00;
wIndex = 0x00;
wLength = CY_GET_FIRMWARE_VERSION_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)firmwareVersion, wLength, ioTimeout);
if (rStatus > 0){
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
The API resets the device
*/
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CyResetDevice (
CY_HANDLE handle /*Valid device handle*/
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle \n");
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_DEVICE_RESET_CMD;
wValue = 0xA6B6;
wIndex = 0xADBA;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
//return buffer will tell the status of the command
if (rStatus == LIBUSB_SUCCESS)
return CY_SUCCESS;
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CySetGpioValue (
CY_HANDLE handle, /*Valid device handle*/
UINT8 gpioNumber, /*GPIO configuration value*/
UINT8 value /*Value that needs to be set*/
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest, buffer[CY_GPIO_SET_LEN];
int rStatus;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (value)
value = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_GPIO_SET_VALUE_CMD;
wValue = gpioNumber;
wIndex = value;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, buffer, wLength, ioTimeout);
if (rStatus >= 0){
CY_DEBUG_PRINT_INFO ("CY: Get Configuration of GPIO succedded...size is %d \n", rStatus);
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CyGetGpioValue (
CY_HANDLE handle, /*Valid device handle*/
UINT8 gpioNumber, /*GPIO configuration value*/
UINT8 *value /*Value that needs to be set*/
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest, buffer[CY_GPIO_GET_LEN];
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_GPIO_GET_VALUE_CMD;
wValue = gpioNumber;
wIndex = 0x00;
wLength = CY_GPIO_GET_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, buffer, wLength, ioTimeout);
if (rStatus == CY_GPIO_GET_LEN){
CY_DEBUG_PRINT_INFO ("CY: Get GPIO Configuration succedded...size is %d \n", rStatus);
//return buffer will tell the status of the command
if (buffer[0] == 0){
(*value) = buffer[1];
return CY_SUCCESS;
}
else
return CY_ERROR_REQUEST_FAILED;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
static void LIBUSB_CALL uart_notification_cb(struct libusb_transfer *transfer)
{
UINT32 *completed = transfer->user_data;
*completed = 1;
}
void* uartSetEventNotifcation (void *inputParameters)
{
int rStatus, transferCompleted = 0, length = CY_UART_EVENT_NOTIFICATION_LEN;
CY_DEVICE *device;
libusb_device_handle *devHandle;
struct libusb_transfer *transfer;
UINT16 errorStatus = 0;
UCHAR uartStatus[CY_UART_EVENT_NOTIFICATION_LEN];
struct timeval time;
CY_EVENT_NOTIFICATION_CB_FN callbackFn;
NOTIFICATION_CB_PARAM *cbParameters = (NOTIFICATION_CB_PARAM*)inputParameters;
callbackFn = cbParameters->notificationCbFn;
device = (CY_DEVICE *)cbParameters->handle;
devHandle = device->devHandle;
callbackFn = cbParameters->notificationCbFn;
device->uartTransfer = transfer = libusb_alloc_transfer(0);
if (transfer == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error in allocating trasnfer \n");
errorStatus |= CY_ERROR_EVENT_FAILED_BIT;
callbackFn(errorStatus);
goto END;
}
while (device->uartCancelEvent == false){
libusb_fill_interrupt_transfer (transfer, devHandle, device->interruptEndpoint, uartStatus, length,
uart_notification_cb, &transferCompleted, CY_EVENT_NOTIFICATION_TIMEOUT);
rStatus = libusb_submit_transfer (transfer);
if (rStatus){
CY_DEBUG_PRINT_ERROR ("CY:Error submitting uart interrupt token ... Libusb error is %d\n", rStatus);
errorStatus |= CY_ERROR_EVENT_FAILED_BIT;
callbackFn(errorStatus);
break;
}
time.tv_sec = 0;
time.tv_usec = 50;//polling timeout.
while (transferCompleted == 0){
libusb_handle_events_timeout (glContext, &time);
}
transferCompleted = 0;
if (transfer->status == LIBUSB_TRANSFER_COMPLETED){
CY_DEBUG_PRINT_INFO ("Successfully read and recieved data %d \n", transfer->actual_length);
memcpy (&errorStatus, &uartStatus[8], 2);
printf ("%x %x ", uartStatus[8], uartStatus[9]);
callbackFn (errorStatus);
errorStatus = 0;
}
else{
errorStatus |= CY_ERROR_EVENT_FAILED_BIT;
if (device->uartCancelEvent == false){
CY_DEBUG_PRINT_ERROR ("CY:Error uart interrupt thread encountered error... Libusb transmission error is %d \n", transfer->status);
pthread_join (device->uartThread, NULL);
device->uartThreadRunning = false;
callbackFn(errorStatus);
}
break;
}
}
CY_DEBUG_PRINT_INFO ("Exiting notification thread \n");
libusb_free_transfer (transfer);
END:
free (inputParameters);
return NULL;
}
static void LIBUSB_CALL spi_notification_cb(struct libusb_transfer *transfer)
{
UINT32 *completed = transfer->user_data;
*completed = 1;
}
void* spiSetEventNotifcation (void *inputParameters)
{
int transferCompleted = 0, length = CY_SPI_EVENT_NOTIFICATION_LEN;
CY_DEVICE *device;
libusb_device_handle *devHandle;
struct libusb_transfer *transfer;
UINT16 spiStatus = 0;
unsigned char spiStatusBuffer[2] = {0, 0};
UINT16 errorStatus = 0;
struct timeval time;
CY_EVENT_NOTIFICATION_CB_FN callbackFn;
NOTIFICATION_CB_PARAM *cbParameters = (NOTIFICATION_CB_PARAM*)inputParameters;
callbackFn = cbParameters->notificationCbFn;
device = (CY_DEVICE *)cbParameters->handle;
devHandle = device->devHandle;
callbackFn = cbParameters->notificationCbFn;
device->spiTransfer = transfer = libusb_alloc_transfer(0);
if (transfer == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error in allocating trasnfer \n");
errorStatus |= CY_ERROR_EVENT_FAILED_BIT;
callbackFn (errorStatus);
goto END;
}
libusb_fill_interrupt_transfer (transfer, devHandle, device->interruptEndpoint, spiStatusBuffer, length,
spi_notification_cb, &transferCompleted, CY_EVENT_NOTIFICATION_TIMEOUT);
while (device->spiCancelEvent == false){
if (libusb_submit_transfer (transfer)){
CY_DEBUG_PRINT_ERROR ("CY:Error submitting spi interrupt token ... \n");
errorStatus |= CY_ERROR_EVENT_FAILED_BIT;
callbackFn(errorStatus);
break;
}
time.tv_sec = 0;
time.tv_usec = 50;//polling timeout.
while (transferCompleted == 0){
libusb_handle_events_timeout (glContext, &time);
}
transferCompleted = 0;
spiStatus = (spiStatusBuffer[1] << 8) | spiStatusBuffer[0];
if (transfer->status == LIBUSB_TRANSFER_COMPLETED){
CY_DEBUG_PRINT_INFO ("Successfully read and recieved data %d \n", transfer->actual_length);
if (spiStatus & CY_SPI_UNDERFLOW_ERROR){
errorStatus |= (CY_SPI_TX_UNDERFLOW_BIT);
}
if (spiStatus & CY_SPI_BUS_ERROR){
errorStatus |= (CY_SPI_BUS_ERROR_BIT);
}
callbackFn (errorStatus);
errorStatus = 0;
}
else{
spiStatus |= CY_ERROR_EVENT_FAILED_BIT;
if (device->spiCancelEvent == false){
pthread_join (device->spiThread, NULL);
device->spiThreadRunning = false;
CY_DEBUG_PRINT_ERROR ("CY:Error spi interrupt thread was cancelled... Libusb transmission error is %d \n", transfer->status);
callbackFn (spiStatus);
}
break;
}
}
libusb_free_transfer (transfer);
END:
free (inputParameters);
pthread_exit (NULL);
return NULL;
}
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CySetEventNotification(
CY_HANDLE handle, /*Valid handle to communicate with device*/
CY_EVENT_NOTIFICATION_CB_FN notificationCbFn /*Call back function in case on error during Uart data transfers*/
)
{
CY_DEVICE *device;
NOTIFICATION_CB_PARAM *args = NULL;
int ret;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (notificationCbFn == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE*)handle;
pthread_mutex_lock (&device->notificationLock);
args = (NOTIFICATION_CB_PARAM *)malloc (sizeof (NOTIFICATION_CB_PARAM));
args->handle = handle;
args->notificationCbFn = notificationCbFn;
if (device->deviceType == CY_TYPE_SPI){
if (device->spiThreadRunning) {
CY_DEBUG_PRINT_ERROR ("CY:Error already notification thread exists ... Function is %s \n", __func__);
free (args);
pthread_mutex_unlock (&device->notificationLock);
return CY_ERROR_STATUS_MONITOR_EXIST;
}
ret = pthread_create (&device->spiThread, NULL, spiSetEventNotifcation, (void *) args);
if (ret == 0){
device->spiThreadRunning = true;
pthread_mutex_unlock (&device->notificationLock);
return CY_SUCCESS;
}
else {
pthread_join (device->spiThread, NULL);
device->spiThreadRunning = false;
free (args);
pthread_mutex_unlock (&device->notificationLock);
CY_DEBUG_PRINT_ERROR ("CY:Error creating spi notification thread ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
else if (device->deviceType == CY_TYPE_UART){
if (device->uartThreadRunning) {
CY_DEBUG_PRINT_ERROR ("CY:Error already notification thread exists ... Function is %s \n", __func__);
free (args);
pthread_mutex_unlock (&device->notificationLock);
return CY_ERROR_STATUS_MONITOR_EXIST;
}
ret = pthread_create (&device->uartThread, NULL, uartSetEventNotifcation, (void *) args);
if (ret == 0){
device->uartThreadRunning = true;
pthread_mutex_unlock (&device->notificationLock);
return CY_SUCCESS;
}
else {
pthread_join (device->uartThread, NULL);
device->uartThreadRunning = false;
free (args);
pthread_mutex_unlock (&device->notificationLock);
CY_DEBUG_PRINT_ERROR ("CY:Error creating uart notification thread ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error unknown device type ....Function is %s \n", __func__);
free (args);
pthread_mutex_unlock (&device->notificationLock);
return CY_ERROR_REQUEST_FAILED;
}
}
/*The API is used to cancel the uart Event notification*/
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CyAbortEventNotification(
CY_HANDLE handle /*Valid handle to communicate with device*/
)
{
CY_DEVICE *device;
device = (CY_DEVICE*)handle;
pthread_mutex_lock (&device->notificationLock);
if (device->deviceType == CY_TYPE_UART){
if (!device->uartThreadRunning){
CY_DEBUG_PRINT_ERROR ("CY:Error uart event notification not created ....function is %s \n", __func__);
pthread_mutex_unlock (&device->notificationLock);
return CY_ERROR_REQUEST_FAILED;
}
device->uartCancelEvent = true;
libusb_cancel_transfer (device->uartTransfer);
pthread_join (device->uartThread, NULL);
device->uartThreadRunning = false;
device->uartCancelEvent = false;
pthread_mutex_unlock (&device->notificationLock);
return CY_SUCCESS;
}
else if (device->deviceType == CY_TYPE_SPI){
if (!device->spiThreadRunning){
CY_DEBUG_PRINT_ERROR ("CY:Error spi event notification not created ....function is %s \n", __func__);
pthread_mutex_unlock (&device->notificationLock);
return CY_ERROR_REQUEST_FAILED;
}
device->spiCancelEvent = true;
libusb_cancel_transfer (device->spiTransfer);
pthread_join (device->spiThread, NULL);
device->spiThreadRunning = false;
device->spiCancelEvent = false;
pthread_mutex_unlock (&device->notificationLock);
return CY_SUCCESS;
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error.. unknown device type ....function is %s \n", __func__);
pthread_mutex_unlock (&device->notificationLock);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
The API is used to programme user flash area
*/
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CyProgUserFlash (
CY_HANDLE handle, /*Valid device handle*/
CY_DATA_BUFFER *progBuffer, /*data buffer containing buffer address, length to write*/
UINT32 flashAddress, /*Address to the data is written*/
UINT32 ioTimeout /*Timeout value of the API*/
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
if ((progBuffer == NULL) || (progBuffer->buffer == NULL))
return CY_ERROR_INVALID_PARAMETER;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_PROG_USER_FLASH_CMD;
wValue = 0;
wIndex = flashAddress;
wLength = progBuffer->length;
CY_DEBUG_PRINT_INFO ("CY:The Length is %d , Value is %d and index is %d\n", wLength, wValue, wIndex);
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, progBuffer->buffer, wLength, ioTimeout);
if (rStatus > 0){
(progBuffer->transferCount) = rStatus;
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
(progBuffer->transferCount) = 0;
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
(progBuffer->transferCount) = 0;
return CY_ERROR_REQUEST_FAILED;
}
}
/*
The API is used to programme user flash area
*/
CYWINEXPORT CY_RETURN_STATUS WINCALLCONVEN CyReadUserFlash (
CY_HANDLE handle, /*Valid device handle*/
CY_DATA_BUFFER *readBuffer, /*data buffer containing buffer address, length to write*/
UINT32 flashAddress, /*Address to the data is written*/
UINT32 ioTimeout /*Timeout value of the API*/
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
if (readBuffer == NULL)
return CY_ERROR_INVALID_PARAMETER;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_READ_USER_FLASH_CMD;
wValue = 0;
wIndex = flashAddress;
wLength = readBuffer->length;
CY_DEBUG_PRINT_INFO ("CY:The Length is %d , Value is %d and index is %d\n", wLength, wValue, wIndex);
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, readBuffer->buffer, wLength, ioTimeout);
if (rStatus > 0){
(readBuffer->transferCount) = rStatus;
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
(readBuffer->transferCount) = 0;
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
(readBuffer->transferCount) = 0;
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This API is used to get the signature of the device. It would be CYUS when we are in actual device mode
and CYBL when we are bootloader mode
*/
CY_RETURN_STATUS CyGetSignature (
CY_HANDLE handle,
UCHAR *signature
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_GET_SIGNATURE_CMD;
wValue = 0x00;
wIndex = 0x00;
wLength = CY_GET_SIGNATURE_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)signature, wLength, ioTimeout);
if (rStatus > 0){
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}

130
release/cylib/lib/cyphdc.c Normal file
View File

@@ -0,0 +1,130 @@
/*
* PHDC routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
/*
PHDC clear feature
*/
CY_RETURN_STATUS CyPhdcClrFeature (CY_HANDLE handle)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_PHDC_CLR_FEATURE;
wValue = CY_PHDC_CLR_FEATURE_WVALUE;
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == 0)
return CY_SUCCESS;
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
return CY_SUCCESS;
}
/*
PHDC set feature
*/
CY_RETURN_STATUS CyPhdcSetFeature (CY_HANDLE handle)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_PHDC_SET_FEATURE;
wValue = CY_PHDC_SET_FEATURE_WVALUE;
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == 0)
return CY_SUCCESS;
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
PHDC clear feature
*/
CY_RETURN_STATUS CyPhdcGetStatus (CY_HANDLE handle, UINT16 *dataStatus)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
bmRequestType = CY_CLASS_INTERFACE_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_PHDC_GET_DATA_STATUS;
wValue = 0x00;
wIndex = device->interfaceNum;
wLength = CY_PHDC_GET_STATUS_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)dataStatus, wLength, ioTimeout);
if (rStatus > 0)
return CY_SUCCESS;
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..function is %s \n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ...libusb error is %d!\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}

644
release/cylib/lib/cyspi.c Normal file
View File

@@ -0,0 +1,644 @@
/*
* SPI routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
#include <signal.h>
#include <sys/time.h>
#pragma pack (1)
typedef struct args {
CY_HANDLE handle;
UCHAR *readBuffer;
UINT32 length;
UINT32 ioTimeout;
CY_RETURN_STATUS rStatus;
UINT32 transferCount;
}args;
typedef struct
{
UINT32 frequency;
UINT8 dataWidth;
UCHAR mode;
UCHAR xferMode;
BOOL isMsbFirst;
BOOL isMaster;
BOOL isContinuous;
BOOL isSelectPrecede;
BOOL cpha;
BOOL cpol;
BOOL isLoopback;
UCHAR reserved[2];
} CyUsSpiConfig_t;
#pragma pack()
struct timeval startSpiTimeWrite, endSpiTimeWrite, startSpiTimeRead, endSpiTimeRead;
//Timer helper functions for proper timing
void startSpiTick (bool isWrite) {
if (isWrite)
gettimeofday (&startSpiTimeWrite, NULL);
else
gettimeofday (&startSpiTimeRead, NULL);
}
UINT32 getSpiLapsedTime (bool isWrite){
signed int currentTime_sec, currentTime_usec, currentTime;
if (isWrite){
gettimeofday (&endSpiTimeWrite, NULL);
currentTime_sec = (endSpiTimeWrite.tv_sec - startSpiTimeWrite.tv_sec) * 1000;
currentTime_usec = ((endSpiTimeWrite.tv_usec - startSpiTimeWrite.tv_usec)) / 1000;
currentTime = currentTime_sec + currentTime_usec;
return (unsigned int)currentTime;
}
else{
gettimeofday (&endSpiTimeRead, NULL);
currentTime_sec = (endSpiTimeRead.tv_sec - startSpiTimeRead.tv_sec) * 1000;
currentTime_usec = ((endSpiTimeRead.tv_usec - startSpiTimeRead.tv_usec)) / 1000;
currentTime = currentTime_sec + currentTime_usec;
return (unsigned int)currentTime;
}
}
/*
This API gets the current SPI config
for the particluar interface of the device
*/
CY_RETURN_STATUS CyGetSpiConfig (
CY_HANDLE handle,
CY_SPI_CONFIG *spiConfig
)
{
UINT16 wValue, wIndex, wLength;
UINT16 bmRequestType, bmRequest;
CyUsSpiConfig_t localSpiConfig;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
UINT8 scbIndex = 0;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (spiConfig == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_SPI) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not spi ..Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (device->interfaceNum > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_SPI_GET_CONFIG_CMD;
wValue = (scbIndex << CY_SCB_INDEX_POS);
wIndex = 0;
wLength = CY_SPI_CONFIG_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)&localSpiConfig, wLength, ioTimeout);
if (rStatus == CY_SPI_CONFIG_LEN){
//CY_DUMP_DATA ((unsigned char*)&localSpiConfig, wLength);
CY_DEBUG_PRINT_INFO ("CY: Read SPI config successfully %d\n", rStatus);
spiConfig->frequency = localSpiConfig.frequency;
spiConfig->dataWidth = localSpiConfig.dataWidth;
spiConfig->protocol = localSpiConfig.mode;
spiConfig->isMsbFirst = localSpiConfig.isMsbFirst;
spiConfig->isMaster = localSpiConfig.isMaster;
spiConfig->isContinuousMode = localSpiConfig.isContinuous;
spiConfig->isSelectPrecede = localSpiConfig.isSelectPrecede;
spiConfig->isCpha = localSpiConfig.cpha;
spiConfig->isCpol = localSpiConfig.cpol;
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ... Function is %s\n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s...libusb error is %d !\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This API sets SPI config of the device for that
interface
*/
CY_RETURN_STATUS CySetSpiConfig (
CY_HANDLE handle,
CY_SPI_CONFIG *spiConfig
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
CyUsSpiConfig_t localSpiConfig;
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
UINT8 scbIndex = 0;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (spiConfig == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_SPI) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not spi ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (spiConfig->frequency < 1000 || spiConfig->frequency > 3000000){
CY_DEBUG_PRINT_ERROR ("CY:Error frequency trying to set in out of range ... Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if (spiConfig->protocol == CY_SPI_TI){
if (!(spiConfig->isCpol == false && spiConfig->isCpha == true && spiConfig->isContinuousMode == false)){
CY_DEBUG_PRINT_ERROR ("CY:Error ... Wrong configuration for SPI TI mode \n");
return CY_ERROR_REQUEST_FAILED;
}
}
if (spiConfig->protocol == CY_SPI_NS){
if (!(spiConfig->isCpol == false && spiConfig->isCpha == false && spiConfig->isSelectPrecede == false)){
CY_DEBUG_PRINT_ERROR ("CY:Error ... Wrong configuration for SPI ti mode \n");
return CY_ERROR_REQUEST_FAILED;
}
}
else{
if (spiConfig->isSelectPrecede != false){
CY_DEBUG_PRINT_ERROR ("CY:Error ... Wrong configuration for SPI motorola mode \n");
return CY_ERROR_REQUEST_FAILED;
}
}
if (device->interfaceNum > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_SPI_SET_CONFIG_CMD;
wValue = (scbIndex << CY_SCB_INDEX_POS);
wIndex = 0;
wLength = CY_SPI_CONFIG_LEN;
//We will not expose all the spi config structure elements to user.
//Fill in rest of the values.
memset (&localSpiConfig, 0, CY_SPI_CONFIG_LEN);
localSpiConfig.frequency = spiConfig->frequency;
localSpiConfig.dataWidth = spiConfig->dataWidth;
localSpiConfig.mode = spiConfig->protocol;
localSpiConfig.isMsbFirst = spiConfig->isMsbFirst;
localSpiConfig.isMaster = spiConfig->isMaster;
localSpiConfig.isContinuous = spiConfig->isContinuousMode;
localSpiConfig.isSelectPrecede = spiConfig->isSelectPrecede;
localSpiConfig.cpha = spiConfig->isCpha;
localSpiConfig.cpol = spiConfig->isCpol;
//CY_DUMP_DATA ((unsigned char*)&localSpiConfig, wLength);
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)&localSpiConfig, wLength, ioTimeout);
if (rStatus == CY_SPI_CONFIG_LEN){
CY_DEBUG_PRINT_INFO ("CY: Setting SPI config success ...\n");
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Time out error ..Function is %s\n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in function %s ... !libusb error is %d\n", __func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*Api will reset the spi module*/
CY_RETURN_STATUS CySpiReset (CY_HANDLE handle)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue, wIndex, wLength, bmRequestType, bmRequest;;
UINT16 scbIndex = 0;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_SPI) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not spi ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
scbIndex = device->interfaceNum;
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_SPI_RESET_CMD;
wValue = ((scbIndex << CY_SCB_INDEX_POS));
wIndex = 0;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus < 0){
CY_DEBUG_PRINT_ERROR ("CY:Error in sending spi reset command...Libusb error is %d\n", rStatus);
return rStatus;
}
return CY_SUCCESS;
}
/*
This API reads SPI data from the specified interface of the device
interface
*/
static void LIBUSB_CALL spi_read_cb(struct libusb_transfer *transfer)
{
UINT32 *completed = transfer->user_data;
*completed = 1;
}
//We adopted for async method here because there are 2 thread polling same fd
// i.e both read and write are polling same fd when one event triggers and other one is
//not completed then another thread will wait for more than 60sec.
CY_RETURN_STATUS CySpiRead (
CY_HANDLE handle,
CY_DATA_BUFFER *readBuffer,
UINT32 ioTimeout
)
{
struct libusb_transfer *readTransfer;
CY_DEVICE *device;
libusb_device_handle *devHandle;
int readCompleted = 0;
struct timeval time;
int r;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
readBuffer->transferCount = 0;
readTransfer = libusb_alloc_transfer(0);
if (readTransfer == NULL){
CY_DEBUG_PRINT_ERROR("CY:Error in allocating transfers \n");
return CY_ERROR_ALLOCATION_FAILED;
}
libusb_fill_bulk_transfer(readTransfer, devHandle, device->inEndpoint, readBuffer->buffer, readBuffer->length,
spi_read_cb, &readCompleted, ioTimeout);
libusb_submit_transfer (readTransfer);
time.tv_sec = (ioTimeout / 1000);
time.tv_usec = ((ioTimeout % 1000) * 1000);//polling timeout.
while (readCompleted == 0){
r = libusb_handle_events_timeout_completed(glContext, &time, &readCompleted);
if (r < 0) {
if (r == LIBUSB_ERROR_INTERRUPTED)
continue;
libusb_cancel_transfer(readTransfer);
while (!readCompleted)
if (libusb_handle_events_completed(glContext, &readCompleted) < 0)
break;
readBuffer->transferCount = readTransfer->actual_length;
libusb_free_transfer(readTransfer);
return r;
}
}
if (readTransfer->status == LIBUSB_TRANSFER_COMPLETED){
readBuffer->transferCount = readTransfer->actual_length;
libusb_free_transfer (readTransfer);
return CY_SUCCESS;
}
else{
if (readTransfer->status == LIBUSB_TRANSFER_TIMED_OUT){
//We should not be hitting this case.. As the time out is infinite!!
CY_DEBUG_PRINT_ERROR ("CY:Timeout error in doing SPI read/write .... %d Libusb errors %d\n",
readTransfer->actual_length,readTransfer->status);
readBuffer->transferCount = readTransfer->actual_length;
CySpiReset (handle);
libusb_free_transfer (readTransfer);
return CY_ERROR_IO_TIMEOUT;
}
if (readTransfer->status == LIBUSB_TRANSFER_OVERFLOW){
//Need to handle this properly!
CY_DEBUG_PRINT_ERROR ("CY:OverFlow error in doing SPI read/write .... Libusb errors %d %d \n",
readTransfer->status, readTransfer->actual_length);
readBuffer->transferCount = readTransfer->actual_length;
CySpiReset (handle);
libusb_free_transfer (readTransfer);
return CY_ERROR_BUFFER_OVERFLOW;
}
if (readTransfer->status != LIBUSB_TRANSFER_COMPLETED){
CY_DEBUG_PRINT_ERROR ("CY:Error in doing SPI read/write .... Libusb errors are %d %d\n",
readTransfer->status, readTransfer->actual_length);
readBuffer->transferCount = readTransfer->actual_length;
CySpiReset (handle);
libusb_free_transfer (readTransfer);
//If timer is not completed then it implies we have timeout error
return CY_ERROR_REQUEST_FAILED;
}
}
return CY_ERROR_REQUEST_FAILED;
}
/*Internal SPI get status API for Write operation*/
CY_RETURN_STATUS CyGetSpiStatus (CY_HANDLE handle,
int *spiStatus
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT16 wValue, wIndex, wLength, bmRequestType, bmRequest;;
UINT16 scbIndex = 0;
UINT32 ioTimeout = 0;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_SPI) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not spi ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
scbIndex = device->interfaceNum;
if (scbIndex > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_SPI_GET_STATUS_CMD;
wValue = ((scbIndex << CY_SCB_INDEX_POS));
wIndex = 0;
wLength = CY_SPI_GET_STATUS_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,wValue, wIndex, (UCHAR*)spiStatus, wLength, ioTimeout);
if (rStatus < CY_SPI_GET_STATUS_LEN){
CY_DEBUG_PRINT_INFO ("CY:Error in sending spi Get Status command...Libusb error is %d\n", rStatus);
return rStatus;
}
return CY_SUCCESS;
}
/* Function to write on to SPI alone*/
CY_RETURN_STATUS CySpiWrite (
CY_HANDLE handle,
CY_DATA_BUFFER *writeBuffer,
UINT32 ioTimeout
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
int spiStatus = 1;
UINT32 newIoTimeout = ioTimeout, elapsedTime = 0, loopCount = 1;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_SPI) {
CY_DEBUG_PRINT_ERROR ("CY:Error device type is not spi ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
startSpiTick (true);
rStatus = libusb_bulk_transfer (devHandle, device->outEndpoint, writeBuffer->buffer, writeBuffer->length,
(int*)&(writeBuffer->transferCount), newIoTimeout);
elapsedTime = getSpiLapsedTime(true);
newIoTimeout = ioTimeout - elapsedTime;
//because we have a sleep of 1 msec after every getstatus
if (newIoTimeout)
loopCount = (newIoTimeout);
if (rStatus == LIBUSB_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY: Successfully written SPI data.. %d bytes Read ...\n", writeBuffer->transferCount);
while (loopCount){
usleep (1000);
rStatus = CyGetSpiStatus (handle, &spiStatus);
if (rStatus == CY_SUCCESS){
if (spiStatus == 0){
return CY_SUCCESS;
}
}
else {
//Should never hit this case
CY_DEBUG_PRINT_ERROR ("CY:Error in getting spi status \n");
return CY_ERROR_REQUEST_FAILED;
}
if (ioTimeout)
loopCount--;
}
if (loopCount == 0 && spiStatus > 0){
writeBuffer->length = 0;
CySpiReset (handle);
return CY_ERROR_IO_TIMEOUT;
}
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:Error TimeOut ...function is %s\n", __func__);
CySpiReset (handle);
return CY_ERROR_IO_TIMEOUT;
}
else if (rStatus == LIBUSB_ERROR_PIPE){
CY_DEBUG_PRINT_ERROR ("CY:Error Pipe error..function is %s\n", __func__);
CySpiReset (handle);
CyResetPipe (handle, device->outEndpoint);
return CY_ERROR_PIPE_HALTED;
}
else if (rStatus == LIBUSB_ERROR_OVERFLOW){
CY_DEBUG_PRINT_ERROR ("CY:Error Buffer Overflow...function is %s\n", __func__);
return CY_ERROR_BUFFER_OVERFLOW;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY:Error Device Disconnected ...function is %s\n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error in writing SPI data ...Libusb Error is %d and bytes read is %d!\n", rStatus, writeBuffer->transferCount);
return CY_ERROR_REQUEST_FAILED;
}
return CY_ERROR_REQUEST_FAILED;
}/*
API to wrap up the data
*/
void spiCollectData (void *inputParameters) {
UINT32 readLength = 0, length;
CY_DATA_BUFFER readBuffer;
args *inputData = (args *) inputParameters;
UCHAR *buffer;
CY_RETURN_STATUS rStatus = CY_SUCCESS;
buffer = readBuffer.buffer = inputData->readBuffer;
length = readBuffer.length = inputData->length;
CY_HANDLE handle = inputData->handle;
int newTimeout = inputData->ioTimeout, elapsedTime;
while (readLength != length && newTimeout >= 0 && rStatus == CY_SUCCESS){
//Get current time
//Buffer is pointing to next address where we are suppose to fill the data
readBuffer.buffer = &buffer[readLength];
//Updated length which total length minus the total length of data read
readBuffer.length = length - readLength;
//Libusb fix for mac os!!
//ISSUE:when api times out in MAC it comes back and say read length = 0!!
#ifdef __APPLE__
if (readBuffer.length > 64)
readBuffer.length = 64;
#endif
startSpiTick (false);
rStatus = CySpiRead (handle, &readBuffer, newTimeout);
elapsedTime = getSpiLapsedTime (false);
//Do this only when newTimeout is non zero
if (newTimeout){
newTimeout = newTimeout - elapsedTime;
//If timeout is 0 then libusb considers that as infinite
//So forcefully make the loop to comeout
if (newTimeout <= 0)
rStatus = CY_ERROR_IO_TIMEOUT;
}
if (rStatus != CY_SUCCESS){
readLength += readBuffer.transferCount;
break;
}
readLength += readBuffer.transferCount;
}
if (readLength != length && rStatus == CY_ERROR_IO_TIMEOUT){
CySpiReset (handle);
}
inputData->transferCount = readLength;
inputData->rStatus = rStatus;
}
/*
* Api used to do read as well as write on spi
*/
CY_RETURN_STATUS CySpiReadWrite (CY_HANDLE handle,
CY_DATA_BUFFER *readBuffer,
CY_DATA_BUFFER *writeBuffer,
UINT32 ioTimeout)
{
struct args threadParameter;
UINT32 ret;
pthread_t readThreadID;
CY_DEVICE *device;
libusb_device_handle *devHandle;
CY_RETURN_STATUS rStatus;
unsigned short spiTransferMode = 0, scbIndex = 0;
UINT16 wValue, wIndex = 0, wLength;
UINT16 bmRequestType, bmRequest;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle.. Function is %s \n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (readBuffer == NULL && writeBuffer == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_SPI) {
CY_DEBUG_PRINT_ERROR ("CY:Error opened device is not spi .. \n");
return CY_ERROR_REQUEST_FAILED;
}
//Set both the bits and change it accordingly based on parameters parameters
spiTransferMode |= ((CY_SPI_READ_BIT) | (CY_SPI_WRITE_BIT));
if ((readBuffer == NULL || readBuffer->length == 0 || readBuffer->buffer == NULL))
spiTransferMode &= ~(CY_SPI_READ_BIT);
if ((writeBuffer == NULL || writeBuffer->length == 0 || writeBuffer->buffer == NULL))
spiTransferMode &= ~(CY_SPI_WRITE_BIT);
//if none of the bit is set it implies parameters sent is wrong
if (spiTransferMode == 0){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter.. Function is %s \n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if (device->interfaceNum > 0)
scbIndex = 1;
//In read only case we take length to be equal to readBuffer length.
//But in write or in write/read case we take length = writeBuffer length.
if (spiTransferMode == 0x1)
wIndex = readBuffer->length;
else
wIndex = writeBuffer->length;
spiTransferMode |= (scbIndex << 15);
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_SPI_READ_WRITE_CMD;
wValue = (spiTransferMode);
wLength = 0;
if (pthread_mutex_trylock (&device->writeLock) == 0){
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, 5000);
if (rStatus){
CY_DEBUG_PRINT_ERROR ("CY:Error Sending spi read write vendor command failed ... Libusb error is %d\n", rStatus);
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_REQUEST_FAILED;
}
//Read Bit is not set then write Only
if (!(spiTransferMode & CY_SPI_READ_BIT)) {
writeBuffer->transferCount = 0;
if (readBuffer)
readBuffer->transferCount = 0;
rStatus = CySpiWrite (handle, writeBuffer, ioTimeout);
pthread_mutex_unlock (&device->writeLock);
return rStatus;
}
//Write Bit is not set then read only
if (!(spiTransferMode & CY_SPI_WRITE_BIT)) {
// We are starting a thread so that we can collect all the data
// FIX for short length packet issue on SPI.
readBuffer->transferCount = 0;
if (writeBuffer)
writeBuffer->transferCount = 0;
threadParameter.handle = handle;
threadParameter.readBuffer = readBuffer->buffer;
threadParameter.length = readBuffer->length;
threadParameter.ioTimeout = ioTimeout;
ret = pthread_create (&readThreadID, NULL, (void *)spiCollectData, (void *)&threadParameter);
if (ret){
CY_DEBUG_PRINT_ERROR ("CY:Error in creating read thread ... Reading failed \n");
pthread_mutex_unlock (&device->writeLock);
readBuffer->transferCount = 0;
return CY_ERROR_REQUEST_FAILED;
}
pthread_join (readThreadID, NULL);
readBuffer->transferCount = threadParameter.transferCount;
pthread_mutex_unlock (&device->writeLock);
return threadParameter.rStatus;
}
writeBuffer->transferCount = 0;
readBuffer->transferCount = 0;
threadParameter.handle = handle;
threadParameter.readBuffer = readBuffer->buffer;
threadParameter.length = readBuffer->length;
threadParameter.ioTimeout = ioTimeout;
ret = pthread_create (&readThreadID, NULL, (void *)spiCollectData, (void *)&threadParameter);
if (ret){
CY_DEBUG_PRINT_ERROR ("CY:Error in creating read thread ... Reading failed \n");
readBuffer->transferCount = 0;
pthread_mutex_unlock (&device->writeLock);
return CY_ERROR_REQUEST_FAILED;
}
rStatus = CySpiWrite (handle, writeBuffer, ioTimeout);
if (rStatus == CY_SUCCESS) {
pthread_join (readThreadID, NULL);
rStatus = threadParameter.rStatus;
readBuffer->transferCount = threadParameter.transferCount;
}
else {
pthread_join (readThreadID, NULL);
readBuffer->transferCount = threadParameter.transferCount;
}
pthread_mutex_unlock (&device->writeLock);
return rStatus;
}
else{
CY_DEBUG_PRINT_ERROR ("CY:Error API busy in service previous request ... Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
return rStatus;
}

588
release/cylib/lib/cyuart.c Normal file
View File

@@ -0,0 +1,588 @@
/*
* UART routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
#pragma pack(1)
typedef struct {
CY_UART_BAUD_RATE baudRate;
UINT8 pinType;
UINT8 dataWidth;
UINT8 stopBits;
UINT8 mode;
UINT8 parity;
UINT8 isMsbFirst;
UINT8 txRetry;
UINT8 rxInvertPolarity;
UINT8 rxIgnoreError;
UINT8 isFlowControl;
UINT8 isLoopBack;
UINT8 flags;
}CyUsUartConfig_t;
#pragma pack()
//Timer helper functions for proper timing
UINT32 getUartLapsedTime (struct timeval startTime){
signed int currentTime_sec, currentTime_usec, currentTime;
struct timeval endTime;
gettimeofday (&endTime, NULL);
currentTime_sec = (endTime.tv_sec - startTime.tv_sec) * 1000;
currentTime_usec = ((endTime.tv_usec - startTime.tv_usec)) / 1000;
currentTime = currentTime_sec + currentTime_usec;
return (unsigned int)currentTime;
}
/*
This API gets the current UART configuration of the
device.Such as GPIO's assigned, flowcontrol, BaudRate
etc.
*/
CY_RETURN_STATUS CyGetUartConfig (
CY_HANDLE handle,
PCY_UART_CONFIG uartConfig
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
CY_DEVICE *device;
CyUsUartConfig_t localUartConfig;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
UINT8 scbIndex = 0;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (uartConfig == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameter..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (device->interfaceNum > 0)
scbIndex = 1;
bmRequestType = CY_VENDOR_REQUEST_DEVICE_TO_HOST;
bmRequest = CY_UART_GET_CONFIG_CMD;
wValue = (scbIndex << CY_SCB_INDEX_POS);
wIndex = 0;
wLength = CY_UART_CONFIG_LEN;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)&localUartConfig, wLength, ioTimeout);
//Since we are not exposing all the configuration elements
//parse and fill only relevant elements.
if (rStatus == CY_UART_CONFIG_LEN){
uartConfig->dataWidth = localUartConfig.dataWidth;
uartConfig->baudRate = localUartConfig.baudRate;
uartConfig->stopBits = localUartConfig.stopBits;
uartConfig->parityMode = (CY_UART_PARITY_MODE)localUartConfig.parity;;
uartConfig->isDropOnRxErrors = localUartConfig.rxIgnoreError;
//We are currently ignoring rest of the bits
CY_DEBUG_PRINT_INFO ("CY:Successfully read UART Config\n");
return CY_SUCCESS;
}
else{
CY_DEBUG_PRINT_ERROR ("CY:Error in reading UART config ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This API sets the current UART configuration of the
device.Such as GPIO's assigned, flowcontrol, BaudRate
etc.
*/
CY_RETURN_STATUS CySetUartConfig (
CY_HANDLE handle,
CY_UART_CONFIG *uartConfig
)
{
UINT16 wValue, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
CyUsUartConfig_t localUartConfig;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
UINT8 scbIndex = 0;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (uartConfig == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameter..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if (uartConfig->dataWidth < 7 || uartConfig->dataWidth > 8){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameter..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if (uartConfig->stopBits < 1 || uartConfig->stopBits > 2){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameter..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->interfaceNum > 0)
scbIndex = 1;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_VENDOR_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_UART_SET_CONFIG_CMD;
wValue = (scbIndex << CY_SCB_INDEX_POS);
wIndex = 0;
wLength = CY_UART_CONFIG_LEN;
memset (&localUartConfig, 0, CY_UART_CONFIG_LEN);
//Fill in rest of the UART config structure elements
//that are not exposed in API with default values
localUartConfig.baudRate = uartConfig->baudRate;
localUartConfig.dataWidth = uartConfig->dataWidth;
localUartConfig.stopBits = uartConfig->stopBits;
localUartConfig.parity = (UCHAR) uartConfig->parityMode;
localUartConfig.rxIgnoreError = uartConfig->isDropOnRxErrors;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, (unsigned char*)&localUartConfig, wLength, ioTimeout);
if (rStatus == CY_UART_CONFIG_LEN){
CY_DEBUG_PRINT_INFO ("CY:Successfully Set UART Config \n");
return CY_SUCCESS;
}
else{
CY_DEBUG_PRINT_ERROR ("CY:Error in Setting UART config ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This Api writes the Data to UART block of the
device.
*/
CY_RETURN_STATUS CyUartWrite (
CY_HANDLE handle,
CY_DATA_BUFFER* writeBuffer,
unsigned int ioTimeOut
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if ((writeBuffer == NULL) || (writeBuffer->buffer == NULL) || (writeBuffer->length == 0)){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameters..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
writeBuffer->transferCount = 0;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
rStatus = libusb_bulk_transfer (devHandle, device->outEndpoint, writeBuffer->buffer, writeBuffer->length,
(int *)&((writeBuffer->transferCount)), ioTimeOut);
if (rStatus == CY_SUCCESS) {
CY_DEBUG_PRINT_INFO ("CY: SuccessFull in Wrting Data,%d bytes were transfered \n", (writeBuffer->transferCount));
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
CY_DEBUG_PRINT_ERROR ("CY:TimeOut error ...Function is %s\n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else if (rStatus == LIBUSB_ERROR_PIPE){
CY_DEBUG_PRINT_ERROR ("CY:Pipe error endpoint Halted ...Function is %s\n", __func__);
CyResetPipe (handle, device->outEndpoint);
return CY_ERROR_PIPE_HALTED;
}
else if (rStatus == LIBUSB_ERROR_OVERFLOW){
CY_DEBUG_PRINT_ERROR ("CY:Error Buffer Overflow occured ...Function is %s\n", __func__);
return CY_ERROR_BUFFER_OVERFLOW;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected .... Function is %s\n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Unknown error ....Libusb error is %d Function is %s\n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This Api Reads the Data from UART block of the
device.
*/
CY_RETURN_STATUS CyUartRead (
CY_HANDLE handle,
CY_DATA_BUFFER* readBuffer,
unsigned int ioTimeOut
)
{
int rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
UINT32 length, totalRead = 0, newIoTimeout = ioTimeOut, elapsedTime;
int transferCount;
UCHAR *buffer;
struct timeval startTime;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if ((readBuffer == NULL) || (readBuffer->buffer == NULL) || (readBuffer->length == 0)){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameters..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
length = readBuffer->length;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
readBuffer->transferCount = 0;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
//Collect all the data in low baud rate for uart. As we get data in short packet
do {
// buffer will be pointing to new pointer
buffer = &(readBuffer->buffer[totalRead]);
//Start the tick
gettimeofday(&startTime, NULL);
rStatus = libusb_bulk_transfer (devHandle, device->inEndpoint, buffer, length,
&transferCount, newIoTimeout);
elapsedTime = getUartLapsedTime(startTime);
//Get the new timeout.
newIoTimeout = newIoTimeout - elapsedTime;
//Initialise totalRead to initially read + bytes returned now
totalRead += transferCount;
//length will initial length - transferCount
length = (length - transferCount);
}while ((rStatus == CY_SUCCESS) && (totalRead != readBuffer->length) && (newIoTimeout > 0));
if (newIoTimeout <= 0 && totalRead != readBuffer->length)
rStatus = LIBUSB_ERROR_TIMEOUT;
if (rStatus == CY_SUCCESS){
//CY_DUMP_DATA (readBuffer->buffer, readBuffer->transferCount);
readBuffer->transferCount = totalRead;
CY_DEBUG_PRINT_INFO ("CY: SuccessFull in Reading Data,%d bytes were transfered \n", (readBuffer->transferCount));
return CY_SUCCESS;
}
else if (rStatus == LIBUSB_ERROR_TIMEOUT){
readBuffer->transferCount = totalRead;
CY_DEBUG_PRINT_ERROR ("CY:TimeOut error... Function is %s\n", __func__);
return CY_ERROR_IO_TIMEOUT;
}
else if (rStatus == LIBUSB_ERROR_PIPE){
readBuffer->transferCount = totalRead;
CY_DEBUG_PRINT_ERROR ("CY:Pipe error endpoint Halted ...Function is %s\n", __func__);
CyResetPipe (handle, device->inEndpoint);
return CY_ERROR_PIPE_HALTED;
}
else if (rStatus == LIBUSB_ERROR_OVERFLOW){
readBuffer->transferCount = totalRead;
CY_DEBUG_PRINT_ERROR ("CY:Error Buffer Overflow occured ...Function is %s\n", __func__);
return CY_ERROR_BUFFER_OVERFLOW;
}
else if (rStatus == LIBUSB_ERROR_NO_DEVICE) {
readBuffer->transferCount = totalRead;
CY_DEBUG_PRINT_ERROR ("CY: Device Disconnected ....Function is %s\n", __func__);
return CY_ERROR_DEVICE_NOT_FOUND;
}
else {
readBuffer->transferCount = totalRead;
CY_DEBUG_PRINT_ERROR ("CY: Unknown error ....Libusb error is %d Function is %s\n", rStatus, __func__);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This Api sets the hardware flow control
*/
CY_RETURN_STATUS CyUartSetHwFlowControl (
CY_HANDLE handle,
CY_FLOW_CONTROL_MODES mode
)
{
UINT16 wValue = 0, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (mode > 3){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid parameter..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_UART_SET_FLOW_CONTROL_CMD;
wValue |= mode;
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus < 0){
CY_DEBUG_PRINT_ERROR ("CY:Error in setting uart flow control ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
device->uartFlowControlMode = mode;
return CY_SUCCESS;
}
/*
Api gets the current flow control mode
*/
CY_RETURN_STATUS CyUartGetHwFlowControl (
CY_HANDLE handle,
CY_FLOW_CONTROL_MODES *mode
)
{
CY_DEVICE *device;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
if (mode == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid input parameters..Function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
device = (CY_DEVICE *)handle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
(*mode) = device->uartFlowControlMode;
return CY_SUCCESS;
}
/* The API is used to break
*/
CYWINEXPORT CY_RETURN_STATUS CyUartSetBreak(
CY_HANDLE handle, /*Valid handle to communicate with device*/
UINT16 timeout /*Break timeout value in milliseconds */
)
{
UINT16 wValue = 0, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_UART_SEND_BREAK_CMD;
wValue = timeout;
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in setting break ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
return CY_SUCCESS;
}
/*
This Api sets the RTS UART pins High
*/
CY_RETURN_STATUS CyUartSetRts (
CY_HANDLE handle
)
{
UINT16 wValue = 0, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus;
UINT32 ioTimeout = CY_USB_SERIAL_TIMEOUT;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_SET_LINE_CONTROL_STATE_CMD;
wValue |= (1 << 1) | (device->dtrValue);
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == CY_SUCCESS){
device->rtsValue = 1;
return CY_SUCCESS;
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error in setting RTS of UART ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This Api clears the RTS UART pin and makes it low
*/
CY_RETURN_STATUS CyUartClearRts (
CY_HANDLE handle
)
{
UINT16 wValue = 0, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_SET_LINE_CONTROL_STATE_CMD;
wValue = (device->dtrValue);
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == CY_SUCCESS){
device->rtsValue = 0;
return CY_SUCCESS;
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error in clearing RTS of UART ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This Api sets the DTR UART pin High
*/
CY_RETURN_STATUS CyUartSetDtr (
CY_HANDLE handle
)
{
UINT16 wValue = 0, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_SET_LINE_CONTROL_STATE_CMD;
wValue = ((device->rtsValue) << 1) | 1;
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == CY_SUCCESS){
device->dtrValue = 1;
return CY_SUCCESS;
}
else {
CY_DEBUG_PRINT_ERROR ("CY:Error in setting DTR of UART ... Libusb Error is %d \n", rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}
/*
This Api clears the DTR UART pin and makes it low
*/
CY_RETURN_STATUS CyUartClearDtr (
CY_HANDLE handle
)
{
UINT16 wValue = 0, wIndex, wLength;
UINT8 bmRequestType, bmRequest;
int rStatus, ioTimeout = CY_USB_SERIAL_TIMEOUT ;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid handle..Function is %s\n", __func__);
return CY_ERROR_INVALID_HANDLE;
}
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType != CY_TYPE_UART){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device type needs to be uart..Function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
bmRequestType = CY_CLASS_INTERFACE_REQUEST_HOST_TO_DEVICE;
bmRequest = CY_SET_LINE_CONTROL_STATE_CMD;
wValue = ((device->rtsValue) << 1);
wIndex = device->interfaceNum;
wLength = 0;
rStatus = libusb_control_transfer (devHandle, bmRequestType, bmRequest,
wValue, wIndex, NULL, wLength, ioTimeout);
if (rStatus == CY_SUCCESS){
device->dtrValue = 0;
return CY_SUCCESS;
}
else{
CY_DEBUG_PRINT_ERROR ("CY:Error in function %s... Libusb Error is %d \n",__func__, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
}

638
release/cylib/lib/cyusb.c Normal file
View File

@@ -0,0 +1,638 @@
/*
* USB routines of Cypress USB Serial
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "CyUSBCommon.h"
libusb_context *glContext = NULL;
static bool glDriverInit = false;
static libusb_device **glDeviceList;
static int glNumDevices;
/*The API initializes the Libusb library
*/
pthread_mutex_t criticalSection;
CY_RETURN_STATUS CyLibraryInit ()
{
int rStatus = LIBUSB_SUCCESS;
if (!glContext)
rStatus = libusb_init (&glContext);
if (glDriverInit != true){
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Driver Init Failed ...\n");
return CY_ERROR_DRIVER_INIT_FAILED;
}
glNumDevices = libusb_get_device_list (glContext, &glDeviceList);
if (glNumDevices < 0){
CY_DEBUG_PRINT_ERROR ("CY:Building device list Failed ...\n");
glNumDevices = -1;
return CY_ERROR_DRIVER_INIT_FAILED;
}
pthread_mutex_init (&criticalSection, NULL);
glDriverInit = true;
return CY_SUCCESS;
}
else{
CY_DEBUG_PRINT_ERROR ("CY:Error ... library already initialized \n");
return CY_ERROR_DRIVER_INIT_FAILED;
}
}
/*
This API needs to be called after Calling CyGetListofDevices.
*/
CY_RETURN_STATUS CyLibraryExit ()
{
if (glDriverInit == true){
if (glNumDevices >= 0)
libusb_free_device_list (glDeviceList, 1);
if (glContext) {
libusb_exit (glContext);
glContext = NULL;
}
glDriverInit = false;
pthread_mutex_destroy (&criticalSection);
return CY_SUCCESS;
}
CY_DEBUG_PRINT_ERROR ("CY:Error ... Library not initialized \n");
return CY_ERROR_REQUEST_FAILED;
}
/*
* This function Gets the number of all the devices currently
* Connected to the host (It includes Cypress Device as well as
* no Cypress Devices connected)
*/
CY_RETURN_STATUS CyGetListofDevices (
UINT8 *numDevices
)
{
// Use this variable to call libusb_close and exit of the application
if (numDevices == NULL)
return CY_ERROR_INVALID_PARAMETER;
if (!glDriverInit){
CY_DEBUG_PRINT_ERROR ("CY:Error Library not initialised ...function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
pthread_mutex_lock (&criticalSection);
libusb_free_device_list (glDeviceList, 1);
glNumDevices = (*numDevices) = libusb_get_device_list (glContext, &glDeviceList);
pthread_mutex_unlock (&criticalSection);
if (glNumDevices < 0){
CY_DEBUG_PRINT_ERROR ("CY:Building device list Failed ...function is %s\n", __func__);
glNumDevices = -1;
(*numDevices) = -1;
return CY_ERROR_REQUEST_FAILED;
}
return CY_SUCCESS;
}
/* This function gets all the neccessary info such as VID,PID,
String Descriptors and if is a cypress serial device you will
get the info on class and device type
*/
CY_RETURN_STATUS CyGetDeviceInfo (
UINT8 deviceNumber,
CY_DEVICE_INFO *deviceInfo
)
{
struct libusb_device_descriptor deviceDesc;
int rStatus;
UINT32 numInterfaces;
UINT8 iManufacturer, iProduct, iSerial;
libusb_device *usbDevice;;
struct libusb_config_descriptor *configDesc;
libusb_device_handle *devHandle;
// Get the list of descriptor info for the device
if (glDriverInit == false){
CY_DEBUG_PRINT_ERROR ("CY:Error Library not initialised ...function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (deviceInfo == NULL)
return CY_ERROR_INVALID_PARAMETER;
pthread_mutex_lock (&criticalSection);
if (deviceNumber >= glNumDevices){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device number... \n");
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_INVALID_PARAMETER;
}
usbDevice = glDeviceList[deviceNumber];
rStatus = libusb_get_device_descriptor (usbDevice, &deviceDesc);
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error ... unable to retrieve device descriptor \n");
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DEVICE_INFO_FETCH_FAILED;
}
deviceInfo->vidPid.vid = deviceDesc.idVendor;
deviceInfo->vidPid.pid = deviceDesc.idProduct;
// Get the all the index of the String descriptors so that it can be used
// to retrieve the string descriptor info.
iManufacturer = deviceDesc.iManufacturer;
iProduct = deviceDesc.iProduct;
iSerial = deviceDesc.iSerialNumber;
//Get the Device handle so that we can communicate with the device retreiving
// descriptor info
deviceInfo->manufacturerName[0] = '\0';
deviceInfo->productName[0] = '\0';
deviceInfo->serialNum[0] = '\0';
rStatus = libusb_open (usbDevice, &devHandle);
if (rStatus == LIBUSB_ERROR_ACCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error ...Insufficient permission... Libusb error is %d \n", rStatus);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_ACCESS_DENIED;
}
else if (rStatus != CY_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in opening the device... Libusb error is %d \n", rStatus);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DEVICE_INFO_FETCH_FAILED;
}
if (iManufacturer > 0){
rStatus = libusb_get_string_descriptor_ascii (devHandle, iManufacturer, deviceInfo->manufacturerName, 256);
if (rStatus <= LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in Getting Manufacturer name Error is <%x> \n", rStatus);
}
}
if (iProduct > 0){
rStatus = libusb_get_string_descriptor_ascii (devHandle, iProduct, deviceInfo->productName, 256);
if (rStatus <= LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in Getting product name Error is <%d> \n", rStatus);
}
}
if (iSerial > 0){
rStatus = libusb_get_string_descriptor_ascii (devHandle, iSerial, deviceInfo->serialNum, 256);
if (rStatus <= LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in Getting Serial name <%d>\n", rStatus);
}
}
rStatus = libusb_get_config_descriptor (usbDevice, 0, &configDesc);
if (rStatus == LIBUSB_SUCCESS){
UINT32 index_i = 0;
const struct libusb_interface *interface;
numInterfaces = configDesc->bNumInterfaces;
deviceInfo->numInterfaces = numInterfaces;
interface = configDesc->interface;
while ((numInterfaces) && (index_i < CY_MAX_DEVICE_INTERFACE)){
deviceInfo->deviceClass[index_i] = (CY_DEVICE_CLASS)interface->altsetting->bInterfaceClass;
if (deviceInfo->deviceClass[index_i] == CY_CLASS_VENDOR){
deviceInfo->deviceType[index_i] = (CY_DEVICE_TYPE)interface->altsetting->bInterfaceSubClass;
}
else
deviceInfo->deviceType[index_i] = CY_TYPE_DISABLED;
index_i++;
numInterfaces--;
interface++;
}
libusb_free_config_descriptor(configDesc);
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in Getting config descriptor ...Libusb error is %d \n", rStatus);
if (devHandle)
libusb_close (devHandle);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DEVICE_INFO_FETCH_FAILED;
}
if (devHandle)
libusb_close (devHandle);
pthread_mutex_unlock (&criticalSection);
return CY_SUCCESS;
}
/* This function gets all the neccessary info such as VID,PID,
String Descriptors and if is a cypress serial device you will
get the info on class and device type
*/
CY_RETURN_STATUS CyGetDeviceInfoVidPid (
CY_VID_PID vidPid,
UINT8 *deviceNumber,
PCY_DEVICE_INFO deviceInfoList,
UINT8 *deviceCount,
UINT8 infoListLength
)
{
struct libusb_device_descriptor deviceDesc;
int rStatus = CY_ERROR_DRIVER_INIT_FAILED;
UINT32 numInterfaces, index = 0;
int devNum;
UINT8 iManufacturer, iProduct, iSerial;
libusb_device *usbDevice;
struct libusb_config_descriptor *configDesc;
libusb_device_handle *devHandle = NULL;
PCY_DEVICE_INFO deviceInfo;
if (glDriverInit == false){
CY_DEBUG_PRINT_ERROR ("CY:Error Library not initialised ...function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if ((infoListLength) < 1){
CY_DEBUG_PRINT_ERROR ("CY:Error invalid device info list length specified should be > 0 .. function is %s\n", __func__);
return CY_ERROR_INVALID_PARAMETER;
}
if (deviceNumber == NULL || deviceInfoList == NULL || deviceCount == NULL)
return CY_ERROR_INVALID_PARAMETER;
// Get the list of descriptor info for the device
(*deviceCount) = 0;
pthread_mutex_lock (&criticalSection);
for (devNum = 0; devNum < glNumDevices; devNum++) {
//We are making sure that we do not overrun
//the list.
deviceInfo = &(deviceInfoList [index]);
usbDevice = glDeviceList[devNum];
rStatus = libusb_get_device_descriptor (usbDevice, &deviceDesc);
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in getting device descriptor for device-%d... Libusb Error is %d \n", devNum, rStatus);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DEVICE_INFO_FETCH_FAILED;
}
if ((deviceDesc.idVendor != vidPid.vid) || (deviceDesc.idProduct != vidPid.pid)){
continue;
}
(*deviceCount)++;
if (index > infoListLength){
continue;
}
rStatus = libusb_open (usbDevice, &devHandle);
if (rStatus == LIBUSB_ERROR_ACCESS){
CY_DEBUG_PRINT_ERROR ("CY:Insufficient permission ... Libusb error is %d \n", rStatus);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_ACCESS_DENIED;
}
else if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in Opening the Device ...Error is %d \n", rStatus);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DEVICE_INFO_FETCH_FAILED;
}
deviceNumber[index] = devNum;
index++;
deviceInfo->vidPid.vid = deviceDesc.idVendor;
deviceInfo->vidPid.pid = deviceDesc.idProduct;
// Get all the index of the String descriptors so that it can be used
// to retrieve the string descriptor info.
iManufacturer = deviceDesc.iManufacturer;
iProduct = deviceDesc.iProduct;
iSerial = deviceDesc.iSerialNumber;
//Get the Device handle so that we can communicate with the device retreiving
// descriptor info
//Initialise manufacturer, product and serial names
deviceInfo->manufacturerName[0] = '\0';
deviceInfo->productName[0] = '\0';
deviceInfo->serialNum[0] = '\0';
if (iManufacturer > 0) {
rStatus = libusb_get_string_descriptor_ascii (devHandle, iManufacturer, deviceInfo->manufacturerName, 256);
if (rStatus <= LIBUSB_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY:Error in Getting Manufacturer name Error is <%d> \n",rStatus);
}
}
if (iProduct > 0){
rStatus = libusb_get_string_descriptor_ascii (devHandle, iProduct, deviceInfo->productName, 256);
if (rStatus <= LIBUSB_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY:Error in Getting product name Error is <%d> \n", rStatus);
}
}
if (iSerial > 0){
rStatus = libusb_get_string_descriptor_ascii (devHandle, iSerial, deviceInfo->serialNum, 256);
if (rStatus <= LIBUSB_SUCCESS){
CY_DEBUG_PRINT_INFO ("CY:Error in Getting Serial name <%d>\n", rStatus);
}
}
CY_DEBUG_PRINT_INFO ("Manufacturer name <%s> \nProduct Name <%s> \nserial number <%s> \n",
deviceInfo->manufacturerName,deviceInfo->productName,deviceInfo->serialNum);
rStatus = libusb_get_config_descriptor (usbDevice, 0, &configDesc);
if (rStatus == LIBUSB_SUCCESS){
int index_i = 0;
const struct libusb_interface *interfaceDesc;
numInterfaces = configDesc->bNumInterfaces;
deviceInfo->numInterfaces = numInterfaces;
interfaceDesc = configDesc->interface;
while ((numInterfaces) && (index_i < CY_MAX_DEVICE_INTERFACE)){
deviceInfo->deviceClass[index_i] = (CY_DEVICE_CLASS)interfaceDesc->altsetting->bInterfaceClass;
if (deviceInfo->deviceClass[index_i] == CY_CLASS_VENDOR)
deviceInfo->deviceType[index_i] = (CY_DEVICE_TYPE)interfaceDesc->altsetting->bInterfaceSubClass;
else
deviceInfo->deviceType[index_i] = CY_TYPE_DISABLED;
index_i++;
numInterfaces--;
interfaceDesc++;
}
}
else {
CY_DEBUG_PRINT_ERROR ("CY: Error in Getting config descriptor ... Libusb Error is %d\n", rStatus);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DEVICE_INFO_FETCH_FAILED;
}
libusb_free_config_descriptor (configDesc);
libusb_close (devHandle);
}
if ((*deviceCount) == 0)
rStatus = CY_ERROR_DEVICE_NOT_FOUND;
pthread_mutex_unlock (&criticalSection);
return rStatus;
}
/*
This API will claim the interface in the device
To make sure only claimed application speaks to device.
*/
CY_RETURN_STATUS CySelectInterface (
CY_HANDLE handle,
UINT8 interfaceNum
)
{
UINT32 rStatus, numEP;
CY_DEVICE *device;
libusb_device_handle *devHandle;
libusb_device *usbDev;
struct libusb_config_descriptor *configDesc;
const struct libusb_interface *interfaceDesc;
const struct libusb_endpoint_descriptor *epDesc;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
usbDev = libusb_get_device (devHandle);
if (usbDev == NULL){
CY_DEBUG_PRINT_ERROR ("CY:Error Invalide handle ..function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
//Get the config descriptor and parse it to get the
//interface and endpoint descriptor
rStatus = libusb_get_config_descriptor (usbDev, 0, &configDesc);
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in Getting Config Desc ...function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
interfaceDesc = configDesc->interface;
//Interface Number should be a valid one and should not exceed
// total number of interfaces
if (interfaceNum >= configDesc->bNumInterfaces){
CY_DEBUG_PRINT_ERROR ("CY:Interface Number not valid... \n");
libusb_free_config_descriptor (configDesc);
return CY_ERROR_REQUEST_FAILED;
}
if (libusb_kernel_driver_active (devHandle, interfaceNum)){
CY_DEBUG_PRINT_ERROR ("CY:Kernel driver active on the interface number %d \n", interfaceNum);;
//User can uncomment this section if needed.
#ifdef CY_DETACH_KERNEL_DRIVER
if (!libusb_detach_kernel_driver (devHandle, interfaceNum)){
CY_DEBUG_PRINT_ERROR ("CY:Kernel driver detach failed %d\n", interfaceNum);
return CY_ERROR_REQUEST_FAILED;
}
#else
return CY_ERROR_REQUEST_FAILED;
#endif
}
rStatus = libusb_claim_interface (devHandle, interfaceNum);
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in claiming interface -interface num %d... Libusb error is %d \n", interfaceNum, rStatus);
return CY_ERROR_REQUEST_FAILED;
}
device->interfaceNum = interfaceNum;
while (interfaceNum--)
interfaceDesc++;
epDesc = interfaceDesc->altsetting->endpoint;
numEP = interfaceDesc->altsetting->bNumEndpoints;
device->numEndpoints = numEP;
// Check the total number of endpoints interface has
// and get all the endpoint add
CY_DEBUG_PRINT_INFO ("CY:Info The total number of endpoints are %d \n", numEP);
while (numEP){
if (epDesc->bmAttributes == 0x2){ //Bulk EP checking
if (epDesc->bEndpointAddress & 0x80)
device->inEndpoint = epDesc->bEndpointAddress;
else
device->outEndpoint = epDesc->bEndpointAddress;
}
else if (epDesc->bmAttributes == 0x3) //Interrupt EP checking (We have only one interrupt EP)
device->interruptEndpoint = epDesc->bEndpointAddress;
epDesc++;
numEP--;
}
CY_DEBUG_PRINT_INFO ("CY:Info The Endpoints are in %d and out %d and interrup %d\n",
device->inEndpoint, device->outEndpoint, device->interruptEndpoint);
libusb_free_config_descriptor (configDesc);
return CY_SUCCESS;
}
/*
* This API selects the type of the device
*/
void CySelectDeviceType (CY_DEVICE *device, libusb_device *libUsbdev, unsigned char interfaceNum)
{
int rStatus, numInterfaces;
struct libusb_config_descriptor *configDesc;
int index = 0;
const struct libusb_interface *interfaceDesc;
device->deviceType = CY_TYPE_DISABLED;
rStatus = libusb_get_config_descriptor (libUsbdev, 0, &configDesc);
if (0 == rStatus){
interfaceDesc = configDesc->interface;
numInterfaces = configDesc->bNumInterfaces;
if (interfaceNum >= numInterfaces)
return;
while (index != interfaceNum) {
index++;
interfaceDesc++;
}
if (interfaceDesc->altsetting->bInterfaceClass == CY_CLASS_VENDOR)
device->deviceType = (CY_DEVICE_TYPE)interfaceDesc->altsetting->bInterfaceSubClass;
libusb_free_config_descriptor (configDesc);
}
CY_DEBUG_PRINT_INFO ("CY:Info The device type is %d \n", device->deviceType);
}
/*
The Api Gets the handle for the specified device number
(refer to usage guide and example for usage)
and this handle should be called for further communication
with the device
*/
CY_RETURN_STATUS CyOpen (
unsigned char deviceNumber,
unsigned char interfaceNum,
CY_HANDLE *handle
)
{
libusb_device_handle *devHandle;
libusb_device *dev;
CY_DEVICE *device;
int rStatus;
if (glDriverInit == false){
CY_DEBUG_PRINT_ERROR ("CY:Error Library not initialised ...function is %s\n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
pthread_mutex_lock (&criticalSection);
if (glDriverInit == true){
if (deviceNumber >= glNumDevices){
CY_DEBUG_PRINT_ERROR ("CY:Error ... Invalid device number ... \n");
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_INVALID_PARAMETER;
}
dev = glDeviceList [deviceNumber];
rStatus = libusb_open (dev, &devHandle);
if (rStatus == LIBUSB_ERROR_ACCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in opening the device ..Access denied \n");
handle = NULL;
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_ACCESS_DENIED;
}
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in Opening the Device ...Error is %d \n", rStatus);
handle = NULL;
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DRIVER_OPEN_FAILED;
}
device = (CY_DEVICE *)malloc(sizeof (CY_DEVICE));
if (device == NULL){
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_ALLOCATION_FAILED;
}
device->devHandle = devHandle;
(*handle) = device;
rStatus = CySelectInterface (device, interfaceNum);
if (rStatus != CY_SUCCESS){
libusb_close (devHandle);
free (device);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DRIVER_OPEN_FAILED;
}
CySelectDeviceType (device, dev, interfaceNum);
if (device->deviceType == CY_TYPE_UART) {
CyUartSetRts (*handle);
CyUartSetDtr (*handle);
if (!CyUartSetHwFlowControl (*handle, CY_UART_FLOW_CONTROL_DISABLE))
device->uartFlowControlMode = CY_UART_FLOW_CONTROL_DISABLE;
}
//initialising structure elements
device->spiThreadRunning = false;
device->uartThreadRunning = false;
device->spiCancelEvent = false;
device->uartCancelEvent = false;
device->spiTransfer = NULL;
device->uartTransfer = NULL;
if (pthread_mutex_init (&device->readLock, NULL)){
CY_DEBUG_PRINT_ERROR ("CY:Error initializing the read mutex .. Function is %s \n", __func__);
libusb_close (devHandle);
free (device);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DRIVER_OPEN_FAILED;
}
if (pthread_mutex_init (&device->writeLock, NULL)){
CY_DEBUG_PRINT_ERROR ("CY:Error initializing the write mutex .. Function is %s \n", __func__);
libusb_close (devHandle);
free (device);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DRIVER_OPEN_FAILED;
}
if (pthread_mutex_init (&device->notificationLock, NULL)){
CY_DEBUG_PRINT_ERROR ("CY:Error initializing the write mutex .. Function is %s \n", __func__);
libusb_close (devHandle);
free (device);
pthread_mutex_unlock (&criticalSection);
return CY_ERROR_DRIVER_OPEN_FAILED;
}
pthread_mutex_unlock (&criticalSection);
return CY_SUCCESS;
}
else{
CY_DEBUG_PRINT_ERROR ("CY:Error iniitalise library by calling CyLibraryInit()....function is %s\n", __func__);
return CY_ERROR_DRIVER_OPEN_FAILED;
}
}
/*
The Api Closes the handle and needs to be called only if CyGetNumDevices
or CyOpen is called
*/
CY_RETURN_STATUS CyClose (
CY_HANDLE handle
)
{
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
if (device->deviceType == CY_TYPE_UART) {
CyUartClearRts (handle);
CyUartClearDtr (handle);
CyUartSetHwFlowControl (handle, CY_UART_FLOW_CONTROL_DISABLE);
}
if (glDriverInit == true){
if (device->deviceType == CY_TYPE_SPI || device->deviceType == CY_TYPE_UART){
if (device->spiThreadRunning || device->uartThreadRunning){
CyAbortEventNotification(handle);
}
}
if (pthread_mutex_destroy (&device->readLock)){
CY_DEBUG_PRINT_ERROR ("CY:Error de initializing the read mutex .. Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (pthread_mutex_destroy (&device->writeLock)){
CY_DEBUG_PRINT_ERROR ("CY:Error de initializing the write mutex .. Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
if (pthread_mutex_destroy (&device->notificationLock)){
CY_DEBUG_PRINT_ERROR ("CY:Error de initializing the write mutex .. Function is %s \n", __func__);
return CY_ERROR_REQUEST_FAILED;
}
libusb_close ((libusb_device_handle*)devHandle);
free (device);
}
return CY_SUCCESS;
}
/*
This Api will reset the pipe and clears the endpoint
*/
CY_RETURN_STATUS CyResetPipe (
CY_HANDLE handle,
UINT8 endPointAddress
)
{
UINT32 rStatus;
CY_DEVICE *device;
libusb_device_handle *devHandle;
if (handle == NULL)
return CY_ERROR_INVALID_HANDLE;
device = (CY_DEVICE *)handle;
devHandle = device->devHandle;
rStatus = libusb_clear_halt ((libusb_device_handle *)devHandle, endPointAddress);
if (rStatus != LIBUSB_SUCCESS){
CY_DEBUG_PRINT_ERROR ("CY:Error in resetting the pipe ... \n");
return CY_ERROR_REQUEST_FAILED;
}
return CY_SUCCESS;
}
/*
This Api will get the library version,patch
and build number
*/
CY_RETURN_STATUS CyGetLibraryVersion (
CY_HANDLE handle,
PCY_LIBRARY_VERSION version
)
{
version->majorVersion = CY_US_VERSION_MAJOR;
version->minorVersion = CY_US_VERSION_MINOR;
version->patch = CY_US_VERSION_PATCH;
version->buildNumber = CY_US_VERSION_BUILD;
return CY_SUCCESS;
}

View File

@@ -0,0 +1,32 @@
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# CMake build directory
build

View File

@@ -0,0 +1,72 @@
sudo: false
language: c
matrix:
include:
- compiler: gcc
env: ARCH=x86_64
addons:
apt:
packages:
- libusb-1.0-0-dev
coverity_scan:
project:
name: "cyrozap/libcyusbserial"
notification_email: cyrozap@users.noreply.github.com
build_command_prepend: "cmake ../"
build_command: make
branch_pattern: coverity_scan
- compiler: gcc
env: ARCH=i386 CFLAGS="-m32"
addons:
apt:
packages:
- gcc-multilib
- libusb-1.0-0-dev:i386
- pkg-config:i386
- compiler: clang
env: ARCH=x86_64
addons:
apt:
packages:
- libusb-1.0-0-dev
- compiler: clang
env: ARCH=i386 CFLAGS="-m32"
addons:
apt:
packages:
- gcc-multilib
- libusb-1.0-0-dev:i386
- pkg-config:i386
before_script:
- mkdir build && cd build
script:
- cmake ../ && make
before_deploy:
- export RELEASE_NAME=libcyusbserial-$TRAVIS_TAG-$TRAVIS_OS_NAME-$ARCH
- cd -
- mkdir -p $RELEASE_NAME/{include,lib,tools}
- cp ./COPYING.LESSER.txt ./README.md $RELEASE_NAME/
- cp ./include/*.h $RELEASE_NAME/include/
- cp ./build/lib/*.so{,.*} $RELEASE_NAME/lib/
- cp ./build/tools/cyusbserialtest ./tools/README.txt $RELEASE_NAME/tools/
- tar -czf $RELEASE_NAME.tar.gz $RELEASE_NAME
deploy:
provider: releases
api_key:
secure: eYzcv257okDxTohG7njLqRMIjad9ytsxsE0ORqvYBaQRYlOUuG8LXlj7JCmABMXvdWXVmaNbJ4k5o0qN8hiINwIarf14TzkXzfaXnZ6oTkQh4+6QWJudbNo1vGUIHV9ax4gUw4cV/UTKnviceNq82LnCHKa4i9Ts4HrQeKjXdEw=
file: $RELEASE_NAME.tar.gz
on:
repo: cyrozap/libcyusbserial
tags: true
all_branches: true
condition: "$CC = gcc"
env:
global:
- secure: "kS2HsEf1Jwv2mT+QtX+vTNmXiGiR1Bq1iFw7ZTW6o9y/I0xYfQeeZKZSpGLO/WCFyQu4qZvCszTV8A+6JcKx7c0YWvzFoSPCmLxz326N/K+Ml0aTqeUdnWqiShByIdYbnvLfwNhB8GUJQc95dga8KmuWGjT2fl4onMkdONjwHyc="

View File

@@ -0,0 +1,23 @@
add_executable(cyusbserialtest cyusbserialtest.c)
################################################################################
# Version information
################################################################################
set(VERSION_INFO_MAJOR 0)
set(VERSION_INFO_MINOR 0)
set(VERSION_INFO_PATCH 1)
################################################################################
# Link libraries
################################################################################
target_link_libraries(cyusbserialtest LINK_PUBLIC cyusbserial)
################################################################################
# Installation
################################################################################
if(NOT DEFINED BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR bin)
endif()
install(TARGETS cyusbserialtest DESTINATION ${BIN_INSTALL_DIR})

View File

@@ -0,0 +1,99 @@
================================================================================
Cypress Semiconductor Corporation
CyUSB Serial DVK test utility for I2C/SPI
================================================================================
This utility is used for testing I2C/SPI master mode functionality on the
Cypress CyUSBSerial DVK.
The utility writes to I2C/SPI flash devices on the DVK, reads the data back
and verifies the data read for integrity.
Using the test utility:
================================================================================
1. On starting the utility, the Cypress USB Serial devices that are connected
are listed along with their device numbers, interface numbers and
functionalities (SPI or I2C).
$ CyUSBSerial
----------------------------------------------------------------------
Device Number | VID | PID | INTERFACE NUMBER | FUNCTIONALITY
----------------------------------------------------------------------
0 |4b4 |a | 0 | VENDOR_I2C
0 |4b4 |a | 1 | VENDOR_SPI
0 |4b4 |a | 2 | NA
----------------------------------------------------------------------
2. A menu providing the various operations is also printed:
----------------------------------------------------------------------
1: Print list of devices
2: Select device...No device selected !!
3: Enter I2C/SPI Flash page address and length to write/read.
4: Verify data
5: Exit
----------------------------------------------------------------------
3. On selecting option 2, the utility prompts for the device and interface
number to be selected for testing.
-----------------------------------
Enter Device number to select:
0
Enter interface number:
1
-----------------------------------
Once the selections are made, the menu will be updated with the details.
----------------------------------------------------------------------
1: Print list of devices
2: Change device selection--selected device: [Device number 0] : [Interface No 1] : SPI
3: Enter I2C/SPI Flash page address and length to write/read.
4: Verify data
5: Exit
----------------------------------------------------------------------
4. Option 3 can be selected now to do data read/write to the I2C/SPI flash
device. The utility prompts for the page address to be written as well as
the length of data to be written.
------------------------------------------------
Enter Page address ... (less than 65536)
1234
Enter length to read/write ... (less than 256)
32
------------------------------------------------
Length needs to be less than or equal to 256 bytes in the case of SPI access,
and less than or equal to 64 bytes in the case of I2C access. Page address
needs to be less than 65536 in case of SPI and 256 in case of I2C.
Once the values are selected, the menu is updated with the details as below:
-------------------------------------------------------------------
1: Print list of devices
2: Change device selection--selected device: [Device number 0] : [Interface No 1] : SPI
3: Change Flash page address and length ...Entered is page address 1234 and length 123
4: Verify data
5: Exit
-------------------------------------------------------------------
5. Selecting option 4 causes the utility to write a randomly generated data
sequence to the flash device, read it back, and verify the data read back.
The data pattern written and read back will be displayed as shown below:
--------------------------------------------------------------------
67 c6 69 73 51 ff 4a ec 29 cd ba ab f2 fb e3 46 7c c2 54 f8 1b e8 e7 8d 76 5a 2e 63 33 9f c9 9a
--------------------------------------------------------------------
Data Read back is:
---------------------------------------------------------------------
67 c6 69 73 51 ff 4a ec 29 cd ba ab f2 fb e3 46 7c c2 54 f8 1b e8 e7 8d 76 5a 2e 63 33 9f c9 9a
---------------------------------------------------------------------
Data verified successfully
-------------------------------------------------------------------
6. The utility runs through these menu options until the user selects the
exit option (5).
================================================================================
EOF

View File

@@ -0,0 +1,603 @@
/*
* Test utility
* Copyright (C) 2013 Cypress Semiconductor
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>
#include <signal.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/time.h>
#include <pthread.h>
#include <ctype.h>
#include "CyUSBSerial.h"
#define CY_MAX_DEVICES 30
#define CY_MAX_INTERFACES 4
typedef struct _CY_DEVICE_STRUCT {
int deviceNumber;
int interfaceFunctionality[CY_MAX_INTERFACES];
bool isI2c;
bool isSpi;
int numInterface;
}CY_DEVICE_STRUCT;
CY_DEVICE_STRUCT *glDevice;
int i2cDeviceIndex[CY_MAX_DEVICES][CY_MAX_INTERFACES];
unsigned char *deviceNumber = NULL;
int cyDevices, i2cDevices = 0;
UINT8 numDevices = 0;
int selectedDeviceNum = -1, selectedInterfaceNum = -1;
bool exitApp = false;
short pageAddress = -1;
short readWriteLength = -1;
bool deviceAddedRemoved = false;
int i2cVerifyData (int deviceNumber, int interfaceNum);
void printListOfDevices (bool isPrint);
int spiVerifyData (int deviceNumber, int interfaceNum);
int getUserInput()
{
char userInput[6], x;
int output,i = 0;
bool isDigit = true;
x = getchar();
while (x != '\n'){
if (i < 5){
userInput[i] = x;
i++;
}
if (!isdigit(x))
isDigit = false;
x = getchar();
}
userInput[i] = '\0';
if (isDigit == false)
return -1;
output = atoi(userInput);
return output;
}
void deviceHotPlug () {
CY_RETURN_STATUS rStatus;
deviceAddedRemoved = true;
selectedDeviceNum = -1;
selectedInterfaceNum = -1;
printf ("Device of interest Removed/Added \n");
rStatus = CyGetListofDevices (&numDevices);
if (rStatus != CY_SUCCESS) {
printf ("CY:Error in Getting List of Devices: Error NO:<%d> \n", rStatus);
}
printListOfDevices (false);
}
int main (int argc, char **agrv)
{
int userInput;
int tempSelectedDeviceNum, tempSelectedInterfaceNum, tempPageAddress, tempLength;
CY_RETURN_STATUS rStatus;
signal (SIGUSR1, deviceHotPlug);
glDevice = (CY_DEVICE_STRUCT *)malloc (CY_MAX_DEVICES *sizeof (CY_DEVICE_STRUCT));
if (glDevice == NULL){
printf ("Memory allocation failed ...!! \n");
return -1;
}
rStatus = CyLibraryInit ();
if (rStatus != CY_SUCCESS) {
printf ("CY:Error in Doing library init Error NO:<%d> \n", rStatus);
return rStatus;
}
rStatus = CyGetListofDevices (&numDevices);
if (rStatus != CY_SUCCESS) {
printf ("CY:Error in Getting List of Devices: Error NO:<%d> \n", rStatus);
return rStatus;
}
printListOfDevices(true);
do {
printf ("-------------------------------------------------------------------\n");
printf ("1: Print list of devices \n");
if (selectedDeviceNum != -1 && selectedInterfaceNum != -1){
printf ("2: Change device selection--selected device: [Device number %d] : [Interface No %d]",\
selectedDeviceNum, selectedInterfaceNum);
if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == CY_TYPE_I2C)
printf (" : I2C\n");
else if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == CY_TYPE_SPI)
printf (" : SPI\n");
else
printf (" : NA\n");
}
else
printf ("2: Select device...No device selected !!\n");
if (readWriteLength != -1 && pageAddress != -1){
printf ("3: Change Flash page address and length ...Entered is page address %d and length %d\n", pageAddress, readWriteLength);
printf ("4: Verify data\n5: Exit\n");
}
else
printf ("3: Enter I2C/SPI Flash page address and length to write/read.\n4: Verify data\n5: Exit\n");
printf ("-------------------------------------------------------------------\n");
userInput = getUserInput();
if (userInput < 1 || userInput > 5){
printf ("Wrong selection code ... Enter again \n");
continue;
}
switch (userInput){
case 1:
printListOfDevices(true);
break;
case 2:
if (cyDevices == 0) {
printf ("No device of interest connected ...!!\n");
continue;
}
printf ("Enter Device number to be selected.. \n");
tempSelectedDeviceNum = getUserInput();
//printf ("Selected device number is %d \n",tempSelectedDeviceNum);
if (tempSelectedDeviceNum >= cyDevices || tempSelectedDeviceNum == -1){
printf ("Wrong device selection \n");
continue;
}
printf ("Enter interface number..\n");
tempSelectedInterfaceNum = getUserInput();
//printf ("Selected device number is %d %d\n",tempSelectedInterfaceNum, glDevice[tempSelectedDeviceNum].numInterface);
if (tempSelectedInterfaceNum >= glDevice[tempSelectedDeviceNum].numInterface ||
tempSelectedInterfaceNum == -1) {
printf ("Wrong interface Selection selection \n");
continue;
}
if (glDevice[tempSelectedDeviceNum].interfaceFunctionality[tempSelectedInterfaceNum] == -1){
printf ("Selected device does not have I2C or SPI !!! \n");
continue;
}
if (deviceAddedRemoved == true) {
printf ("Device of interest was added/removed .... Print and select from new list\n");
continue;
}
selectedDeviceNum = tempSelectedDeviceNum;
selectedInterfaceNum = tempSelectedInterfaceNum;
//pageAddress = -1;
//readWriteLength = -1;
break;
case 3:
if (selectedDeviceNum == -1) {
printf ("Select proper device!!! \n");
continue;
}
if (selectedDeviceNum >= cyDevices){
printf ("Select proper device!!! \n");
continue;
}
if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == CY_TYPE_I2C){
printf ("Enter Page address... (less than 256)\n");
tempPageAddress = getUserInput();
printf ("Enter length to read/write...(less than 64)\n");
tempLength = getUserInput();
if (deviceAddedRemoved == true) {
printf ("Device of interest was added/removed .... Print and select from new list\n");
continue;
}
if (tempPageAddress > 256){
printf ("Invalid page address ..Enter page address less than 256 (1 bytes len)\n");
continue;
}
if (tempLength < 0 || tempLength > 64){
printf ("Invalid Length ..Enter length less than 64 bytes\n");
continue;
}
pageAddress = tempPageAddress;
readWriteLength = tempLength;
break;
}
if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == CY_TYPE_SPI){
printf ("Enter Page address... (less than 65536)\n");
tempPageAddress = getUserInput();
printf ("Enter length to read/write...(less than 256)\n");
tempLength = getUserInput();
if (deviceAddedRemoved == true) {
printf ("Device of interest was added/removed .... Print and select from new list\n");
continue;
}
if (tempPageAddress > 65536){
printf ("Invalid page address ..Enter page address less than 65536 (1 bytes len)\n");
continue;
}
if (tempLength < 0 || tempLength > 256){
printf ("Invalid Length ..Enter length less than 256 bytes\n");
continue;
}
pageAddress = tempPageAddress;
readWriteLength = tempLength;
break;
}
case 4:
if (selectedDeviceNum == -1) {
printf ("Select proper device!!! \n");
continue;
}
if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == -1){
printf ("Selected device does not have I2C or SPI !!! \n");
continue;
}
if ((pageAddress == -1) || (readWriteLength == -1)){
printf ("Select proper page address and length !!! \n");
continue;
}
if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == CY_TYPE_I2C){
if (pageAddress > 256){
printf ("Invalid Page address for I2C .. need to be less than 256\n");
continue;
}
if (readWriteLength > 64){
printf ("Invalid read write length for I2C .. need to be less than 64\n");
continue;
}
printf ("Calling I2C \n");
i2cVerifyData(glDevice[selectedDeviceNum].deviceNumber, selectedInterfaceNum);
}
if (glDevice[selectedDeviceNum].interfaceFunctionality[selectedInterfaceNum] == CY_TYPE_SPI){
spiVerifyData(glDevice[selectedDeviceNum].deviceNumber, selectedInterfaceNum);
}
break;
case 5:
exitApp = true;
CyLibraryExit ();
break;
}
}while (exitApp == false);
free (glDevice);
return CY_SUCCESS;
}
int spiWriteEnable (CY_HANDLE handle)
{
unsigned char wr_data,rd_data;
CY_RETURN_STATUS status = CY_SUCCESS;
CY_DATA_BUFFER writeBuf;
CY_DATA_BUFFER readBuf;
writeBuf.buffer = &wr_data;
writeBuf.length = 1;
readBuf.buffer = &rd_data;
readBuf.length = 1;
wr_data = 0x06; /* Write enable */
status = CySpiReadWrite (handle, &readBuf, &writeBuf, 5000);
return status;
}
//Helper functions for doing data transfer to/from SPI flash
int spiWaitForIdle (CY_HANDLE handle)
{
char rd_data[2], wr_data[2];
CY_DATA_BUFFER writeBuf, readBuf;
writeBuf.length = 2;
writeBuf.buffer = (unsigned char *)wr_data;
int timeout = 0xFFFF;
CY_RETURN_STATUS status;
readBuf.length = 2;
readBuf.buffer = (unsigned char *)rd_data;
do
{
wr_data[0] = 0x05; /* Status */
status = CySpiReadWrite (handle, &readBuf, &writeBuf, 5000);
if (status != CY_SUCCESS)
{
break;
}
timeout--;
if (timeout == 0)
{
status = CY_ERROR_IO_TIMEOUT;
return status;
}
} while (rd_data[1] & 0x01);
return status;
}
int spiVerifyData (int deviceNumber, int interfaceNum)
{
CY_DATA_BUFFER dataBufferWrite,dataBufferRead;
CY_HANDLE handle;
bool isVerify = true;
unsigned char wbuffer[256 + 4], rbuffer[256 + 4];
int rStatus;
memset (rbuffer, 0x00, 256);
memset (wbuffer, 0x00, 256);
rStatus = CyOpen (deviceNumber, interfaceNum, &handle);
if (rStatus != CY_SUCCESS){
printf ("CY_SPI: Open failed \n");
return rStatus;
}
dataBufferWrite.buffer = wbuffer;
dataBufferRead.buffer = rbuffer;
rStatus = spiWaitForIdle (handle);
if (rStatus){
printf("Error in Waiting for EEPOM active state %d \n", rStatus);
CyClose (handle);
return CY_ERROR_REQUEST_FAILED;
}
printf ("Calling spi write enable \n");
rStatus = spiWriteEnable (handle);
if (rStatus){
printf("Error in setting Write Enable %d \n", rStatus);
CyClose (handle);
return CY_ERROR_REQUEST_FAILED;
}
//Write SPI write command
wbuffer[0] = 0x02;
//SPI flash address
wbuffer[1] = (pageAddress >> 8);
wbuffer[2] = (pageAddress) & 0x00FF;
wbuffer[3] = 0;
printf ("The Data written is ...\n");
printf ("\n--------------------------------------------------------------------\n");
for (rStatus = 4; rStatus < (readWriteLength + 4); rStatus++){
wbuffer[rStatus] = rand() % 256;
printf ("%x ",wbuffer[rStatus]);
}
printf ("\n--------------------------------------------------------------------\n");
dataBufferRead.length = (4 + readWriteLength);
dataBufferWrite.length = (4 + readWriteLength);
rStatus = CySpiReadWrite (handle , &dataBufferRead, &dataBufferWrite, 5000);
if (rStatus != CY_SUCCESS){
CyClose (handle);
printf ("Error in doing SPI data write data Write is %d data read is %d\n" , dataBufferWrite.transferCount,dataBufferRead.transferCount);
return CY_ERROR_REQUEST_FAILED;
}
spiWaitForIdle (handle);
//Write SPI read command
wbuffer[0] = 0x03;
dataBufferRead.length = (4 + readWriteLength);
dataBufferWrite.length = (4 + readWriteLength);
rStatus = CySpiReadWrite (handle, &dataBufferRead, &dataBufferWrite, 5000);
if (rStatus != CY_SUCCESS){
CyClose (handle);
printf ("The Error is %d \n", rStatus);
printf ("Error in doing SPI data write data Write is %d data read is %d\n" , dataBufferWrite.transferCount,dataBufferRead.transferCount);
return CY_ERROR_REQUEST_FAILED;
}
printf ("Data Read back is \n");
printf ("\n---------------------------------------------------------------------\n");
for (rStatus = 4; rStatus < (readWriteLength + 4); rStatus++){
printf ("%x ",rbuffer[rStatus]);
if (rbuffer[rStatus] != wbuffer[rStatus]){
isVerify = false;
}
}
printf ("\n---------------------------------------------------------------------\n");
if (isVerify)
printf ("Data verified successfully \n");
else
printf ("Data corruption occured!!\n");
CyClose (handle);
return CY_SUCCESS;
}
int i2cVerifyData (int deviceNumber, int interfaceNum)
{
CY_DATA_BUFFER dataBufferWrite, dataBufferRead;
CY_HANDLE handle;
int length = 0;
bool isVerify = true;
int loopCount = 100, i;
CY_RETURN_STATUS rStatus;
unsigned char address[2], wbuffer[66], rbuffer[66];
CY_I2C_DATA_CONFIG i2cDataConfig;
memset (wbuffer, 0, 66);
memset (rbuffer, 0, 66);
i2cDataConfig.isStopBit = true;
i2cDataConfig.slaveAddress = 0x51;
rStatus = CyOpen (deviceNumber, interfaceNum, &handle);
if (rStatus != CY_SUCCESS){
printf("CY_I2C: Open failed \n");
return rStatus;
}
loopCount = 100;
length = readWriteLength;
wbuffer[0]= pageAddress;
wbuffer[1] = 0;
dataBufferWrite.buffer = wbuffer;
i2cDataConfig.isStopBit = true;
dataBufferWrite.length = (length + 2);
printf ("\n Data that is written on to i2c ...\n");
printf ("\n-----------------------------------------------------------------\n");
for (i = 2; i < (length +2); i++){
wbuffer[i] = rand() % 256;
printf ("%x ", wbuffer[i]);
}
printf ("\n-----------------------------------------------------------------\n");
rStatus = CyI2cWrite (handle, &i2cDataConfig, &dataBufferWrite, 5000);
if (rStatus != CY_SUCCESS){
printf ("Error in doing i2c write \n");
CyClose (handle);
return -1;
}
//We encountered a error in I2C read repeat the procedure again
//Loop here untill Read vendor command passes
i2cDataConfig.isStopBit = false;
dataBufferWrite.length = 2;
do {
rStatus = CyI2cWrite (handle, &i2cDataConfig, &dataBufferWrite, 5000);
loopCount--;
}while (rStatus != CY_SUCCESS && loopCount != 0);
if (loopCount == 0 && rStatus != CY_SUCCESS){
printf ("Error in sending read command \n");
CyClose (handle);
return -1;
}
dataBufferRead.buffer = rbuffer;
rbuffer[0]= address[0];
rbuffer[1] = 0;
i2cDataConfig.isStopBit = true;
i2cDataConfig.isNakBit = true;
dataBufferRead.length = length;
dataBufferRead.buffer = rbuffer;
memset (rbuffer, 0, 64);
rStatus = CyI2cRead (handle, &i2cDataConfig, &dataBufferRead, 5000);
if (rStatus != CY_SUCCESS){
printf ("Error in doing i2c read ... Error is %d \n", rStatus);
CyClose (handle);
return -1;
}
printf ("\n Data that is read from i2c ...\n");
printf ("\n-----------------------------------------------------------------\n");
for (i = 0; i < length; i++){
printf ("%x ", rbuffer[i]);
if (rbuffer[i] != wbuffer[i + 2]){
isVerify = false;
}
}
printf ("\n-----------------------------------------------------------------\n");
if (!isVerify)
printf ("Data corruption occured ..!!!\n");
else
printf ("Data verified successfully \n");
CyClose (handle);
return CY_SUCCESS;
}
bool isCypressDevice (int deviceNum) {
CY_HANDLE handle;
unsigned char interfaceNum = 0;
unsigned char sig[6];
CY_RETURN_STATUS rStatus;
rStatus = CyOpen (deviceNum, interfaceNum, &handle);
if (rStatus == CY_SUCCESS){
rStatus = CyGetSignature (handle, sig);
if (rStatus == CY_SUCCESS){
CyClose (handle);
return true;
}
else {
CyClose (handle);
return false;
}
}
else
return false;
}
void printListOfDevices (bool isPrint)
{
int i, j, devNum;
int index = 0, numInterfaces, interfaceNum;
char functionality[64];
CY_DEVICE_INFO deviceInfo;
CY_RETURN_STATUS rStatus;
deviceAddedRemoved = false;
CyGetListofDevices (&numDevices);
//printf ("The number of devices is %d \n", numDevices);
for (i = 0; i < numDevices; i++){
for (j = 0; j< CY_MAX_INTERFACES; j++)
glDevice[i].interfaceFunctionality[j] = -1;
}
if (isPrint){
printf ("\n\n---------------------------------------------------------------------------------\n");
printf ("Device Number | VID | PID | INTERFACE NUMBER | FUNCTIONALITY \n");
printf ("---------------------------------------------------------------------------------\n");
}
cyDevices = 0;
for (devNum = 0; devNum < numDevices; devNum++){
rStatus = CyGetDeviceInfo (devNum, &deviceInfo);
interfaceNum = 0;
if (!rStatus)
{
if (!isCypressDevice (devNum)){
continue;
}
strcpy (functionality, "NA");
numInterfaces = deviceInfo.numInterfaces;
glDevice[index].numInterface = numInterfaces;
cyDevices++;
while (numInterfaces){
if (deviceInfo.deviceClass[interfaceNum] == CY_CLASS_VENDOR)
{
glDevice[index].deviceNumber = devNum;
switch (deviceInfo.deviceType[interfaceNum]){
case CY_TYPE_I2C:
glDevice[index].interfaceFunctionality[interfaceNum] = CY_TYPE_I2C;
strcpy (functionality, "VENDOR_I2C");
glDevice[index].isI2c = true;
break;
case CY_TYPE_SPI:
glDevice[index].interfaceFunctionality[interfaceNum] = CY_TYPE_SPI;
strcpy (functionality, "VENDOR_SPI");
glDevice[index].isSpi = true;
break;
default:
strcpy (functionality, "NA");
break;
}
}
else if (deviceInfo.deviceClass[interfaceNum] == CY_CLASS_CDC){
strcpy (functionality, "NA");
}
if (isPrint) {
printf ("%d |%x |%x | %d | %s\n", \
index, \
deviceInfo.vidPid.vid, \
deviceInfo.vidPid.pid, \
interfaceNum, \
functionality \
);
}
interfaceNum++;
numInterfaces--;
}
index++;
}
}
if (isPrint){
printf ("---------------------------------------------------------------------------------\n\n");
}
}

View File

@@ -0,0 +1,119 @@
/*
* gettimeofday.c
* Win32 gettimeofday() replacement
*
* src/port/gettimeofday.c
*
* Copyright (c) 2003 SRA, Inc.
* Copyright (c) 2003 SKC, Inc.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose, without fee, and without a
* written agreement is hereby granted, provided that the above
* copyright notice and this paragraph and the following two
* paragraphs appear in all copies.
*
* IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
* DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS
* IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#include <windows.h>
#include <sys/time.h>
/* FILETIME of Jan 1 1970 00:00:00, the PostgreSQL epoch */
static const unsigned __int64 epoch = 116444736000000000ULL;
/*
* FILETIME represents the number of 100-nanosecond intervals since
* January 1, 1601 (UTC).
*/
#define FILETIME_UNITS_PER_SEC 10000000L
#define FILETIME_UNITS_PER_USEC 10
/*
* Both GetSystemTimeAsFileTime and GetSystemTimePreciseAsFileTime share a
* signature, so we can just store a pointer to whichever we find. This
* is the pointer's type.
*/
typedef VOID(WINAPI * PgGetSystemTimeFn) (LPFILETIME);
/* One-time initializer function, must match that signature. */
static void WINAPI init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime);
/* Storage for the function we pick at runtime */
static PgGetSystemTimeFn pg_get_system_time = &init_gettimeofday;
/*
* One time initializer. Determine whether GetSystemTimePreciseAsFileTime
* is available and if so, plan to use it; if not, fall back to
* GetSystemTimeAsFileTime.
*/
static void WINAPI
init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime)
{
/*
* Because it's guaranteed that kernel32.dll will be linked into our
* address space already, we don't need to LoadLibrary it and worry about
* closing it afterwards, so we're not using Pg's dlopen/dlsym() wrapper.
*
* We'll just look up the address of GetSystemTimePreciseAsFileTime if
* present.
*
* While we could look up the Windows version and skip this on Windows
* versions below Windows 8 / Windows Server 2012 there isn't much point,
* and determining the windows version is its self somewhat Windows
* version and development SDK specific...
*/
pg_get_system_time = (PgGetSystemTimeFn) GetProcAddress(
GetModuleHandle(TEXT("kernel32.dll")),
"GetSystemTimePreciseAsFileTime");
if (pg_get_system_time == NULL)
{
/*
* The expected error from GetLastError() is ERROR_PROC_NOT_FOUND, if
* the function isn't present. No other error should occur.
*
* We can't report an error here because this might be running in
* frontend code; and even if we're in the backend, it's too early to
* elog(...) if we get some unexpected error. Also, it's not a
* serious problem, so just silently fall back to
* GetSystemTimeAsFileTime irrespective of why the failure occurred.
*/
pg_get_system_time = &GetSystemTimeAsFileTime;
}
(*pg_get_system_time) (lpSystemTimeAsFileTime);
}
/*
* timezone information is stored outside the kernel so tzp isn't used anymore.
*
* Note: this function is not for Win32 high precision timing purposes. See
* elapsed_time().
*/
int
gettimeofday(struct timeval * tp, struct timezone * tzp)
{
FILETIME file_time;
ULARGE_INTEGER ularge;
(*pg_get_system_time) (&file_time);
ularge.LowPart = file_time.dwLowDateTime;
ularge.HighPart = file_time.dwHighDateTime;
tp->tv_sec = (long) ((ularge.QuadPart - epoch) / FILETIME_UNITS_PER_SEC);
tp->tv_usec = (long) (((ularge.QuadPart - epoch) % FILETIME_UNITS_PER_SEC)
/ FILETIME_UNITS_PER_USEC);
return 0;
}

View File

@@ -0,0 +1,309 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// The following BSD license is included under:
// legal/licenses/LICENSE.BSD.msc_inttypes
//
// Copyright (c) 2006-2013 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the product nor the names of its contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_INTTYPES_H_ // [
#define _MSC_INTTYPES_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "stdint.h"
// 7.8 Format conversion of integer types
typedef struct {
intmax_t quot;
intmax_t rem;
} imaxdiv_t;
// 7.8.1 Macros for format specifiers
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
// The fprintf macros for signed integers are:
#define PRId8 "d"
#define PRIi8 "i"
#define PRIdLEAST8 "d"
#define PRIiLEAST8 "i"
#define PRIdFAST8 "d"
#define PRIiFAST8 "i"
#define PRId16 "hd"
#define PRIi16 "hi"
#define PRIdLEAST16 "hd"
#define PRIiLEAST16 "hi"
#define PRIdFAST16 "hd"
#define PRIiFAST16 "hi"
#define PRId32 "I32d"
#define PRIi32 "I32i"
#define PRIdLEAST32 "I32d"
#define PRIiLEAST32 "I32i"
#define PRIdFAST32 "I32d"
#define PRIiFAST32 "I32i"
#define PRId64 "I64d"
#define PRIi64 "I64i"
#define PRIdLEAST64 "I64d"
#define PRIiLEAST64 "I64i"
#define PRIdFAST64 "I64d"
#define PRIiFAST64 "I64i"
#define PRIdMAX "I64d"
#define PRIiMAX "I64i"
#define PRIdPTR "Id"
#define PRIiPTR "Ii"
// The fprintf macros for unsigned integers are:
#define PRIo8 "o"
#define PRIu8 "u"
#define PRIx8 "x"
#define PRIX8 "X"
#define PRIoLEAST8 "o"
#define PRIuLEAST8 "u"
#define PRIxLEAST8 "x"
#define PRIXLEAST8 "X"
#define PRIoFAST8 "o"
#define PRIuFAST8 "u"
#define PRIxFAST8 "x"
#define PRIXFAST8 "X"
#define PRIo16 "ho"
#define PRIu16 "hu"
#define PRIx16 "hx"
#define PRIX16 "hX"
#define PRIoLEAST16 "ho"
#define PRIuLEAST16 "hu"
#define PRIxLEAST16 "hx"
#define PRIXLEAST16 "hX"
#define PRIoFAST16 "ho"
#define PRIuFAST16 "hu"
#define PRIxFAST16 "hx"
#define PRIXFAST16 "hX"
#define PRIo32 "I32o"
#define PRIu32 "I32u"
#define PRIx32 "I32x"
#define PRIX32 "I32X"
#define PRIoLEAST32 "I32o"
#define PRIuLEAST32 "I32u"
#define PRIxLEAST32 "I32x"
#define PRIXLEAST32 "I32X"
#define PRIoFAST32 "I32o"
#define PRIuFAST32 "I32u"
#define PRIxFAST32 "I32x"
#define PRIXFAST32 "I32X"
#define PRIo64 "I64o"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
#define PRIX64 "I64X"
#define PRIoLEAST64 "I64o"
#define PRIuLEAST64 "I64u"
#define PRIxLEAST64 "I64x"
#define PRIXLEAST64 "I64X"
#define PRIoFAST64 "I64o"
#define PRIuFAST64 "I64u"
#define PRIxFAST64 "I64x"
#define PRIXFAST64 "I64X"
#define PRIoMAX "I64o"
#define PRIuMAX "I64u"
#define PRIxMAX "I64x"
#define PRIXMAX "I64X"
#define PRIoPTR "Io"
#define PRIuPTR "Iu"
#define PRIxPTR "Ix"
#define PRIXPTR "IX"
// The fscanf macros for signed integers are:
#define SCNd8 "d"
#define SCNi8 "i"
#define SCNdLEAST8 "d"
#define SCNiLEAST8 "i"
#define SCNdFAST8 "d"
#define SCNiFAST8 "i"
#define SCNd16 "hd"
#define SCNi16 "hi"
#define SCNdLEAST16 "hd"
#define SCNiLEAST16 "hi"
#define SCNdFAST16 "hd"
#define SCNiFAST16 "hi"
#define SCNd32 "ld"
#define SCNi32 "li"
#define SCNdLEAST32 "ld"
#define SCNiLEAST32 "li"
#define SCNdFAST32 "ld"
#define SCNiFAST32 "li"
#define SCNd64 "I64d"
#define SCNi64 "I64i"
#define SCNdLEAST64 "I64d"
#define SCNiLEAST64 "I64i"
#define SCNdFAST64 "I64d"
#define SCNiFAST64 "I64i"
#define SCNdMAX "I64d"
#define SCNiMAX "I64i"
#ifdef _WIN64 // [
# define SCNdPTR "I64d"
# define SCNiPTR "I64i"
#else // _WIN64 ][
# define SCNdPTR "ld"
# define SCNiPTR "li"
#endif // _WIN64 ]
// The fscanf macros for unsigned integers are:
#define SCNo8 "o"
#define SCNu8 "u"
#define SCNx8 "x"
#define SCNX8 "X"
#define SCNoLEAST8 "o"
#define SCNuLEAST8 "u"
#define SCNxLEAST8 "x"
#define SCNXLEAST8 "X"
#define SCNoFAST8 "o"
#define SCNuFAST8 "u"
#define SCNxFAST8 "x"
#define SCNXFAST8 "X"
#define SCNo16 "ho"
#define SCNu16 "hu"
#define SCNx16 "hx"
#define SCNX16 "hX"
#define SCNoLEAST16 "ho"
#define SCNuLEAST16 "hu"
#define SCNxLEAST16 "hx"
#define SCNXLEAST16 "hX"
#define SCNoFAST16 "ho"
#define SCNuFAST16 "hu"
#define SCNxFAST16 "hx"
#define SCNXFAST16 "hX"
#define SCNo32 "lo"
#define SCNu32 "lu"
#define SCNx32 "lx"
#define SCNX32 "lX"
#define SCNoLEAST32 "lo"
#define SCNuLEAST32 "lu"
#define SCNxLEAST32 "lx"
#define SCNXLEAST32 "lX"
#define SCNoFAST32 "lo"
#define SCNuFAST32 "lu"
#define SCNxFAST32 "lx"
#define SCNXFAST32 "lX"
#define SCNo64 "I64o"
#define SCNu64 "I64u"
#define SCNx64 "I64x"
#define SCNX64 "I64X"
#define SCNoLEAST64 "I64o"
#define SCNuLEAST64 "I64u"
#define SCNxLEAST64 "I64x"
#define SCNXLEAST64 "I64X"
#define SCNoFAST64 "I64o"
#define SCNuFAST64 "I64u"
#define SCNxFAST64 "I64x"
#define SCNXFAST64 "I64X"
#define SCNoMAX "I64o"
#define SCNuMAX "I64u"
#define SCNxMAX "I64x"
#define SCNXMAX "I64X"
#ifdef _WIN64 // [
# define SCNoPTR "I64o"
# define SCNuPTR "I64u"
# define SCNxPTR "I64x"
# define SCNXPTR "I64X"
#else // _WIN64 ][
# define SCNoPTR "lo"
# define SCNuPTR "lu"
# define SCNxPTR "lx"
# define SCNXPTR "lX"
#endif // _WIN64 ]
#endif // __STDC_FORMAT_MACROS ]
// 7.8.2 Functions for greatest-width integer types
// 7.8.2.1 The imaxabs function
#define imaxabs _abs64
// 7.8.2.2 The imaxdiv function
// This is modified version of div() function from Microsoft's div.c found
// in %MSVC.NET%\crt\src\div.c
#ifdef STATIC_IMAXDIV // [
static
#else // STATIC_IMAXDIV ][
_inline
#endif // STATIC_IMAXDIV ]
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
{
imaxdiv_t result;
result.quot = numer / denom;
result.rem = numer % denom;
if (numer < 0 && result.rem > 0) {
// did division wrong; must fix up
++result.quot;
result.rem -= denom;
}
return result;
}
// 7.8.2.3 The strtoimax and strtoumax functions
#define strtoimax _strtoi64
#define strtoumax _strtoui64
// 7.8.2.4 The wcstoimax and wcstoumax functions
#define wcstoimax _wcstoi64
#define wcstoumax _wcstoui64
#endif // _MSC_INTTYPES_H_ ]

View File

@@ -0,0 +1,47 @@
/**************************************************************************
*
* Copyright 2007-2010 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
**************************************************************************/
#ifndef _STDBOOL_H_
#define _STDBOOL_H_
#ifndef __cplusplus
#define false 0
#define true 1
#define bool _Bool
/* For compilers that don't have the builtin _Bool type. */
#if (defined(_MSC_VER) && _MSC_VER < 1800) || \
(defined __GNUC__&& __STDC_VERSION__ < 199901L && __GNUC__ < 3)
typedef unsigned char _Bool;
#endif
#endif /* !__cplusplus */
#define __bool_true_false_are_defined 1
#endif /* !_STDBOOL_H_ */

Some files were not shown because too many files have changed in this diff Show More