• skip to content



flink-project

Universal Serial Interface to FPGA's

User Tools

  • Admin
  • Log In

Site Tools

  • Recent Changes
  • Media Manager
  • Sitemap
You are here: start » flink_lib

flink_lib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
flink_lib [2015/02/26 14:31] – [flink Userspace Library] ursgrafflink_lib [2024/06/13 13:49] (current) – [Building for a different platform architecture] ursgraf
Line 5: Line 5:
 </box> </box>
  
-This is the user documentation for the flink userspace library in C. It provides a device and bus independent interface to the underlying driver modules. For more information about the inner workings see [[https://github.com/flink-project/flinklib | flink Userspace Library on Github]]. The API of the library can be found under [[http://api.flink-project.ch/doc/html]]+This is the user documentation for the flink userspace library in C. It provides a device and bus independent interface to the underlying driver modules. For more information about the inner workings see [[https://github.com/flink-project/flinklib | flink Userspace Library on Github]]. The API of the library can be found under [[http://api.flink-project.ch/doc/flinklib/html|API]]
  
 ===== Overview ===== ===== Overview =====
 <box green right 38% | **Examples**> <box green right 38% | **Examples**>
-  * [[.:flink_lib:high_level_example | Toggle GPIO using high-level API]] +  * [[.:flink_lib:high_level_example | Use GPIO using high-level API]] 
-  * [[https://vvv | ??? low-level API]]+  * [[.:flink_lib:low_level_example | Use low-level API for custom function]]
 </box> </box>
 When flink is used on a Linux based system the flink userspace library offers an simple interface to communicate with the underlying kernel modules. The userspace library is split in two parts.  When flink is used on a Linux based system the flink userspace library offers an simple interface to communicate with the underlying kernel modules. The userspace library is split in two parts. 
Line 26: Line 26:
  
 ===== Building ===== ===== Building =====
-  - Clone git repository: <code>git clone https://github.com/flink-project/flinklib.git</code>+  - Clone git repository and all submodules: <code>git clone https://github.com/flink-project/flinklib.git --recursive 
 +cd flinklib 
 +git submodule init 
 +git submodule update 
 +</code> 
 +  - Checkout a stable version<code>git checkout v1.1.2</code>
   - Create a build directory: <code>mkdir build-local</code>   - Create a build directory: <code>mkdir build-local</code>
-  - Change to the build directory and setup your build environment with CMake: <code>cmake ..</code> Optional: you can specify an installation prefix path with <code>cmake DCMAKE_INSTALL_PREFIX:PATH=/usr/local/ ..</code>+  - Change to the build directory and setup your build environment with CMake: <code>cmake ..</code> Optional: you can specify an installation prefix path with <code>cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/ ..</code>
   - Build the source code: <code>make</code>   - Build the source code: <code>make</code>
  
 ===== Building for a different platform architecture ===== ===== Building for a different platform architecture =====
-  - Clone git repository: <code>git clone https://github.com/flink-project/flinklib.git</code>+  - Clone git repository and all submodules: <code>git clone https://github.com/flink-project/flinklib.git --recursive 
 +cd flinklib 
 +git submodule init 
 +git submodule update</code> 
 +  - Checkout a stable version <code>git checkout v1.1.2</code>
   - Create a build directory for the target platform, e.g.: <code>mkdir build-powerpc</code>   - Create a build directory for the target platform, e.g.: <code>mkdir build-powerpc</code>
   - Create a CMake toolchain file. For more informations, please have a look at the [[http://www.cmake.org/Wiki/CMake_Cross_Compiling|CMake Wiki]]. This file has to specify which compiler has to be used and where it can be found on the system.    - Create a CMake toolchain file. For more informations, please have a look at the [[http://www.cmake.org/Wiki/CMake_Cross_Compiling|CMake Wiki]]. This file has to specify which compiler has to be used and where it can be found on the system. 
Line 51: Line 60:
 Here, the second subdevice is selected. You could also select a subdevice by its uniqe id. <code>flink_subdev* subdev = flink_get_subdevice_by_unique_id(dev, 0x23a5);</code> Here, the second subdevice is selected. You could also select a subdevice by its uniqe id. <code>flink_subdev* subdev = flink_get_subdevice_by_unique_id(dev, 0x23a5);</code>
 Here, the subdevice with ''unique_id = 0x23a5'' is selected. This has the advantage that this unique_id does not change even in the case where subdevices are arranged differently in a FPGA design. Here, the subdevice with ''unique_id = 0x23a5'' is selected. This has the advantage that this unique_id does not change even in the case where subdevices are arranged differently in a FPGA design.
-Now you cann communicate with this selected subdevice. Assuming that it's of type GPIO you could configure it as an input or output.+Now you can communicate with this selected subdevice. Assuming that it's of type GPIO you could configure it as an input or output.
 <code>flink_dio_set_direction(subdev, 0, true); <code>flink_dio_set_direction(subdev, 0, true);
 flink_dio_set_value(subdev, 0, false);</code> flink_dio_set_value(subdev, 0, false);</code>
 This sets channel 0 to output and writes a logical 0.As a last step you have to close the device. This sets channel 0 to output and writes a logical 0.As a last step you have to close the device.
 <code>flink_close(dev);</code> <code>flink_close(dev);</code>
- 
flink_lib.1424957517.txt.gz · Last modified: 2016/02/25 13:32 (external edit)

Page Tools

  • Show page
  • Old revisions
  • Back to top
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki