This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
flink_lib [2015/02/24 09:15] – [Using a flink Device] ursgraf | flink_lib [2020/06/26 14:22] (current) – [Building for a different platform architecture] ursgraf | ||
---|---|---|---|
Line 5: | Line 5: | ||
</ | </ | ||
- | 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:// | + | 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:// |
===== Overview ===== | ===== Overview ===== | ||
<box green right 38% | **Examples**> | <box green right 38% | **Examples**> | ||
- | * [[.: | + | * [[.: |
- | * [[https://vvv | ??? low-level API]] | + | * [[.:flink_lib: |
</ | </ | ||
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 16: | Line 16: | ||
* Low-Level API: Can be used to access user-defined subdevices. | * Low-Level API: Can be used to access user-defined subdevices. | ||
- | [{{ : | + | [{{ libraryapis.png? |
The library must be built for the desired target platform architecture. | The library must be built for the desired target platform architecture. | ||
Line 26: | Line 26: | ||
===== Building ===== | ===== Building ===== | ||
- | - Clone git repository: < | + | - Clone git repository |
+ | cd flinklib | ||
+ | git submodule init | ||
+ | git submodule update | ||
+ | </ | ||
+ | - Checkout a stable version< | ||
- Create a build directory: < | - Create a build directory: < | ||
- | - Change to the build directory and setup your build environment with CMake: < | + | - Change to the build directory and setup your build environment with CMake: < |
- Build the source code: < | - Build the source code: < | ||
===== Building for a different platform architecture ===== | ===== Building for a different platform architecture ===== | ||
- | - Clone git repository: < | + | - Clone git repository |
+ | cd flinklib | ||
+ | git submodule init | ||
+ | git submodule update</ | ||
+ | - Checkout a branch < | ||
- Create a build directory for the target platform, e.g.: < | - Create a build directory for the target platform, e.g.: < | ||
- Create a CMake toolchain file. For more informations, | - Create a CMake toolchain file. For more informations, | ||
Line 38: | Line 47: | ||
- Build the source code: < | - Build the source code: < | ||
+ | ===== Generating the documentation ===== | ||
+ | Create the makefile with cmake (in the root directory): < | ||
+ | After this generate the documentation as given in the '' | ||
===== Installation ===== | ===== Installation ===== | ||
- | - Install the library and header files on your system: < | + | Install the library and header files on your system: < |
===== Using a flink Device ===== | ===== Using a flink Device ===== | ||
Line 48: | Line 60: | ||
Here, the second subdevice is selected. You could also select a subdevice by its uniqe id. < | Here, the second subdevice is selected. You could also select a subdevice by its uniqe id. < | ||
Here, the subdevice with '' | Here, the subdevice with '' | ||
- | 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. |
< | < | ||
flink_dio_set_value(subdev, | flink_dio_set_value(subdev, | ||
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. | ||
< | < | ||
- |