Example: fetch ADC samples in a ring buffer and save to file. More...
#include "unistd.h"
#include "time.h"
#include "stdio.h"
#include "libpruio/pruio.h"
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
The main function. More... | |
Example: fetch ADC samples in a ring buffer and save to file.
This file contains an example on how to use the ring buffer mode of libpruio. A fixed step mask of AIN-0, AIN-1 and AIN-2 get configured for maximum speed, sampled in to the ring buffer and from there saved as raw data to some files. Find a functional description in section rb_file.
Licence: GPLv3, Copyright 2014-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net
Thanks for C code translation: Nils Kohrs nils. kohr s@gma il.c om
Compile by: gcc -Wall -o rb_file rb_file.c -lpruio
Definition in file rb_file.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
The main function.
< The number of samples in the files (per step).
< The sampling rate in ns (20000 -> 50 kHz).
< The number of active steps (must match setStep calls and mask).
< The number of files to write.
< The output file names.
create new driver
< The active steps (9 to 11).
< The maximum total index.
< The maximum index of the half ring buffer.
< The number of samples (per step).
< A pointer to the start of the ring buffer.
< A pointer to the middle of the ring buffer.
< File counter.
< Start index.
Definition at line 25 of file rb_file.c.